From 95361865896d497c00fac0c2915c6ea37c75788c Mon Sep 17 00:00:00 2001 From: Tanqiu Liu Date: Tue, 4 Apr 2023 21:40:34 -0700 Subject: [PATCH 01/29] Initial impl Signed-off-by: Tanqiu Liu --- .../model/ActionProperties.kt | 14 +- .../model/TransformActionProperties.kt | 65 ++++++ .../action/TransformAction.kt | 49 +++++ .../action/TransformActionParser.kt | 42 ++++ .../AttemptCreateTransformJobStep.kt | 125 +++++++++++ .../WaitForTransformCompletionStep.kt | 122 +++++++++++ .../transform/model/ISMTransform.kt | 207 ++++++++++++++++++ 7 files changed, 621 insertions(+), 3 deletions(-) create mode 100644 spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt create mode 100644 src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt create mode 100644 src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionParser.kt create mode 100644 src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt create mode 100644 src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt create mode 100644 src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionProperties.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionProperties.kt index 7772df216..0da26bf6c 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionProperties.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionProperties.kt @@ -23,7 +23,8 @@ data class ActionProperties( val snapshotName: String? = null, val rollupId: String? = null, val hasRollupFailed: Boolean? = null, - val shrinkActionProperties: ShrinkActionProperties? = null + val shrinkActionProperties: ShrinkActionProperties? = null, + val transformActionProperties: TransformActionProperties? = null ) : Writeable, ToXContentFragment { override fun writeTo(out: StreamOutput) { @@ -32,6 +33,7 @@ data class ActionProperties( out.writeOptionalString(rollupId) out.writeOptionalBoolean(hasRollupFailed) out.writeOptionalWriteable(shrinkActionProperties) + out.writeOptionalWriteable(transformActionProperties) } override fun toXContent(builder: XContentBuilder, params: ToXContent.Params): XContentBuilder { @@ -40,6 +42,7 @@ data class ActionProperties( if (rollupId != null) builder.field(Properties.ROLLUP_ID.key, rollupId) if (hasRollupFailed != null) builder.field(Properties.HAS_ROLLUP_FAILED.key, hasRollupFailed) if (shrinkActionProperties != null) builder.addObject(ShrinkActionProperties.SHRINK_ACTION_PROPERTIES, shrinkActionProperties, params) + if (transformActionProperties != null) builder.addObject(TransformActionProperties.TRANSFORM_ACTION_PROPERTIES, transformActionProperties, params) return builder } @@ -52,7 +55,8 @@ data class ActionProperties( val rollupId: String? = si.readOptionalString() val hasRollupFailed: Boolean? = si.readOptionalBoolean() val shrinkActionProperties: ShrinkActionProperties? = si.readOptionalWriteable { ShrinkActionProperties.fromStreamInput(it) } - return ActionProperties(maxNumSegments, snapshotName, rollupId, hasRollupFailed, shrinkActionProperties) + val transformActionProperties: TransformActionProperties? = si.readOptionalWriteable { TransformActionProperties.fromStreamInput(it) } + return ActionProperties(maxNumSegments, snapshotName, rollupId, hasRollupFailed, shrinkActionProperties, transformActionProperties) } fun parse(xcp: XContentParser): ActionProperties { @@ -61,6 +65,7 @@ data class ActionProperties( var rollupId: String? = null var hasRollupFailed: Boolean? = null var shrinkActionProperties: ShrinkActionProperties? = null + var transformActionProperties: TransformActionProperties? = null ensureExpectedToken(Token.START_OBJECT, xcp.currentToken(), xcp) while (xcp.nextToken() != Token.END_OBJECT) { @@ -75,10 +80,13 @@ data class ActionProperties( ShrinkActionProperties.SHRINK_ACTION_PROPERTIES -> { shrinkActionProperties = if (xcp.currentToken() == Token.VALUE_NULL) null else ShrinkActionProperties.parse(xcp) } + TransformActionProperties.TRANSFORM_ACTION_PROPERTIES -> { + transformActionProperties = if (xcp.currentToken() == Token.VALUE_NULL) null else TransformActionProperties.parse(xcp) + } } } - return ActionProperties(maxNumSegments, snapshotName, rollupId, hasRollupFailed, shrinkActionProperties) + return ActionProperties(maxNumSegments, snapshotName, rollupId, hasRollupFailed, shrinkActionProperties, transformActionProperties) } } diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt new file mode 100644 index 000000000..671c4eeee --- /dev/null +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt @@ -0,0 +1,65 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.spi.indexstatemanagement.model + +import org.opensearch.common.io.stream.StreamInput +import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.common.io.stream.Writeable +import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.ToXContent +import org.opensearch.core.xcontent.ToXContentFragment +import org.opensearch.core.xcontent.XContentBuilder +import org.opensearch.core.xcontent.XContentParser + +data class TransformActionProperties( + val transformId: String?, + val hasTransformFailed: Boolean? +) : Writeable, ToXContentFragment { + + override fun writeTo(out: StreamOutput) { + out.writeOptionalString(transformId) + out.writeOptionalBoolean(hasTransformFailed) + } + + override fun toXContent(builder: XContentBuilder, params: ToXContent.Params?): XContentBuilder { + if (transformId != null) builder.field(Properties.TRANSFORM_ID.key, transformId) + if (hasTransformFailed != null) builder.field(Properties.HAS_TRANSFORM_FAILED.key, hasTransformFailed) + return builder + } + + companion object { + const val TRANSFORM_ACTION_PROPERTIES = "transform_action_properties" + + fun fromStreamInput(sin: StreamInput): TransformActionProperties { + val transformId: String? = sin.readOptionalString() + val hasTransformFailed: Boolean? = sin.readOptionalBoolean() + return TransformActionProperties(transformId, hasTransformFailed) + } + + fun parse(xcp: XContentParser): TransformActionProperties { + var transformId: String? = null + var hasTransformFailed: Boolean? = null + + ensureExpectedToken(XContentParser.Token.START_OBJECT, xcp.currentToken(), xcp) + while (xcp.nextToken() != XContentParser.Token.END_OBJECT) { + val fieldName = xcp.currentName() + xcp.nextToken() + + when (fieldName) { + Properties.TRANSFORM_ID.key -> transformId = xcp.text() + Properties.HAS_TRANSFORM_FAILED.key -> hasTransformFailed = xcp.booleanValue() + } + } + + return TransformActionProperties(requireNotNull(transformId), requireNotNull(hasTransformFailed)) + } + } + + enum class Properties(val key: String) { + TRANSFORM_ID("transformId"), + HAS_TRANSFORM_FAILED("has_transform_failed") + } +} diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt new file mode 100644 index 000000000..e836ffbd1 --- /dev/null +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.indexstatemanagement.action + +import org.opensearch.indexmanagement.indexstatemanagement.step.transform.AttemptCreateTransformJobStep +import org.opensearch.indexmanagement.indexstatemanagement.step.transform.WaitForTransformCompletionStep +import org.opensearch.indexmanagement.spi.indexstatemanagement.Action +import org.opensearch.indexmanagement.spi.indexstatemanagement.Step +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepContext +import org.opensearch.indexmanagement.transform.model.ISMTransform + +class TransformAction( + val ismTransform: ISMTransform, + index: Int +) : Action(name, index) { + + companion object { + const val name = "transform" + const val ISM_TRANSFORM_FIELD = "ism_transform" + } + + private val attemptCreateTransformJobStep = AttemptCreateTransformJobStep(this) + private val waitForTransformCompletionStep = WaitForTransformCompletionStep() + private val steps = listOf(attemptCreateTransformJobStep, waitForTransformCompletionStep) + + @Suppress("ReturnCount") + override fun getStepToExecute(context: StepContext): Step { + // if stepMetaData is null, return first step + val stepMetaData = context.metadata.stepMetaData ?: return attemptCreateTransformJobStep + + // if the current step has completed, return the next step + if (stepMetaData.stepStatus == Step.StepStatus.COMPLETED) { + return when (stepMetaData.name) { + AttemptCreateTransformJobStep.name -> waitForTransformCompletionStep + else -> attemptCreateTransformJobStep + } + } + + return when (stepMetaData.name) { + AttemptCreateTransformJobStep.name -> attemptCreateTransformJobStep + else -> waitForTransformCompletionStep + } + } + + override fun getSteps(): List = steps +} diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionParser.kt new file mode 100644 index 000000000..c56a3e3fe --- /dev/null +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionParser.kt @@ -0,0 +1,42 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.indexstatemanagement.action + +import org.opensearch.common.io.stream.StreamInput +import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParser +import org.opensearch.indexmanagement.spi.indexstatemanagement.Action +import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser +import org.opensearch.indexmanagement.transform.model.ISMTransform + +class TransformActionParser : ActionParser() { + override fun fromStreamInput(sin: StreamInput): Action { + val ismTransform = ISMTransform(sin) + val index = sin.readInt() + return TransformAction(ismTransform, index) + } + + override fun fromXContent(xcp: XContentParser, index: Int): Action { + var ismTransform: ISMTransform? = null + + XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, xcp.currentToken(), xcp) + while (xcp.nextToken() != XContentParser.Token.END_OBJECT) { + val fieldName = xcp.currentName() + xcp.nextToken() + + when (fieldName) { + TransformAction.ISM_TRANSFORM_FIELD -> ismTransform = ISMTransform.parse(xcp) + else -> throw IllegalArgumentException("Invalid field: [$fieldName] found in TransformAction.") + } + } + + return TransformAction(ismTransform = requireNotNull(ismTransform) { "TransformAction transform is null." }, index) + } + + override fun getActionType(): String { + return TransformAction.name + } +} diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt new file mode 100644 index 000000000..9cd4f7b7c --- /dev/null +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt @@ -0,0 +1,125 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.indexstatemanagement.step.transform + +import org.apache.logging.log4j.LogManager +import org.opensearch.ExceptionsHelper +import org.opensearch.OpenSearchException +import org.opensearch.action.support.WriteRequest +import org.opensearch.action.support.master.AcknowledgedResponse +import org.opensearch.client.Client +import org.opensearch.index.engine.VersionConflictEngineException +import org.opensearch.indexmanagement.indexstatemanagement.action.TransformAction +import org.opensearch.indexmanagement.opensearchapi.suspendUntil +import org.opensearch.indexmanagement.spi.indexstatemanagement.Step +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionProperties +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepContext +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepMetaData +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.TransformActionProperties +import org.opensearch.indexmanagement.transform.action.index.IndexTransformAction +import org.opensearch.indexmanagement.transform.action.index.IndexTransformRequest +import org.opensearch.indexmanagement.transform.action.index.IndexTransformResponse +import org.opensearch.indexmanagement.transform.action.start.StartTransformAction +import org.opensearch.indexmanagement.transform.action.start.StartTransformRequest +import org.opensearch.transport.RemoteTransportException + +class AttemptCreateTransformJobStep( + private val action: TransformAction +) : Step(name) { + + private val logger = LogManager.getLogger(javaClass) + private var stepStatus = StepStatus.STARTING + private var info: Map? = null + private var transformId: String? = null + private var hasTransformFailed: Boolean? = null + + override suspend fun execute(): Step { + val context = this.context ?: return this + val indexName = context.metadata.index + val managedIndexMetadata = context.metadata + val previousRunTransformId = managedIndexMetadata.actionMetaData?.actionProperties?.transformActionProperties?.transformId + val hasPreviousTransformAttemptFailed = managedIndexMetadata.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed + + // Creating a transform job + val transform = action.ismTransform.toTransform(indexName, context.user) + transformId = transform.id + logger.info("Attempting to create a transform job $transformId for index $indexName") + + val indexTransformRequest = IndexTransformRequest(transform, WriteRequest.RefreshPolicy.IMMEDIATE) + + try { + val response: IndexTransformResponse = context.client.suspendUntil { execute(IndexTransformAction.INSTANCE, indexTransformRequest, it) } + logger.info("Received status ${response.status.status} on trying to create transform job $transformId") + + stepStatus = StepStatus.COMPLETED + info = mapOf("message" to getSuccessMessage(transform.id, indexName)) + } catch (e: VersionConflictEngineException) { + val message = getFailedJobExistsMessage(transform.id, indexName) + logger.info(message) + if (transformId == previousRunTransformId && hasPreviousTransformAttemptFailed == true) { + startTransformJob(transform.id, context) + } else { + stepStatus = StepStatus.COMPLETED + info = mapOf("info" to message) + } + } catch (e: RemoteTransportException) { + processFailure(transform.id, indexName, ExceptionsHelper.unwrapCause(e) as Exception) + } catch (e: OpenSearchException) { + processFailure(transform.id, indexName, e) + } catch (e: Exception) { + processFailure(transform.id, indexName, e) + } + + return this + } + + fun processFailure(transformId: String, indexName: String, e: Exception) { + val message = getFailedMessage(transformId, indexName) + logger.error(message, e) + stepStatus = StepStatus.FAILED + info = mapOf("message" to message, "cause" to "${e.message}") + } + + private suspend fun startTransformJob(transformId: String, context: StepContext) { + val indexName = context.metadata.index + val client = context.client + logger.info("Attempting to re-start the transform job $transformId") + try { + val startTransformRequest = StartTransformRequest(transformId) + client.suspendUntil { execute(StartTransformAction.INSTANCE, startTransformRequest, it) } + stepStatus = StepStatus.COMPLETED + info = mapOf("message" to getSuccessRestartMessage(transformId, indexName)) + } catch (e: Exception) { + val message = getFailedToStartMessage(transformId, indexName) + logger.error(message, e) + stepStatus = StepStatus.FAILED + info = mapOf("message" to message) + } + } + + override fun getUpdatedManagedIndexMetadata(currentMetadata: ManagedIndexMetaData): ManagedIndexMetaData { + val currentActionMetaData = currentMetadata.actionMetaData + val transformActionProperties = TransformActionProperties(transformId, hasTransformFailed) + return currentMetadata.copy( + actionMetaData = currentActionMetaData?.copy(actionProperties = ActionProperties(transformActionProperties = transformActionProperties)), + stepMetaData = StepMetaData(name, getStepStartTime(currentMetadata).toEpochMilli(), stepStatus), + transitionTo = null, + info = info + ) + } + + override fun isIdempotent(): Boolean = true + + companion object { + const val name = "attempt_create_transform" + fun getFailedMessage(transformId: String, index: String) = "Failed to create the transform job [$transformId] [index=$index]" + fun getFailedJobExistsMessage(transformId: String, index: String) = "Transform job [$transformId] already exists, skipping creation [index=$index]" + fun getFailedToStartMessage(transformId: String, index: String) = "Failed to start the transform job [$transformId] [index=$index]" + fun getSuccessMessage(transformId: String, index: String) = "Successfully created the transform job [$transformId] [index=$index]" + fun getSuccessRestartMessage(transformId: String, index: String) = "Successfully restarted the transform job [$transformId] [index=$index]" + } +} diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt new file mode 100644 index 000000000..f697cfbd8 --- /dev/null +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt @@ -0,0 +1,122 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.indexstatemanagement.step.transform + +import org.apache.logging.log4j.LogManager +import org.opensearch.indexmanagement.opensearchapi.suspendUntil +import org.opensearch.indexmanagement.spi.indexstatemanagement.Step +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepMetaData +import org.opensearch.indexmanagement.transform.action.explain.ExplainTransformAction +import org.opensearch.indexmanagement.transform.action.explain.ExplainTransformRequest +import org.opensearch.indexmanagement.transform.action.explain.ExplainTransformResponse +import org.opensearch.indexmanagement.transform.model.TransformMetadata +import org.opensearch.transport.RemoteTransportException + +class WaitForTransformCompletionStep : Step(name) { + + private val logger = LogManager.getLogger(javaClass) + private var stepStatus = StepStatus.STARTING + private var info: Map? = null + private var hasTransformFailed: Boolean? = null + + override suspend fun execute(): Step { + val context = this.context ?: return this + val indexName = context.metadata.index + val managedIndexMetadata = context.metadata + val transformJobId = managedIndexMetadata.actionMetaData?.actionProperties?.transformActionProperties?.transformId + + if (transformJobId == null) { + logger.error("No transform job id passed down.") + stepStatus = StepStatus.FAILED + info = mapOf("message" to getMissingTransformJobMessage(indexName)) + } else { + val explainTransformRequest = ExplainTransformRequest(listOf(transformJobId)) + try { + val response: ExplainTransformResponse = context.client.suspendUntil { execute(ExplainTransformAction.INSTANCE, explainTransformRequest, it) } + logger.info("Received the status for jobs [${response.getIdsToExplain().keys}]") + val metadata = response.getIdsToExplain()[transformJobId]?.metadata + + if (metadata?.status == null) { + logger.warn("Job $transformJobId has not started yet") + stepStatus = StepStatus.CONDITION_NOT_MET + info = mapOf("message" to getJobProcessingMessage(transformJobId, indexName)) + } else { + processTransformMetadataStatus(transformJobId, indexName, metadata) + } + } catch (e: RemoteTransportException) { + processFailure(transformJobId, indexName, e) + } catch (e: Exception) { + processFailure(transformJobId, indexName, e) + } + } + + return this + } + + fun processTransformMetadataStatus(transformJobId: String, indexName: String, transformMetadata: TransformMetadata) { + when (transformMetadata.status) { + TransformMetadata.Status.INIT, TransformMetadata.Status.STARTED -> { + stepStatus = StepStatus.CONDITION_NOT_MET + info = mapOf("message" to getJobProcessingMessage(transformJobId, indexName)) + } + TransformMetadata.Status.FAILED -> { + stepStatus = StepStatus.FAILED + hasTransformFailed = true + info = mapOf("message" to getJobFailedMessage(transformJobId, indexName), "cause" to "${transformMetadata.failureReason}") + } + TransformMetadata.Status.FINISHED -> { + stepStatus = StepStatus.COMPLETED + info = mapOf("message" to getJobCompletionMessage(transformJobId, indexName)) + } + TransformMetadata.Status.STOPPED -> { + stepStatus = StepStatus.FAILED + hasTransformFailed = true + info = mapOf("message" to getJobFailedMessage(transformJobId, indexName), "cause" to JOB_STOPPED_MESSAGE) + } + } + } + + fun processFailure(transformJobId: String, indexName: String, e: Exception) { + stepStatus = StepStatus.FAILED + val message = getFailedMessage(transformJobId, indexName) + logger.error(message, e) + val mutableInfo = mutableMapOf("message" to message) + val errorMessage = e.message + if (errorMessage != null) mutableInfo["cause"] = errorMessage + info = mutableInfo.toMap() + } + + override fun getUpdatedManagedIndexMetadata(currentMetadata: ManagedIndexMetaData): ManagedIndexMetaData { + val currentActionMetadata = currentMetadata.actionMetaData + val currentActionProperties = currentActionMetadata?.actionProperties + val currentTransformActionProperties = currentActionProperties?.transformActionProperties + return currentMetadata.copy( + actionMetaData = currentActionMetadata?.copy( + actionProperties = currentActionProperties?.copy( + transformActionProperties = currentTransformActionProperties?.copy( + hasTransformFailed = hasTransformFailed + ) + ) + ), + stepMetaData = StepMetaData(name, getStepStartTime(currentMetadata).toEpochMilli(), stepStatus), + transitionTo = null, + info = info + ) + } + + override fun isIdempotent(): Boolean = true + + companion object { + const val name = "wait_for_transform_completion" + const val JOB_STOPPED_MESSAGE = "Transform job was stopped" + fun getFailedMessage(transformJob: String, index: String) = "Failed to get the status of transform job [$transformJob] [index=$index]" + fun getJobProcessingMessage(transformJob: String, index: String) = "Transform job [$transformJob] is still processing [index=$index]" + fun getJobCompletionMessage(transformJob: String, index: String) = "Transform job [$transformJob] completed [index=$index]" + fun getJobFailedMessage(transformJob: String, index: String) = "Transform job [$transformJob] failed [index=$index]" + fun getMissingTransformJobMessage(index: String) = "Transform job was not found [index=$index]" + } +} diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt new file mode 100644 index 000000000..3cb29308f --- /dev/null +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt @@ -0,0 +1,207 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.transform.model + +import org.apache.commons.codec.digest.DigestUtils +import org.opensearch.common.bytes.BytesReference +import org.opensearch.common.io.stream.StreamInput +import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.common.io.stream.Writeable +import org.opensearch.common.xcontent.LoggingDeprecationHandler +import org.opensearch.common.xcontent.XContentFactory +import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.common.xcontent.XContentType +import org.opensearch.commons.authuser.User +import org.opensearch.core.xcontent.ToXContent +import org.opensearch.core.xcontent.ToXContentObject +import org.opensearch.core.xcontent.XContentBuilder +import org.opensearch.core.xcontent.XContentParser +import org.opensearch.index.query.AbstractQueryBuilder +import org.opensearch.index.query.MatchAllQueryBuilder +import org.opensearch.index.query.QueryBuilder +import org.opensearch.index.seqno.SequenceNumbers +import org.opensearch.indexmanagement.common.model.dimension.DateHistogram +import org.opensearch.indexmanagement.common.model.dimension.Dimension +import org.opensearch.indexmanagement.common.model.dimension.Histogram +import org.opensearch.indexmanagement.common.model.dimension.Terms +import org.opensearch.indexmanagement.util.IndexUtils +import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule +import org.opensearch.search.aggregations.AggregatorFactories +import java.io.IOException +import java.lang.StringBuilder +import java.time.Instant +import java.time.temporal.ChronoUnit +import kotlin.jvm.Throws + +data class ISMTransform( + val description: String, + val targetIndex: String, + val pageSize: Int, + val dataSelectionQuery: QueryBuilder = MatchAllQueryBuilder(), + val groups: List, + val aggregations: AggregatorFactories.Builder = AggregatorFactories.builder() +) : ToXContentObject, Writeable { + + init { + require(pageSize in Transform.MINIMUM_PAGE_SIZE..Transform.MAXIMUM_PAGE_SIZE) { + "Page size must be between ${Transform.MINIMUM_PAGE_SIZE} and ${Transform.MAXIMUM_PAGE_SIZE}" + } + require(targetIndex.isNotEmpty()) { "TargetIndex cannot be empty" } + require(groups.isNotEmpty()) { "Groups cannot be empty" } + aggregations.aggregatorFactories.forEach { + require(Transform.supportedAggregations.contains(it.type)) { + "Unsupported aggregation [${it.type}]" + } + } + } + + override fun toXContent(builder: XContentBuilder, params: ToXContent.Params?): XContentBuilder { + builder.startObject() + .field(Transform.DESCRIPTION_FIELD, description) + .field(Transform.TARGET_INDEX_FIELD, targetIndex) + .field(Transform.PAGE_SIZE_FIELD, pageSize) + .field(Transform.DATA_SELECTION_QUERY_FIELD, dataSelectionQuery) + .field(Transform.GROUPS_FIELD, groups) + .field(Transform.AGGREGATIONS_FIELD, aggregations) + builder.endObject() + return builder + } + + fun toTransform(sourceIndex: String, user: User? = null): Transform { + val id = sourceIndex + toString() + val currentTime = Instant.now() + return Transform( + id = DigestUtils.sha1Hex(id), + seqNo = SequenceNumbers.UNASSIGNED_SEQ_NO, + primaryTerm = SequenceNumbers.UNASSIGNED_PRIMARY_TERM, + schemaVersion = IndexUtils.DEFAULT_SCHEMA_VERSION, + jobSchedule = IntervalSchedule(Instant.now(), 1, ChronoUnit.MINUTES), + metadataId = null, + updatedAt = currentTime, + enabled = true, + enabledAt = currentTime, + description = this.description, + sourceIndex = sourceIndex, + dataSelectionQuery = this.dataSelectionQuery, + targetIndex = this.targetIndex, + pageSize = pageSize, + continuous = false, + groups = this.groups, + aggregations = this.aggregations, + user = user + ) + } + + @Throws(IOException::class) + constructor(sin: StreamInput) : this( + description = sin.readString(), + targetIndex = sin.readString(), + pageSize = sin.readInt(), + dataSelectionQuery = requireNotNull(sin.readOptionalNamedWriteable(QueryBuilder::class.java)) { "Query cannot be null" }, + groups = sin.let { + val dimensionList = mutableListOf() + val size = it.readVInt() + repeat(size) { _ -> + val type = it.readEnum(Dimension.Type::class.java) + dimensionList.add( + when (requireNotNull(type) { "Dimension type cannot be null" }) { + Dimension.Type.DATE_HISTOGRAM -> DateHistogram(sin) + Dimension.Type.TERMS -> Terms(sin) + Dimension.Type.HISTOGRAM -> Histogram(sin) + } + ) + } + dimensionList.toList() + }, + aggregations = requireNotNull(sin.readOptionalWriteable { AggregatorFactories.Builder(it) }) { "Aggregations cannot be null" } + ) + + override fun toString(): String { + val sbd = StringBuilder() + sbd.append(targetIndex) + sbd.append(pageSize) + sbd.append(dataSelectionQuery) + groups.forEach { + sbd.append(it.type) + sbd.append(it.sourceField) + } + sbd.append(aggregations) + + return sbd.toString() + } + + override fun writeTo(out: StreamOutput) { + out.writeString(description) + out.writeString(targetIndex) + out.writeInt(pageSize) + out.writeOptionalNamedWriteable(dataSelectionQuery) + out.writeVInt(groups.size) + for (group in groups) { + out.writeEnum(group.type) + when (group) { + is DateHistogram -> group.writeTo(out) + is Terms -> group.writeTo(out) + is Histogram -> group.writeTo(out) + } + } + out.writeOptionalWriteable(aggregations) + } + + companion object { + @Suppress("ComplexMethod", "LongMethod") + @JvmStatic + @Throws(IOException::class) + fun parse(xcp: XContentParser): ISMTransform { + var description = "" + var targetIndex = "" + var pageSize = 0 + var dataSelectionQuery: QueryBuilder = MatchAllQueryBuilder() + val groups = mutableListOf() + var aggregations: AggregatorFactories.Builder = AggregatorFactories.builder() + + XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, xcp.currentToken(), xcp) + + while (xcp.nextToken() != XContentParser.Token.END_OBJECT) { + val fieldName = xcp.currentName() + xcp.nextToken() + + when (fieldName) { + Transform.DESCRIPTION_FIELD -> description = xcp.text() + Transform.TARGET_INDEX_FIELD -> targetIndex = xcp.text() + Transform.PAGE_SIZE_FIELD -> pageSize = xcp.intValue() + Transform.DATA_SELECTION_QUERY_FIELD -> { + val registry = xcp.xContentRegistry + val source = xcp.mapOrdered() + val xContentBuilder = XContentFactory.jsonBuilder().map(source) + val sourceParser = XContentType.JSON.xContent().createParser( + registry, LoggingDeprecationHandler.INSTANCE, + BytesReference + .bytes(xContentBuilder).streamInput() + ) + dataSelectionQuery = AbstractQueryBuilder.parseInnerQueryBuilder(sourceParser) + } + Transform.GROUPS_FIELD -> { + XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_ARRAY, xcp.currentToken(), xcp) + while (xcp.nextToken() != XContentParser.Token.END_ARRAY) { + groups.add(Dimension.parse(xcp)) + } + } + Transform.AGGREGATIONS_FIELD -> aggregations = AggregatorFactories.parseAggregators(xcp) + else -> throw IllegalArgumentException("Invalid field [$fieldName] found in ISM Transform.") + } + } + + return ISMTransform( + description = description, + targetIndex = targetIndex, + pageSize = pageSize, + dataSelectionQuery = dataSelectionQuery, + groups = groups, + aggregations = aggregations + ) + } + } +} From 7dab6cff8325272f7c45435aeca6758a105f2012 Mon Sep 17 00:00:00 2001 From: Tanqiu Liu Date: Sat, 8 Apr 2023 01:38:22 -0700 Subject: [PATCH 02/29] fix style Signed-off-by: Tanqiu Liu --- .../step/transform/AttemptCreateTransformJobStep.kt | 3 ++- .../step/transform/WaitForTransformCompletionStep.kt | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt index 9cd4f7b7c..fa031ed31 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt @@ -117,7 +117,8 @@ class AttemptCreateTransformJobStep( companion object { const val name = "attempt_create_transform" fun getFailedMessage(transformId: String, index: String) = "Failed to create the transform job [$transformId] [index=$index]" - fun getFailedJobExistsMessage(transformId: String, index: String) = "Transform job [$transformId] already exists, skipping creation [index=$index]" + fun getFailedJobExistsMessage(transformId: String, index: String) = + "Transform job [$transformId] already exists, skipping creation [index=$index]" fun getFailedToStartMessage(transformId: String, index: String) = "Failed to start the transform job [$transformId] [index=$index]" fun getSuccessMessage(transformId: String, index: String) = "Successfully created the transform job [$transformId] [index=$index]" fun getSuccessRestartMessage(transformId: String, index: String) = "Successfully restarted the transform job [$transformId] [index=$index]" diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt index f697cfbd8..2825fc920 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt @@ -36,7 +36,9 @@ class WaitForTransformCompletionStep : Step(name) { } else { val explainTransformRequest = ExplainTransformRequest(listOf(transformJobId)) try { - val response: ExplainTransformResponse = context.client.suspendUntil { execute(ExplainTransformAction.INSTANCE, explainTransformRequest, it) } + val response: ExplainTransformResponse = context.client.suspendUntil { + execute(ExplainTransformAction.INSTANCE, explainTransformRequest, it) + } logger.info("Received the status for jobs [${response.getIdsToExplain().keys}]") val metadata = response.getIdsToExplain()[transformJobId]?.metadata From 40c9390bd107875d719451ccc8112f63db761c24 Mon Sep 17 00:00:00 2001 From: Tanqiu Liu Date: Fri, 14 Apr 2023 23:49:35 -0700 Subject: [PATCH 03/29] end to end functional Signed-off-by: Tanqiu Liu --- .../model/TransformActionProperties.kt | 2 +- .../indexmanagement/IndexManagementPlugin.kt | 3 +- .../indexstatemanagement/ISMActionsParser.kt | 4 +- .../ManagedIndexCoordinator.kt | 8 +- .../action/TransformAction.kt | 14 ++++ .../opensearchapi/OpenSearchExtensions.kt | 4 +- .../mappings/opendistro-ism-config.json | 81 +++++++++++++++++++ .../mappings/opendistro-ism-history.json | 4 + .../ManagedIndexCoordinatorTests.kt | 3 +- 9 files changed, 114 insertions(+), 9 deletions(-) diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt index 671c4eeee..c9d6c71f0 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt @@ -54,7 +54,7 @@ data class TransformActionProperties( } } - return TransformActionProperties(requireNotNull(transformId), requireNotNull(hasTransformFailed)) + return TransformActionProperties(transformId, hasTransformFailed) } } diff --git a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt index 09f138c8d..09decda6b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt @@ -437,7 +437,8 @@ class IndexManagementPlugin : JobSchedulerExtension, NetworkPlugin, ActionPlugin val managedIndexCoordinator = ManagedIndexCoordinator( environment.settings(), - client, clusterService, threadPool, indexManagementIndices, metadataService, templateService, indexMetadataProvider + client, clusterService, threadPool, indexManagementIndices, metadataService, templateService, indexMetadataProvider, + xContentRegistry ) val smRunner = SMRunner.init(client, threadPool, settings, indexManagementIndices, clusterService) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMActionsParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMActionsParser.kt index aedb4097c..0d85b53f9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMActionsParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMActionsParser.kt @@ -23,6 +23,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.action.RolloverAction import org.opensearch.indexmanagement.indexstatemanagement.action.RollupActionParser import org.opensearch.indexmanagement.indexstatemanagement.action.ShrinkActionParser import org.opensearch.indexmanagement.indexstatemanagement.action.SnapshotActionParser +import org.opensearch.indexmanagement.indexstatemanagement.action.TransformActionParser import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionRetry @@ -49,7 +50,8 @@ class ISMActionsParser private constructor() { RollupActionParser(), RolloverActionParser(), ShrinkActionParser(), - SnapshotActionParser() + SnapshotActionParser(), + TransformActionParser(), ) val customActionExtensionMap = mutableMapOf() diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt index bb286ea9e..6a9fd3db8 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt @@ -41,6 +41,7 @@ import org.opensearch.common.regex.Regex import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue import org.opensearch.commons.authuser.User +import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.index.Index import org.opensearch.index.IndexNotFoundException import org.opensearch.index.query.QueryBuilders @@ -116,7 +117,8 @@ class ManagedIndexCoordinator( indexManagementIndices: IndexManagementIndices, private val metadataService: MetadataService, private val templateService: ISMTemplateService, - private val indexMetadataProvider: IndexMetadataProvider + private val indexMetadataProvider: IndexMetadataProvider, + private val xContentRegistry: NamedXContentRegistry ) : ClusterStateListener, CoroutineScope by CoroutineScope(SupervisorJob() + Dispatchers.Default + CoroutineName("ManagedIndexCoordinator")), LifecycleListener() { @@ -455,7 +457,7 @@ class ManagedIndexCoordinator( return try { val response: SearchResponse = client.suspendUntil { search(searchRequest, it) } - parseFromSearchResponse(response = response, parse = Policy.Companion::parse) + parseFromSearchResponse(response, xContentRegistry, Policy.Companion::parse) } catch (ex: IndexNotFoundException) { emptyList() } catch (ex: ClusterBlockException) { @@ -706,7 +708,7 @@ class ManagedIndexCoordinator( } mRes.forEach { if (it.response.isExists) { - result[it.id] = contentParser(it.response.sourceAsBytesRef).parseWithType( + result[it.id] = contentParser(it.response.sourceAsBytesRef, xContentRegistry).parseWithType( it.response.id, it.response.seqNo, it.response.primaryTerm, ManagedIndexConfig.Companion::parse ) } diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt index e836ffbd1..48cf49904 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt @@ -5,6 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.action +import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.xcontent.ToXContent +import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.indexmanagement.indexstatemanagement.step.transform.AttemptCreateTransformJobStep import org.opensearch.indexmanagement.indexstatemanagement.step.transform.WaitForTransformCompletionStep import org.opensearch.indexmanagement.spi.indexstatemanagement.Action @@ -46,4 +49,15 @@ class TransformAction( } override fun getSteps(): List = steps + + override fun populateAction(builder: XContentBuilder, params: ToXContent.Params) { + builder.startObject(type) + builder.field(ISM_TRANSFORM_FIELD, ismTransform) + builder.endObject() + } + + override fun populateAction(out: StreamOutput) { + ismTransform.writeTo(out) + out.writeInt(actionIndex) + } } diff --git a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt index 54c77a8bd..4e685fec1 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt @@ -64,9 +64,9 @@ import kotlin.coroutines.suspendCoroutine const val OPENDISTRO_SECURITY_PROTECTED_INDICES_CONF_REQUEST = "_opendistro_security_protected_indices_conf_request" -fun contentParser(bytesReference: BytesReference): XContentParser { +fun contentParser(bytesReference: BytesReference, xContentRegistry: NamedXContentRegistry = NamedXContentRegistry.EMPTY): XContentParser { return XContentHelper.createParser( - NamedXContentRegistry.EMPTY, + xContentRegistry, LoggingDeprecationHandler.INSTANCE, bytesReference, XContentType.JSON diff --git a/src/main/resources/mappings/opendistro-ism-config.json b/src/main/resources/mappings/opendistro-ism-config.json index 92084c3ad..6750ed280 100644 --- a/src/main/resources/mappings/opendistro-ism-config.json +++ b/src/main/resources/mappings/opendistro-ism-config.json @@ -452,6 +452,83 @@ } } }, + "transform": { + "properties": { + "ism_transform": { + "properties": { + "description": { + "type": "text" + }, + "target_index": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "page_size": { + "type": "long" + }, + "data_selection_query": { + "type": "object", + "enabled": false + }, + "groups": { + "properties": { + "date_histogram": { + "properties": { + "source_field": { + "type": "keyword" + }, + "target_field": { + "type": "keyword" + }, + "fixed_interval": { + "type": "keyword" + }, + "calendar_interval": { + "type": "keyword" + }, + "timezone": { + "type": "keyword" + } + } + }, + "terms": { + "properties": { + "source_field": { + "type": "keyword" + }, + "target_field": { + "type": "keyword" + } + } + }, + "histogram": { + "properties": { + "source_field": { + "type": "keyword" + }, + "target_field": { + "type": "keyword" + }, + "interval": { + "type": "double" + } + } + } + } + }, + "aggregations": { + "type": "object", + "enabled": false + } + } + } + } + }, "shrink": { "properties": { "num_new_shards": { @@ -783,6 +860,10 @@ "shrink_action_properties": { "type": "object", "enabled": false + }, + "transform_action_properties": { + "type": "object", + "enabled": false } } } diff --git a/src/main/resources/mappings/opendistro-ism-history.json b/src/main/resources/mappings/opendistro-ism-history.json index ca5a8d8de..a592e61c8 100644 --- a/src/main/resources/mappings/opendistro-ism-history.json +++ b/src/main/resources/mappings/opendistro-ism-history.json @@ -112,6 +112,10 @@ "shrink_action_properties": { "type": "object", "enabled": false + }, + "transform_action_properties": { + "type": "object", + "enabled": false } } } diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/coordinator/ManagedIndexCoordinatorTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/coordinator/ManagedIndexCoordinatorTests.kt index f455fca15..bce83125e 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/coordinator/ManagedIndexCoordinatorTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/coordinator/ManagedIndexCoordinatorTests.kt @@ -22,6 +22,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.ManagedIndexCoordinat import org.opensearch.indexmanagement.indexstatemanagement.MetadataService import org.opensearch.indexmanagement.indexstatemanagement.settings.ManagedIndexSettings import org.opensearch.indexmanagement.indexstatemanagement.migration.ISMTemplateService +import org.opensearch.search.SearchModule import org.opensearch.test.ClusterServiceUtils import org.opensearch.test.OpenSearchTestCase import org.opensearch.threadpool.Scheduler @@ -77,7 +78,7 @@ class ManagedIndexCoordinatorTests : OpenSearchAllocationTestCase() { indexMetadataProvider = IndexMetadataProvider(settings, client, clusterService, mutableMapOf()) coordinator = ManagedIndexCoordinator( settings, client, clusterService, threadPool, indexManagementIndices, metadataService, - templateService, indexMetadataProvider + templateService, indexMetadataProvider, NamedXContentRegistry(SearchModule(Settings.EMPTY, emptyList()).namedXContents) ) } From 39cb7b5246b45a32b22ee2faa9f9274d6a1614a2 Mon Sep 17 00:00:00 2001 From: Tanqiu Liu Date: Sun, 16 Apr 2023 17:41:34 -0700 Subject: [PATCH 04/29] ISM transform unit tests & integ tests Signed-off-by: Tanqiu Liu --- .../transform/model/ISMTransform.kt | 1 + .../mappings/opendistro-ism-config.json | 2 +- .../mappings/opendistro-ism-history.json | 2 +- .../IndexManagementRestTestCase.kt | 4 +- .../IndexStateManagementRestTestCase.kt | 70 +++++ .../indexstatemanagement/TestHelpers.kt | 6 + .../action/TransformActionIT.kt | 265 ++++++++++++++++++ .../AttemptCreateTransformJobStepTests.kt | 62 ++++ .../WaitForTransformCompletionStepTests.kt | 193 +++++++++++++ .../indexmanagement/transform/TestHelpers.kt | 13 + .../transform/model/ISMTransformTests.kt | 49 ++++ .../cached-opendistro-ism-config.json | 83 +++++- .../cached-opendistro-ism-history.json | 6 +- 13 files changed, 750 insertions(+), 6 deletions(-) create mode 100644 src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt create mode 100644 src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCreateTransformJobStepTests.kt create mode 100644 src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForTransformCompletionStepTests.kt create mode 100644 src/test/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransformTests.kt diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt index 3cb29308f..9bc5a7ef9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt @@ -49,6 +49,7 @@ data class ISMTransform( require(pageSize in Transform.MINIMUM_PAGE_SIZE..Transform.MAXIMUM_PAGE_SIZE) { "Page size must be between ${Transform.MINIMUM_PAGE_SIZE} and ${Transform.MAXIMUM_PAGE_SIZE}" } + require(description.isNotEmpty()) { "Description cannot be empty" } require(targetIndex.isNotEmpty()) { "TargetIndex cannot be empty" } require(groups.isNotEmpty()) { "Groups cannot be empty" } aggregations.aggregatorFactories.forEach { diff --git a/src/main/resources/mappings/opendistro-ism-config.json b/src/main/resources/mappings/opendistro-ism-config.json index 6750ed280..bb66d7230 100644 --- a/src/main/resources/mappings/opendistro-ism-config.json +++ b/src/main/resources/mappings/opendistro-ism-config.json @@ -1,6 +1,6 @@ { "_meta" : { - "schema_version": 17 + "schema_version": 18 }, "dynamic": "strict", "properties": { diff --git a/src/main/resources/mappings/opendistro-ism-history.json b/src/main/resources/mappings/opendistro-ism-history.json index a592e61c8..1065b1ae3 100644 --- a/src/main/resources/mappings/opendistro-ism-history.json +++ b/src/main/resources/mappings/opendistro-ism-history.json @@ -1,6 +1,6 @@ { "_meta" : { - "schema_version": 5 + "schema_version": 6 }, "dynamic": "strict", "properties": { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt index b98fbb125..57f11198c 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt @@ -37,8 +37,8 @@ import kotlin.collections.HashSet abstract class IndexManagementRestTestCase : ODFERestTestCase() { - val configSchemaVersion = 17 - val historySchemaVersion = 5 + val configSchemaVersion = 18 + val historySchemaVersion = 6 // Having issues with tests leaking into other tests and mappings being incorrect and they are not caught by any pending task wait check as // they do not go through the pending task queue. Ideally this should probably be written in a way to wait for the diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt index 3d2cd9948..03d7940e2 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt @@ -19,6 +19,7 @@ import org.opensearch.client.Request import org.opensearch.client.Response import org.opensearch.client.ResponseException import org.opensearch.client.RestClient +import org.opensearch.cluster.ClusterModule import org.opensearch.cluster.metadata.IndexMetadata import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue @@ -60,6 +61,8 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.model.PolicyRetry import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StateMetaData import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepMetaData import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ValidationResult +import org.opensearch.indexmanagement.transform.model.Transform +import org.opensearch.indexmanagement.transform.model.TransformMetadata import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO @@ -67,6 +70,7 @@ import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule import org.opensearch.rest.RestRequest import org.opensearch.rest.RestStatus +import org.opensearch.search.SearchModule import org.opensearch.test.OpenSearchTestCase import java.io.IOException import java.time.Duration @@ -821,6 +825,63 @@ abstract class IndexStateManagementRestTestCase : IndexManagementRestTestCase() return metadata } + protected fun getTransform( + transformId: String, + header: BasicHeader = BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json") + ): Transform { + val response = client().makeRequest("GET", "${IndexManagementPlugin.TRANSFORM_BASE_URI}/$transformId", null, header) + assertEquals("Unable to get transform $transformId", RestStatus.OK, response.restStatus()) + + val parser = createParser(XContentType.JSON.xContent(), response.entity.content) + ensureExpectedToken(Token.START_OBJECT, parser.nextToken(), parser) + + lateinit var id: String + var primaryTerm = SequenceNumbers.UNASSIGNED_PRIMARY_TERM + var seqNo = SequenceNumbers.UNASSIGNED_SEQ_NO + lateinit var transform: Transform + + while (parser.nextToken() != Token.END_OBJECT) { + parser.nextToken() + + when (parser.currentName()) { + _ID -> id = parser.text() + _SEQ_NO -> seqNo = parser.longValue() + _PRIMARY_TERM -> primaryTerm = parser.longValue() + Transform.TRANSFORM_TYPE -> transform = Transform.parse(parser, id, seqNo, primaryTerm) + } + } + return transform + } + + protected fun getTransformMetadata( + metadataId: String, + header: BasicHeader = BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json") + ): TransformMetadata { + val response = client().makeRequest("GET", "$INDEX_MANAGEMENT_INDEX/_doc/$metadataId", null, header) + assertEquals("Unable to get transform metadata $metadataId", RestStatus.OK, response.restStatus()) + + val parser = createParser(XContentType.JSON.xContent(), response.entity.content) + ensureExpectedToken(Token.START_OBJECT, parser.nextToken(), parser) + + lateinit var id: String + var primaryTerm = SequenceNumbers.UNASSIGNED_PRIMARY_TERM + var seqNo = SequenceNumbers.UNASSIGNED_SEQ_NO + lateinit var metadata: TransformMetadata + + while (parser.nextToken() != Token.END_OBJECT) { + parser.nextToken() + + when (parser.currentName()) { + _ID -> id = parser.text() + _SEQ_NO -> seqNo = parser.longValue() + _PRIMARY_TERM -> primaryTerm = parser.longValue() + TransformMetadata.TRANSFORM_METADATA_TYPE -> metadata = TransformMetadata.parse(parser, id, seqNo, primaryTerm) + } + } + + return metadata + } + protected fun deleteSnapshot(repository: String, snapshotName: String) { val response = client().makeRequest("DELETE", "_snapshot/$repository/$snapshotName") assertEquals("Unable to delete snapshot", RestStatus.OK, response.restStatus()) @@ -1058,4 +1119,13 @@ abstract class IndexStateManagementRestTestCase : IndexManagementRestTestCase() throw OpenSearchParseException("Failed to parse content to list", e) } } + + override fun xContentRegistry(): NamedXContentRegistry { + return NamedXContentRegistry( + listOf( + ClusterModule.getNamedXWriteables(), + SearchModule(Settings.EMPTY, emptyList()).namedXContents + ).flatten() + ) + } } diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/TestHelpers.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/TestHelpers.kt index 7247c9942..3fd18b511 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/TestHelpers.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/TestHelpers.kt @@ -40,6 +40,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.model.Transition import org.opensearch.indexmanagement.indexstatemanagement.model.coordinator.ClusterStateManagedIndexConfig import org.opensearch.indexmanagement.indexstatemanagement.model.coordinator.SweptManagedIndexConfig import org.opensearch.indexmanagement.common.model.notification.Channel +import org.opensearch.indexmanagement.indexstatemanagement.action.TransformAction import org.opensearch.indexmanagement.indexstatemanagement.model.destination.Chime import org.opensearch.indexmanagement.indexstatemanagement.model.destination.CustomWebhook import org.opensearch.indexmanagement.indexstatemanagement.model.destination.Destination @@ -49,6 +50,7 @@ import org.opensearch.indexmanagement.opensearchapi.string import org.opensearch.indexmanagement.rollup.randomISMRollup import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData +import org.opensearch.indexmanagement.transform.randomISMTransform import org.opensearch.jobscheduler.spi.schedule.CronSchedule import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule import org.opensearch.jobscheduler.spi.schedule.Schedule @@ -200,6 +202,10 @@ fun randomRollupActionConfig(): RollupAction { return RollupAction(ismRollup = randomISMRollup(), index = 0) } +fun randomTransformActionConfig(): TransformAction { + return TransformAction(ismTransform = randomISMTransform(), index = 0) +} + fun randomCloseActionConfig(): CloseAction { return CloseAction(index = 0) } diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt new file mode 100644 index 000000000..6288767a6 --- /dev/null +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt @@ -0,0 +1,265 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.indexstatemanagement.action + +import org.apache.hc.core5.http.ContentType +import org.apache.hc.core5.http.io.entity.StringEntity +import org.opensearch.cluster.metadata.DataStream +import org.opensearch.index.query.MatchAllQueryBuilder +import org.opensearch.indexmanagement.common.model.dimension.DateHistogram +import org.opensearch.indexmanagement.common.model.dimension.Terms +import org.opensearch.indexmanagement.indexstatemanagement.IndexStateManagementRestTestCase +import org.opensearch.indexmanagement.indexstatemanagement.model.ISMTemplate +import org.opensearch.indexmanagement.indexstatemanagement.model.Policy +import org.opensearch.indexmanagement.indexstatemanagement.model.State +import org.opensearch.indexmanagement.indexstatemanagement.randomErrorNotification +import org.opensearch.indexmanagement.indexstatemanagement.step.transform.AttemptCreateTransformJobStep +import org.opensearch.indexmanagement.indexstatemanagement.step.transform.WaitForTransformCompletionStep +import org.opensearch.indexmanagement.makeRequest +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionRetry +import org.opensearch.indexmanagement.transform.avgAggregation +import org.opensearch.indexmanagement.transform.maxAggregation +import org.opensearch.indexmanagement.transform.minAggregation +import org.opensearch.indexmanagement.transform.model.ISMTransform +import org.opensearch.indexmanagement.transform.model.TransformMetadata +import org.opensearch.indexmanagement.transform.sumAggregation +import org.opensearch.indexmanagement.transform.valueCountAggregation +import org.opensearch.indexmanagement.waitFor +import org.opensearch.search.aggregations.AggregatorFactories +import java.time.Instant +import java.time.temporal.ChronoUnit +import java.util.Locale + +class TransformActionIT : IndexStateManagementRestTestCase() { + + private val testPrefix = javaClass.simpleName.lowercase(Locale.ROOT) + + companion object { + const val SOURCE_INDEX_MAPPING = """ + "properties": { + "timestamp": { + "type": "date", + "format": "strict_date_optional_time||epoch_millis" + }, + "category": { + "type": "keyword" + }, + "value": { + "type": "long" + } + } + """ + } + + fun `test transform action`() { + val indexName = "${testPrefix}_index_basic" + val targetIndex = "${testPrefix}_target" + val policyId = "${testPrefix}_policy_basic" + + val ismTransform = prepareISMTransform(targetIndex) + val policy = preparePolicyContainingTransform(indexName, ismTransform, policyId) + createPolicy(policy, policyId) + createIndex(indexName, policyId, mapping = SOURCE_INDEX_MAPPING) + + assertIndexTransformSucceeded(indexName, policyId, ismTransform) + } + + fun `test data stream transform action`() { + val dataStreamName = "${testPrefix}_data_stream" + val targetIndex = "${testPrefix}_target_data_stream" + val policyId = "${testPrefix}_policy_data_stream" + + val ismTransform = prepareISMTransform(targetIndex) + val policy = preparePolicyContainingTransform(dataStreamName, ismTransform, policyId) + createPolicy(policy, policyId) + createDataStream(dataStreamName) + + // assert transform works on backing indices of a data stream + val indexName = DataStream.getDefaultBackingIndexName(dataStreamName, 1L) + assertIndexTransformSucceeded(indexName, policyId, ismTransform) + } + + fun `test transform action failure due to wrong source field`() { + val indexName = "${testPrefix}_index_failure" + val targetIndex = "${testPrefix}_target_failure" + val policyId = "${testPrefix}_policy_failure" + + val ismTransform = ISMTransform( + description = "test transform", + targetIndex = targetIndex, + pageSize = 100, + dataSelectionQuery = MatchAllQueryBuilder(), + groups = listOf( + DateHistogram(sourceField = "timestamp", fixedInterval = "1d"), + Terms(sourceField = "wrong_field", targetField = "wrong_field") + ), + aggregations = AggregatorFactories.builder() + .addAggregator(sumAggregation()) + .addAggregator(maxAggregation()) + .addAggregator(minAggregation()) + .addAggregator(avgAggregation()) + .addAggregator(valueCountAggregation()) + ) + val policy = preparePolicyContainingTransform(indexName, ismTransform, policyId) + createPolicy(policy, policyId) + createIndex(indexName, policyId, mapping = SOURCE_INDEX_MAPPING) + + assertIndexTransformFailedInAttemptCreateTransformStep(indexName, policyId, ismTransform) + } + + fun `test transform action failed step got retried`() { + val indexName = "${testPrefix}_index_retry" + val targetIndex = "${testPrefix}_target_retry" + val policyId = "${testPrefix}_policy_retry" + + val ismTransform = ISMTransform( + description = "test transform", + targetIndex = targetIndex, + pageSize = 100, + dataSelectionQuery = MatchAllQueryBuilder(), + groups = listOf( + DateHistogram(sourceField = "timestamp", fixedInterval = "1d"), + Terms(sourceField = "wrong_field", targetField = "wrong_field") + ), + aggregations = AggregatorFactories.builder() + .addAggregator(sumAggregation()) + .addAggregator(maxAggregation()) + .addAggregator(minAggregation()) + .addAggregator(avgAggregation()) + .addAggregator(valueCountAggregation()) + ) + val policy = preparePolicyContainingTransform(indexName, ismTransform, policyId, retry = 1) + createPolicy(policy, policyId) + createIndex(indexName, policyId, mapping = SOURCE_INDEX_MAPPING) + + assertIndexTransformFailedInAttemptCreateTransformStep(indexName, policyId, ismTransform) + + // verify the wait for transform completion step will be retried and failed again. + Thread.sleep(60000) + updateManagedIndexConfigStartTime(getExistingManagedIndexConfig(indexName)) + waitFor { + assertEquals( + AttemptCreateTransformJobStep.getFailedMessage(ismTransform.toTransform(indexName).id, indexName), + getExplainManagedIndexMetaData(indexName).info?.get("message") + ) + } + } + + // create an ISMTransform that matches SOURCE_INDEX_MAPPING + private fun prepareISMTransform(targetIndex: String): ISMTransform { + return ISMTransform( + description = "test transform", + targetIndex = targetIndex, + pageSize = 100, + dataSelectionQuery = MatchAllQueryBuilder(), + groups = listOf( + DateHistogram(sourceField = "timestamp", fixedInterval = "1d"), + Terms(sourceField = "category", targetField = "category") + ), + aggregations = AggregatorFactories.builder() + .addAggregator(sumAggregation()) + .addAggregator(maxAggregation()) + .addAggregator(minAggregation()) + .addAggregator(avgAggregation()) + .addAggregator(valueCountAggregation()) + ) + } + + private fun preparePolicyContainingTransform(indexName: String, ismTransform: ISMTransform, policyId: String, retry: Long = 0): Policy { + val actionConfig = TransformAction(ismTransform, 0) + actionConfig.configRetry = ActionRetry(retry) + val states = listOf( + State("transform", listOf(actionConfig), listOf()) + ) + return Policy( + id = policyId, + description = "test description", + schemaVersion = 1L, + lastUpdatedTime = Instant.now().truncatedTo(ChronoUnit.MILLIS), + errorNotification = randomErrorNotification(), + defaultState = states[0].name, + states = states, + ismTemplate = listOf( + ISMTemplate( + indexPatterns = listOf(indexName), + priority = 100, + lastUpdatedTime = Instant.now().truncatedTo(ChronoUnit.MILLIS) + ) + ) + ) + } + + private fun createDataStream(dataStreamName: String) { + // create an index template for data stream + client().makeRequest( + "PUT", + "/_index_template/${dataStreamName}_template", + StringEntity( + "{ " + + "\"index_patterns\": [ \"$dataStreamName\" ], " + + "\"data_stream\": { \"timestamp_field\": { \"name\": \"timestamp\" } }, " + + "\"template\": { \"mappings\": { $SOURCE_INDEX_MAPPING } } }", + ContentType.APPLICATION_JSON + ) + ) + // create data stream + client().makeRequest("PUT", "/_data_stream/$dataStreamName") + } + + private fun assertIndexTransformSucceeded(indexName: String, policyId: String, ismTransform: ISMTransform) { + val transformId = ismTransform.toTransform(indexName).id + val managedIndexConfig = getExistingManagedIndexConfig(indexName) + + // Change the start time so that the policy will be initialized. + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { assertEquals(policyId, getExplainManagedIndexMetaData(indexName).policyID) } + + // Change the start time so that the transform action will be attempted. + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { + assertEquals( + AttemptCreateTransformJobStep.getSuccessMessage(transformId, indexName), + getExplainManagedIndexMetaData(indexName).info?.get("message") + ) + } + + Thread.sleep(60000) + + // Change the start time so that the transform action will be attempted. + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { + assertEquals( + WaitForTransformCompletionStep.getJobCompletionMessage(transformId, indexName), + getExplainManagedIndexMetaData(indexName).info?.get("message") + ) + } + + val transformJob = getTransform(transformId = transformId) + waitFor { + assertNotNull("Transform job doesn't have metadata set", transformJob.metadataId) + val transformMetadata = getTransformMetadata(transformJob.metadataId!!) + assertEquals("Transform is not finished", TransformMetadata.Status.FINISHED, transformMetadata.status) + } + } + + private fun assertIndexTransformFailedInAttemptCreateTransformStep(indexName: String, policyId: String, ismTransform: ISMTransform) { + val transformId = ismTransform.toTransform(indexName).id + val managedIndexConfig = getExistingManagedIndexConfig(indexName) + + // Change the start time so that the policy will be initialized. + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { assertEquals(policyId, getExplainManagedIndexMetaData(indexName).policyID) } + + // Change the start time so that the transform action will be attempted. + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { + assertEquals( + AttemptCreateTransformJobStep.getFailedMessage(transformId, indexName), + getExplainManagedIndexMetaData(indexName).info?.get("message") + ) + } + } +} diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCreateTransformJobStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCreateTransformJobStepTests.kt new file mode 100644 index 000000000..2e06ee740 --- /dev/null +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCreateTransformJobStepTests.kt @@ -0,0 +1,62 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.indexstatemanagement.step + +import org.opensearch.indexmanagement.indexstatemanagement.randomTransformActionConfig +import org.opensearch.indexmanagement.indexstatemanagement.step.rollup.AttemptCreateRollupJobStep +import org.opensearch.indexmanagement.indexstatemanagement.step.transform.AttemptCreateTransformJobStep +import org.opensearch.indexmanagement.spi.indexstatemanagement.Step +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionMetaData +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionProperties +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.TransformActionProperties +import org.opensearch.test.OpenSearchTestCase + +class AttemptCreateTransformJobStepTests : OpenSearchTestCase() { + + private val transformAction = randomTransformActionConfig() + private val indexName = "test" + private val transformId: String = transformAction.ismTransform.toTransform(indexName).id + private val metadata = ManagedIndexMetaData( + indexName, + "indexUuid", + "policy_id", + null, + null, + null, + null, + null, + null, + null, + ActionMetaData( + AttemptCreateRollupJobStep.name, 1, 0, false, 0, null, + ActionProperties(transformActionProperties = TransformActionProperties(transformId, false)) + ), + null, + null, + null + ) + private val step = AttemptCreateTransformJobStep(transformAction) + + fun `test process failure`() { + step.processFailure(transformId, indexName, Exception("dummy-error")) + val updatedManagedIndexMedaData = step.getUpdatedManagedIndexMetadata(metadata) + assertEquals( + "Step status is not FAILED", + Step.StepStatus.FAILED, + updatedManagedIndexMedaData.stepMetaData?.stepStatus + ) + assertEquals( + "Error message is not expected", + AttemptCreateTransformJobStep.getFailedMessage(transformId, indexName), + updatedManagedIndexMedaData.info?.get("message") + ) + } + + fun `test isIdempotent`() { + assertTrue(step.isIdempotent()) + } +} diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForTransformCompletionStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForTransformCompletionStepTests.kt new file mode 100644 index 000000000..a78fa387a --- /dev/null +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForTransformCompletionStepTests.kt @@ -0,0 +1,193 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.indexstatemanagement.step + +import com.nhaarman.mockitokotlin2.mock +import kotlinx.coroutines.runBlocking +import org.opensearch.client.Client +import org.opensearch.cluster.service.ClusterService +import org.opensearch.common.settings.Settings +import org.opensearch.indexmanagement.indexstatemanagement.step.transform.AttemptCreateTransformJobStep +import org.opensearch.indexmanagement.indexstatemanagement.step.transform.WaitForTransformCompletionStep +import org.opensearch.indexmanagement.transform.model.TransformMetadata +import org.opensearch.indexmanagement.transform.model.TransformStats +import org.opensearch.indexmanagement.spi.indexstatemanagement.Step +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionMetaData +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionProperties +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepContext +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.TransformActionProperties +import org.opensearch.indexmanagement.util.NO_ID +import org.opensearch.jobscheduler.spi.utils.LockService +import org.opensearch.script.ScriptService +import org.opensearch.test.OpenSearchTestCase +import java.time.Instant + +class WaitForTransformCompletionStepTests : OpenSearchTestCase() { + + private val clusterService: ClusterService = mock() + private val scriptService: ScriptService = mock() + private val settings: Settings = Settings.EMPTY + private val transformId: String = "dummy-id" + private val indexName: String = "test" + private val metadata = ManagedIndexMetaData( + indexName, + "indexUuid", + "policy_id", + null, + null, + null, + null, + null, + null, + null, + ActionMetaData( + AttemptCreateTransformJobStep.name, 1, 0, false, 0, null, + ActionProperties(transformActionProperties = TransformActionProperties(transformId, false)) + ), + null, + null, + null + ) + private val transformMetadata = TransformMetadata( + id = NO_ID, + transformId = transformId, + lastUpdatedAt = Instant.now(), + status = TransformMetadata.Status.FINISHED, + stats = TransformStats(1, 1, 1, 1, 1) + ) + private val client: Client = mock() + private val step = WaitForTransformCompletionStep() + private val lockService: LockService = LockService(mock(), clusterService) + + fun `test wait for transform when missing transform id`() { + val actionMetadata = metadata.actionMetaData!!.copy(actionProperties = ActionProperties()) + val metadata = metadata.copy(actionMetaData = actionMetadata) + val context = StepContext(metadata, clusterService, client, null, null, scriptService, settings, lockService) + val step = WaitForTransformCompletionStep() + + runBlocking { + step.preExecute(logger, context).execute() + } + + val updatedManagedIndexMetaData = step.getUpdatedManagedIndexMetadata(metadata) + assertEquals("Step status is not FAILED", Step.StepStatus.FAILED, updatedManagedIndexMetaData.stepMetaData?.stepStatus) + assertEquals( + "Missing failure message", + WaitForTransformCompletionStep.getMissingTransformJobMessage(indexName), + updatedManagedIndexMetaData.info?.get("message") + ) + } + + fun `test process transform metadata FAILED status`() { + val transformMetadata = transformMetadata.copy(status = TransformMetadata.Status.FAILED) + step.processTransformMetadataStatus(transformId, indexName, transformMetadata) + + val updateManagedIndexMetaData = step.getUpdatedManagedIndexMetadata(metadata) + assertEquals("Step status is not FAILED", Step.StepStatus.FAILED, updateManagedIndexMetaData.stepMetaData?.stepStatus) + assertEquals( + "Missing failure message", + WaitForTransformCompletionStep.getJobFailedMessage(transformId, indexName), + updateManagedIndexMetaData.info?.get("message") + ) + assertEquals( + "Missing transform failed action property", + true, + updateManagedIndexMetaData.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed + ) + } + + fun `test process transform metadata STOPPED status`() { + val transformMetadata = transformMetadata.copy(status = TransformMetadata.Status.STOPPED) + step.processTransformMetadataStatus(transformId, indexName, transformMetadata) + + val updateManagedIndexMetaData = step.getUpdatedManagedIndexMetadata(metadata) + assertEquals("Step status is not FAILED", Step.StepStatus.FAILED, updateManagedIndexMetaData.stepMetaData?.stepStatus) + assertEquals( + "Missing failure message", + WaitForTransformCompletionStep.getJobFailedMessage(transformId, indexName), + updateManagedIndexMetaData.info?.get("message") + ) + assertEquals( + "Missing transform failed action property", + true, + updateManagedIndexMetaData.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed + ) + assertEquals("Mismatch in cause", WaitForTransformCompletionStep.JOB_STOPPED_MESSAGE, updateManagedIndexMetaData.info?.get("cause")) + } + + fun `test process transform metadata INIT status`() { + val transformMetadata = transformMetadata.copy(status = TransformMetadata.Status.INIT) + step.processTransformMetadataStatus(transformId, indexName, transformMetadata) + + val updateManagedIndexMetaData = step.getUpdatedManagedIndexMetadata(metadata) + assertEquals( + "Step status is not CONDITION_NOT_MET", + Step.StepStatus.CONDITION_NOT_MET, + updateManagedIndexMetaData.stepMetaData?.stepStatus + ) + assertEquals( + "Missing processing message", + WaitForTransformCompletionStep.getJobProcessingMessage(transformId, indexName), + updateManagedIndexMetaData.info?.get("message") + ) + assertNull( + "transform failed property is not null", + updateManagedIndexMetaData.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed + ) + } + + fun `test process transform metadata STARTED status`() { + val transformMetadata = transformMetadata.copy(status = TransformMetadata.Status.STARTED) + step.processTransformMetadataStatus(transformId, indexName, transformMetadata) + + val updateManagedIndexMetaData = step.getUpdatedManagedIndexMetadata(metadata) + assertEquals("Step status is not CONDITION_NOT_MET", Step.StepStatus.CONDITION_NOT_MET, updateManagedIndexMetaData.stepMetaData?.stepStatus) + assertEquals( + "Missing processing message", + WaitForTransformCompletionStep.getJobProcessingMessage(transformId, indexName), + updateManagedIndexMetaData.info?.get("message") + ) + assertNull( + "transform failed property is not null", + updateManagedIndexMetaData.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed + ) + } + + fun `test process transform metadata FINISHED status`() { + val transformMetadata = transformMetadata.copy(status = TransformMetadata.Status.FINISHED) + step.processTransformMetadataStatus(transformId, indexName, transformMetadata) + + val updateManagedIndexMetaData = step.getUpdatedManagedIndexMetadata(metadata) + assertEquals("Step status is not COMPLETED", Step.StepStatus.COMPLETED, updateManagedIndexMetaData.stepMetaData?.stepStatus) + assertEquals( + "Missing processing message", + WaitForTransformCompletionStep.getJobCompletionMessage(transformId, indexName), + updateManagedIndexMetaData.info?.get("message") + ) + assertNull( + "transform failed property is not null", + updateManagedIndexMetaData.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed + ) + } + + fun `test process failure`() { + step.processFailure(transformId, indexName, Exception("dummy-exception")) + + val updateManagedIndexMetaData = step.getUpdatedManagedIndexMetadata(metadata) + assertEquals("Mismatch in cause", "dummy-exception", updateManagedIndexMetaData.info?.get("cause")) + assertEquals( + "Mismatch in message", + WaitForTransformCompletionStep.getFailedMessage(transformId, indexName), + updateManagedIndexMetaData.info?.get("message") + ) + assertEquals("Step status is not FAILED", Step.StepStatus.FAILED, updateManagedIndexMetaData.stepMetaData?.stepStatus) + } + + fun `test isIdempotent`() { + assertTrue(step.isIdempotent()) + } +} diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/TestHelpers.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/TestHelpers.kt index 367841ba6..c2658b5c5 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/TestHelpers.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/TestHelpers.kt @@ -21,8 +21,10 @@ import org.opensearch.indexmanagement.randomSchedule import org.opensearch.indexmanagement.randomUser import org.opensearch.indexmanagement.rollup.randomAfterKey import org.opensearch.indexmanagement.rollup.randomDimension +import org.opensearch.indexmanagement.rollup.randomTermQuery import org.opensearch.indexmanagement.transform.model.ContinuousTransformStats import org.opensearch.indexmanagement.transform.model.ExplainTransform +import org.opensearch.indexmanagement.transform.model.ISMTransform import org.opensearch.indexmanagement.transform.model.Transform import org.opensearch.indexmanagement.transform.model.TransformMetadata import org.opensearch.indexmanagement.transform.model.TransformStats @@ -159,6 +161,17 @@ fun randomExplainTransform(): ExplainTransform { return ExplainTransform(metadataID = metadata.id, metadata = metadata) } +fun randomISMTransform(): ISMTransform { + return ISMTransform( + description = OpenSearchRestTestCase.randomAlphaOfLength(10), + targetIndex = OpenSearchRestTestCase.randomAlphaOfLength(10).lowercase(Locale.ROOT), + pageSize = OpenSearchRestTestCase.randomIntBetween(1, 10000), + groups = randomGroups(), + dataSelectionQuery = randomTermQuery(), + aggregations = randomAggregationFactories() + ) +} + fun Transform.toJsonString(params: ToXContent.Params = ToXContent.EMPTY_PARAMS): String = this.toXContent(XContentFactory.jsonBuilder(), params).string() fun TransformMetadata.toJsonString(params: ToXContent.Params = ToXContent.EMPTY_PARAMS): String = this.toXContent(XContentFactory.jsonBuilder(), params) diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransformTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransformTests.kt new file mode 100644 index 000000000..6129f453f --- /dev/null +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransformTests.kt @@ -0,0 +1,49 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.transform.model + +import org.opensearch.indexmanagement.transform.randomISMTransform +import org.opensearch.test.OpenSearchTestCase +import kotlin.test.assertFailsWith + +class ISMTransformTests : OpenSearchTestCase() { + + fun `test ism transform requires non empty description`() { + assertFailsWith(IllegalArgumentException::class, "Requires non empty description") { + randomISMTransform().copy(description = "") + } + } + + fun `test ism transform requires non empty target index`() { + assertFailsWith(IllegalArgumentException::class, "Requires non empty targetIndex") { + randomISMTransform().copy(targetIndex = "") + } + } + + fun `test ism transform requires non empty groups`() { + assertFailsWith(IllegalArgumentException::class, "Requires non empty groups") { + randomISMTransform().copy(groups = listOf()) + } + } + + fun `test ism transform requires page size between 1 and 10K`() { + assertFailsWith(IllegalArgumentException:: class, "Page size cannot be less than 1") { + randomISMTransform().copy(pageSize = -1) + } + + assertFailsWith(IllegalArgumentException:: class, "Page size cannot be less than 1") { + randomISMTransform().copy(pageSize = 0) + } + + assertFailsWith(IllegalArgumentException:: class, "Page size cannot be greater than 10000") { + randomISMTransform().copy(pageSize = 10001) + } + + randomISMTransform().copy(pageSize = 1) + randomISMTransform().copy(pageSize = 500) + randomISMTransform().copy(pageSize = 10000) + } +} diff --git a/src/test/resources/mappings/cached-opendistro-ism-config.json b/src/test/resources/mappings/cached-opendistro-ism-config.json index 92084c3ad..bb66d7230 100644 --- a/src/test/resources/mappings/cached-opendistro-ism-config.json +++ b/src/test/resources/mappings/cached-opendistro-ism-config.json @@ -1,6 +1,6 @@ { "_meta" : { - "schema_version": 17 + "schema_version": 18 }, "dynamic": "strict", "properties": { @@ -452,6 +452,83 @@ } } }, + "transform": { + "properties": { + "ism_transform": { + "properties": { + "description": { + "type": "text" + }, + "target_index": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "page_size": { + "type": "long" + }, + "data_selection_query": { + "type": "object", + "enabled": false + }, + "groups": { + "properties": { + "date_histogram": { + "properties": { + "source_field": { + "type": "keyword" + }, + "target_field": { + "type": "keyword" + }, + "fixed_interval": { + "type": "keyword" + }, + "calendar_interval": { + "type": "keyword" + }, + "timezone": { + "type": "keyword" + } + } + }, + "terms": { + "properties": { + "source_field": { + "type": "keyword" + }, + "target_field": { + "type": "keyword" + } + } + }, + "histogram": { + "properties": { + "source_field": { + "type": "keyword" + }, + "target_field": { + "type": "keyword" + }, + "interval": { + "type": "double" + } + } + } + } + }, + "aggregations": { + "type": "object", + "enabled": false + } + } + } + } + }, "shrink": { "properties": { "num_new_shards": { @@ -783,6 +860,10 @@ "shrink_action_properties": { "type": "object", "enabled": false + }, + "transform_action_properties": { + "type": "object", + "enabled": false } } } diff --git a/src/test/resources/mappings/cached-opendistro-ism-history.json b/src/test/resources/mappings/cached-opendistro-ism-history.json index ca5a8d8de..1065b1ae3 100644 --- a/src/test/resources/mappings/cached-opendistro-ism-history.json +++ b/src/test/resources/mappings/cached-opendistro-ism-history.json @@ -1,6 +1,6 @@ { "_meta" : { - "schema_version": 5 + "schema_version": 6 }, "dynamic": "strict", "properties": { @@ -112,6 +112,10 @@ "shrink_action_properties": { "type": "object", "enabled": false + }, + "transform_action_properties": { + "type": "object", + "enabled": false } } } From e972c12f7b20a2f4068cb09969e761ea9ecdb4e3 Mon Sep 17 00:00:00 2001 From: bowenlan-amzn Date: Wed, 19 Jul 2023 15:57:04 +0800 Subject: [PATCH 05/29] Fix after core #8157 (#857) Signed-off-by: bowenlan-amzn --- .../indexstatemanagement/Action.kt | 4 ++-- .../indexstatemanagement/ActionParser.kt | 2 +- .../indexstatemanagement/Step.kt | 6 +++--- .../indexstatemanagement/Validate.kt | 6 +++--- .../indexstatemanagement/model/ActionMetaData.kt | 8 ++++---- .../model/ActionProperties.kt | 8 ++++---- .../indexstatemanagement/model/ActionRetry.kt | 8 ++++---- .../indexstatemanagement/model/ActionTimeout.kt | 6 +++--- .../model/ManagedIndexMetaData.kt | 8 ++++---- .../model/PolicyRetryInfoMetaData.kt | 8 ++++---- .../model/ShrinkActionProperties.kt | 8 ++++---- .../indexstatemanagement/model/StateMetaData.kt | 8 ++++---- .../indexstatemanagement/model/StepMetaData.kt | 8 ++++---- .../model/ValidationResult.kt | 8 ++++---- .../indexmanagement/IndexManagementIndices.kt | 2 +- .../indexmanagement/IndexManagementPlugin.kt | 4 ++-- .../common/model/dimension/DateHistogram.kt | 6 +++--- .../common/model/dimension/Dimension.kt | 4 ++-- .../common/model/dimension/Histogram.kt | 6 +++--- .../common/model/dimension/Terms.kt | 6 +++--- .../common/model/notification/Channel.kt | 8 ++++---- .../model/notification/NotificationUtils.kt | 2 +- .../common/model/rest/SearchParams.kt | 6 +++--- .../notification/LRONConfigResponse.kt | 4 ++-- .../action/delete/DeleteLRONConfigRequest.kt | 4 ++-- .../action/get/GetLRONConfigRequest.kt | 4 ++-- .../action/get/GetLRONConfigResponse.kt | 4 ++-- .../action/index/IndexLRONConfigRequest.kt | 4 ++-- .../index/TransportIndexLRONConfigAction.kt | 2 +- .../notification/model/LRONCondition.kt | 8 ++++---- .../notification/model/LRONConfig.kt | 8 ++++---- .../controlcenter/notification/util/LRONUtils.kt | 2 +- .../indexstatemanagement/ISMActionsParser.kt | 4 ++-- .../ManagedIndexCoordinator.kt | 8 ++++---- .../indexstatemanagement/ManagedIndexRunner.kt | 4 ++-- .../indexstatemanagement/action/AliasAction.kt | 2 +- .../action/AliasActionParser.kt | 4 ++-- .../action/AllocationAction.kt | 2 +- .../action/AllocationActionParser.kt | 4 ++-- .../action/CloseActionParser.kt | 4 ++-- .../action/DeleteActionParser.kt | 4 ++-- .../action/ForceMergeAction.kt | 2 +- .../action/ForceMergeActionParser.kt | 4 ++-- .../action/IndexPriorityAction.kt | 2 +- .../action/IndexPriorityActionParser.kt | 4 ++-- .../action/NotificationAction.kt | 2 +- .../action/NotificationActionParser.kt | 4 ++-- .../action/OpenActionParser.kt | 4 ++-- .../action/ReadOnlyActionParser.kt | 4 ++-- .../action/ReadWriteActionParser.kt | 4 ++-- .../action/ReplicaCountAction.kt | 2 +- .../action/ReplicaCountActionParser.kt | 4 ++-- .../action/RolloverAction.kt | 2 +- .../action/RolloverActionParser.kt | 4 ++-- .../indexstatemanagement/action/RollupAction.kt | 2 +- .../action/RollupActionParser.kt | 4 ++-- .../indexstatemanagement/action/ShrinkAction.kt | 2 +- .../action/ShrinkActionParser.kt | 4 ++-- .../action/SnapshotAction.kt | 2 +- .../action/SnapshotActionParser.kt | 4 ++-- .../indexstatemanagement/model/ChangePolicy.kt | 8 ++++---- .../model/ErrorNotification.kt | 8 ++++---- .../indexstatemanagement/model/ISMTemplate.kt | 8 ++++---- .../model/ManagedIndexConfig.kt | 2 +- .../indexstatemanagement/model/Policy.kt | 8 ++++---- .../indexstatemanagement/model/State.kt | 8 ++++---- .../indexstatemanagement/model/StateFilter.kt | 8 ++++---- .../indexstatemanagement/model/Transition.kt | 8 ++++---- .../model/coordinator/SweptManagedIndexConfig.kt | 2 +- .../model/destination/Chime.kt | 8 ++++---- .../model/destination/CustomWebhook.kt | 8 ++++---- .../model/destination/Destination.kt | 8 ++++---- .../model/destination/Slack.kt | 8 ++++---- .../resthandler/RestChangePolicyAction.kt | 2 +- .../resthandler/RestIndexPolicyAction.kt | 2 +- .../step/forcemerge/AttemptCallForceMergeStep.kt | 2 +- .../step/forcemerge/WaitForForceMergeStep.kt | 2 +- .../step/rollover/AttemptRolloverStep.kt | 2 +- .../step/snapshot/AttemptSnapshotStep.kt | 2 +- .../step/transition/AttemptTransitionStep.kt | 2 +- .../transport/action/ISMStatusResponse.kt | 4 ++-- .../action/addpolicy/AddPolicyRequest.kt | 4 ++-- .../action/addpolicy/TransportAddPolicyAction.kt | 4 ++-- .../action/changepolicy/ChangePolicyRequest.kt | 4 ++-- .../changepolicy/TransportChangePolicyAction.kt | 4 ++-- .../action/deletepolicy/DeletePolicyRequest.kt | 4 ++-- .../deletepolicy/TransportDeletePolicyAction.kt | 2 +- .../transport/action/explain/ExplainRequest.kt | 4 ++-- .../transport/action/explain/ExplainResponse.kt | 4 ++-- .../action/getpolicy/GetPoliciesRequest.kt | 4 ++-- .../action/getpolicy/GetPoliciesResponse.kt | 4 ++-- .../action/getpolicy/GetPolicyRequest.kt | 4 ++-- .../action/getpolicy/GetPolicyResponse.kt | 4 ++-- .../action/getpolicy/TransportGetPolicyAction.kt | 2 +- .../action/indexpolicy/IndexPolicyRequest.kt | 4 ++-- .../action/indexpolicy/IndexPolicyResponse.kt | 6 +++--- .../indexpolicy/TransportIndexPolicyAction.kt | 2 +- .../action/managedIndex/ManagedIndexRequest.kt | 2 +- .../action/removepolicy/RemovePolicyRequest.kt | 4 ++-- .../removepolicy/TransportRemovePolicyAction.kt | 4 ++-- .../RetryFailedManagedIndexRequest.kt | 4 ++-- .../TransportRetryFailedManagedIndexAction.kt | 4 ++-- .../TransportUpdateManagedIndexMetaDataAction.kt | 6 +++--- .../UpdateManagedIndexMetaDataAction.kt | 2 +- .../UpdateManagedIndexMetaDataRequest.kt | 6 +++--- .../util/NotificationUtils.kt | 2 +- .../util/RestHandlerUtils.kt | 8 ++++---- .../opensearchapi/OpenSearchExtensions.kt | 16 ++++++++-------- .../RefreshSearchAnalyzerAction.kt | 2 +- .../RefreshSearchAnalyzerRequest.kt | 2 +- .../RefreshSearchAnalyzerResponse.kt | 6 +++--- .../RefreshSearchAnalyzerShardResponse.kt | 6 +++--- .../TransportRefreshSearchAnalyzerAction.kt | 6 +++--- .../indexmanagement/rollup/RollupIndexer.kt | 2 +- .../rollup/action/delete/DeleteRollupRequest.kt | 4 ++-- .../action/delete/TransportDeleteRollupAction.kt | 2 +- .../action/explain/ExplainRollupRequest.kt | 4 ++-- .../action/explain/ExplainRollupResponse.kt | 4 ++-- .../rollup/action/get/GetRollupRequest.kt | 4 ++-- .../rollup/action/get/GetRollupResponse.kt | 6 +++--- .../rollup/action/get/GetRollupsRequest.kt | 4 ++-- .../rollup/action/get/GetRollupsResponse.kt | 6 +++--- .../action/get/TransportGetRollupAction.kt | 2 +- .../action/get/TransportGetRollupsAction.kt | 2 +- .../rollup/action/index/IndexRollupRequest.kt | 4 ++-- .../rollup/action/index/IndexRollupResponse.kt | 6 +++--- .../action/index/TransportIndexRollupAction.kt | 2 +- .../TransportUpdateRollupMappingAction.kt | 6 +++--- .../action/mapping/UpdateRollupMappingAction.kt | 2 +- .../action/mapping/UpdateRollupMappingRequest.kt | 4 ++-- .../rollup/action/start/StartRollupRequest.kt | 4 ++-- .../action/start/TransportStartRollupAction.kt | 2 +- .../rollup/action/stop/StopRollupRequest.kt | 4 ++-- .../action/stop/TransportStopRollupAction.kt | 2 +- .../rollup/actionfilter/SerDeHelper.kt | 6 +++--- .../rollup/model/ExplainRollup.kt | 6 +++--- .../indexmanagement/rollup/model/ISMRollup.kt | 8 ++++---- .../indexmanagement/rollup/model/Rollup.kt | 8 ++++---- .../rollup/model/RollupMetadata.kt | 8 ++++---- .../rollup/model/RollupMetrics.kt | 8 ++++---- .../rollup/model/metric/Average.kt | 6 +++--- .../indexmanagement/rollup/model/metric/Max.kt | 6 +++--- .../rollup/model/metric/Metric.kt | 4 ++-- .../indexmanagement/rollup/model/metric/Min.kt | 6 +++--- .../indexmanagement/rollup/model/metric/Sum.kt | 6 +++--- .../rollup/model/metric/ValueCount.kt | 6 +++--- .../rollup/resthandler/RestIndexRollupAction.kt | 2 +- .../rollup/util/QueryShardContextFactory.kt | 4 ++-- .../indexmanagement/rollup/util/RollupUtils.kt | 2 +- .../snapshotmanagement/SMRunner.kt | 2 +- .../snapshotmanagement/SMUtils.kt | 2 +- .../resthandler/RestBaseIndexSMPolicyHandler.kt | 2 +- .../api/transport/BaseTransportAction.kt | 4 ++-- .../transport/delete/DeleteSMPolicyRequest.kt | 4 ++-- .../delete/TransportDeleteSMPolicyAction.kt | 2 +- .../transport/explain/ExplainSMPolicyRequest.kt | 4 ++-- .../transport/explain/ExplainSMPolicyResponse.kt | 4 ++-- .../explain/TransportExplainSMAction.kt | 4 ++-- .../api/transport/get/GetSMPoliciesRequest.kt | 4 ++-- .../api/transport/get/GetSMPoliciesResponse.kt | 4 ++-- .../api/transport/get/GetSMPolicyRequest.kt | 4 ++-- .../api/transport/get/GetSMPolicyResponse.kt | 4 ++-- .../get/TransportGetSMPoliciesAction.kt | 2 +- .../transport/get/TransportGetSMPolicyAction.kt | 2 +- .../api/transport/index/IndexSMPolicyRequest.kt | 4 ++-- .../api/transport/index/IndexSMPolicyResponse.kt | 6 +++--- .../api/transport/start/StartSMRequest.kt | 4 ++-- .../transport/start/TransportStartSMAction.kt | 2 +- .../api/transport/stop/StopSMRequest.kt | 4 ++-- .../api/transport/stop/TransportStopSMAction.kt | 2 +- .../snapshotmanagement/model/ExplainSMPolicy.kt | 6 +++--- .../model/NotificationConfig.kt | 8 ++++---- .../snapshotmanagement/model/SMMetadata.kt | 8 ++++---- .../snapshotmanagement/model/SMPolicy.kt | 8 ++++---- .../transform/TargetIndexMappingService.kt | 2 +- .../transform/TransformIndexer.kt | 2 +- .../indexmanagement/transform/TransformRunner.kt | 2 +- .../transform/TransformSearchService.kt | 6 +++--- .../action/delete/DeleteTransformsRequest.kt | 4 ++-- .../delete/TransportDeleteTransformsAction.kt | 2 +- .../action/explain/ExplainTransformRequest.kt | 4 ++-- .../action/explain/ExplainTransformResponse.kt | 4 ++-- .../explain/TransportExplainTransformAction.kt | 2 +- .../transform/action/get/GetTransformRequest.kt | 4 ++-- .../transform/action/get/GetTransformResponse.kt | 6 +++--- .../transform/action/get/GetTransformsRequest.kt | 4 ++-- .../action/get/GetTransformsResponse.kt | 6 +++--- .../action/get/TransportGetTransformAction.kt | 2 +- .../action/get/TransportGetTransformsAction.kt | 2 +- .../action/index/IndexTransformRequest.kt | 4 ++-- .../action/index/IndexTransformResponse.kt | 6 +++--- .../index/TransportIndexTransformAction.kt | 2 +- .../action/preview/PreviewTransformRequest.kt | 4 ++-- .../action/preview/PreviewTransformResponse.kt | 6 +++--- .../preview/TransportPreviewTransformAction.kt | 2 +- .../action/start/StartTransformRequest.kt | 4 ++-- .../start/TransportStartTransformAction.kt | 2 +- .../action/stop/StopTransformRequest.kt | 4 ++-- .../action/stop/TransportStopTransformAction.kt | 2 +- .../transform/model/ContinuousTransformStats.kt | 8 ++++---- .../transform/model/ExplainTransform.kt | 6 +++--- .../indexmanagement/transform/model/Transform.kt | 14 +++++++------- .../transform/model/TransformMetadata.kt | 10 +++++----- .../transform/model/TransformSearchResult.kt | 2 +- .../transform/model/TransformStats.kt | 8 ++++---- .../opensearchapi/OpenSearchExtensions.kt | 2 +- .../resthandler/RestIndexTransformAction.kt | 2 +- .../util/IndexManagementException.kt | 2 +- .../indexmanagement/util/ScheduledJobUtils.kt | 4 ++-- .../indexmanagement/util/SecurityUtils.kt | 2 +- .../indexmanagement/IndexManagementIndicesIT.kt | 2 +- .../IndexManagementRestTestCase.kt | 2 +- .../IndexStateManagementSecurityBehaviorIT.kt | 2 +- .../indexmanagement/PolicySecurityBehaviorIT.kt | 2 +- .../indexmanagement/RollupSecurityBehaviorIT.kt | 2 +- .../indexmanagement/SecurityBehaviorIT.kt | 2 +- .../indexmanagement/SecurityRestTestCase.kt | 2 +- .../TransformSecurityBehaviorIT.kt | 2 +- .../IndexManagementBackwardsCompatibilityIT.kt | 2 +- .../notification/LRONConfigSecurityBehaviorIT.kt | 2 +- .../filter/NotificationActionListenerIT.kt | 2 +- .../parser/ForceMergeIndexRespParserTests.kt | 4 ++-- .../filter/parser/OpenRespParserTests.kt | 2 +- .../filter/parser/ReindexRespParserTests.kt | 2 +- .../filter/parser/ResizeIndexRespParserTests.kt | 2 +- .../resthandler/LRONConfigRestTestCase.kt | 2 +- .../resthandler/RestDeleteLRONConfigActionIT.kt | 2 +- .../resthandler/RestGetLRONConfigActionIT.kt | 2 +- .../resthandler/RestIndexLRONConfigActionIT.kt | 2 +- .../IndexStateManagementRestTestCase.kt | 4 ++-- .../action/RolloverActionIT.kt | 2 +- .../action/ShrinkActionIT.kt | 2 +- .../extension/SampleCustomActionParser.kt | 6 +++--- .../indexstatemanagement/model/ActionTests.kt | 4 ++-- .../model/ISMTemplateTests.kt | 4 ++-- .../model/ManagedIndexMetaDataTests.kt | 4 ++-- .../resthandler/ISMTemplateRestAPIIT.kt | 2 +- .../resthandler/IndexStateManagementRestApiIT.kt | 2 +- .../resthandler/RestAddPolicyActionIT.kt | 2 +- .../resthandler/RestChangePolicyActionIT.kt | 2 +- .../resthandler/RestExplainActionIT.kt | 2 +- .../resthandler/RestRemovePolicyActionIT.kt | 2 +- .../RestRetryFailedManagedIndexActionIT.kt | 2 +- .../step/AttemptSnapshotStepTests.kt | 2 +- .../step/AttemptTransitionStepTests.kt | 2 +- .../transport/action/ISMStatusResponseTests.kt | 2 +- .../action/addpolicy/AddPolicyRequestTests.kt | 2 +- .../changepolicy/ChangePolicyRequestTests.kt | 2 +- .../deletepolicy/DeletePolicyRequestTests.kt | 2 +- .../action/explain/ExplainRequestTests.kt | 2 +- .../action/explain/ExplainResponseTests.kt | 2 +- .../action/getpolicy/GetPoliciesRequestTests.kt | 2 +- .../action/getpolicy/GetPoliciesResponseTests.kt | 2 +- .../action/getpolicy/GetPolicyRequestTests.kt | 2 +- .../action/getpolicy/GetPolicyResponseTests.kt | 2 +- .../indexpolicy/IndexPolicyRequestTests.kt | 2 +- .../indexpolicy/IndexPolicyResponseTests.kt | 4 ++-- .../removepolicy/RemovePolicyRequestTests.kt | 2 +- .../RetryFailedManagedIndexRequestTests.kt | 2 +- .../util/ManagedIndexUtilsTests.kt | 2 +- .../validation/ValidateRolloverIT.kt | 2 +- .../RefreshSearchAnalyzerResponseTests.kt | 4 ++-- .../RefreshSearchAnalyzerShardResponseTests.kt | 4 ++-- .../RestRefreshSearchAnalyzerActionIT.kt | 2 +- .../rollup/RollupMetadataServiceTests.kt | 4 ++-- .../indexmanagement/rollup/RollupRestTestCase.kt | 4 ++-- .../rollup/action/RequestTests.kt | 2 +- .../rollup/action/ResponseTests.kt | 4 ++-- .../rollup/actionfilter/FieldCapsFilterIT.kt | 2 +- .../rollup/interceptor/RollupInterceptorIT.kt | 2 +- .../rollup/model/WriteableTests.kt | 2 +- .../resthandler/RestDeleteRollupActionIT.kt | 2 +- .../resthandler/RestExplainRollupActionIT.kt | 2 +- .../rollup/resthandler/RestGetRollupActionIT.kt | 2 +- .../resthandler/RestIndexRollupActionIT.kt | 2 +- .../resthandler/RestStartRollupActionIT.kt | 2 +- .../rollup/resthandler/RestStopRollupActionIT.kt | 2 +- .../rollup/runner/RollupRunnerIT.kt | 2 +- .../snapshotmanagement/SMRunnerIT.kt | 2 +- .../SnapshotManagementRestTestCase.kt | 4 ++-- .../snapshotmanagement/TestUtils.kt | 2 +- .../snapshotmanagement/action/RequestTests.kt | 2 +- .../snapshotmanagement/action/ResponseTests.kt | 4 ++-- .../snapshotmanagement/model/WriteableTests.kt | 2 +- .../RestDeleteSnapshotManagementIT.kt | 2 +- .../RestExplainSnapshotManagementIT.kt | 2 +- .../resthandler/RestGetSnapshotManagementIT.kt | 2 +- .../resthandler/RestIndexSnapshotManagementIT.kt | 2 +- .../resthandler/RestStartSnapshotManagementIT.kt | 2 +- .../resthandler/RestStopSnapshotManagementIT.kt | 2 +- .../indexmanagement/transform/TestHelpers.kt | 8 ++++---- .../transform/TransformRestTestCase.kt | 4 ++-- .../transform/TransformRunnerIT.kt | 2 +- .../transform/action/ResponseTests.kt | 4 ++-- .../transform/model/WriteableTests.kt | 2 +- .../transform/opensearchapi/ExtensionsTests.kt | 2 +- .../resthandler/RestDeleteTransformActionIT.kt | 2 +- .../resthandler/RestExplainTransformActionIT.kt | 2 +- .../resthandler/RestGetTransformActionIT.kt | 2 +- .../resthandler/RestIndexTransformActionIT.kt | 2 +- .../resthandler/RestPreviewTransformActionIT.kt | 2 +- .../resthandler/RestStartTransformActionIT.kt | 2 +- .../resthandler/RestStopTransformActionIT.kt | 2 +- 303 files changed, 581 insertions(+), 581 deletions(-) diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Action.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Action.kt index 029580701..4d251b9d2 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Action.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Action.kt @@ -5,8 +5,8 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/ActionParser.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/ActionParser.kt index 17becd274..744c69062 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/ActionParser.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/ActionParser.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser abstract class ActionParser(var customAction: Boolean = false) { diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Step.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Step.kt index 1a4b2f971..abb476aed 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Step.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Step.kt @@ -6,9 +6,9 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement import org.apache.logging.log4j.Logger -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.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepContext import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepMetaData diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Validate.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Validate.kt index a747824f5..e64d3637f 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Validate.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/Validate.kt @@ -6,9 +6,9 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement import org.opensearch.cluster.service.ClusterService -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.common.settings.Settings import org.opensearch.monitor.jvm.JvmService import java.util.Locale diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionMetaData.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionMetaData.kt index de4859241..3775cb51c 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionMetaData.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionMetaData.kt @@ -6,17 +6,17 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model import org.opensearch.common.Strings -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.common.xcontent.LoggingDeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData.Companion.NAME import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData.Companion.START_TIME import java.io.ByteArrayInputStream diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionProperties.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionProperties.kt index 0da26bf6c..1b75aec11 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionProperties.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionProperties.kt @@ -5,15 +5,15 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.spi.indexstatemanagement.addObject /** Properties that will persist across steps of a single Action. Will be stored in the [ActionMetaData]. */ diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionRetry.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionRetry.kt index b9b8b63a3..338d4a016 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionRetry.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionRetry.kt @@ -6,15 +6,15 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model import org.apache.logging.log4j.LogManager -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.common.unit.TimeValue import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import java.io.IOException import java.time.Instant import java.util.Locale diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionTimeout.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionTimeout.kt index cee26c96c..bf56d7322 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionTimeout.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionTimeout.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model -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.common.unit.TimeValue import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt index a388ac570..c778f999d 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt @@ -6,16 +6,16 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model import org.opensearch.common.Strings -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.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.common.xcontent.json.JsonXContent import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.spi.indexstatemanagement.addObject diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/PolicyRetryInfoMetaData.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/PolicyRetryInfoMetaData.kt index 0d5305886..33390fd2a 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/PolicyRetryInfoMetaData.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/PolicyRetryInfoMetaData.kt @@ -6,16 +6,16 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model import org.opensearch.common.Strings -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.common.xcontent.LoggingDeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import java.io.ByteArrayInputStream import java.nio.charset.StandardCharsets diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ShrinkActionProperties.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ShrinkActionProperties.kt index 2e2df7548..9de9209b6 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ShrinkActionProperties.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ShrinkActionProperties.kt @@ -5,14 +5,14 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils data class ShrinkActionProperties( val nodeName: String, diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StateMetaData.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StateMetaData.kt index a81f9c90c..ee2cf5ed2 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StateMetaData.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StateMetaData.kt @@ -6,16 +6,16 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model import org.opensearch.common.Strings -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.common.xcontent.LoggingDeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData.Companion.NAME import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData.Companion.START_TIME diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StepMetaData.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StepMetaData.kt index 22c42f441..c4a214c65 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StepMetaData.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StepMetaData.kt @@ -6,16 +6,16 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model import org.opensearch.common.Strings -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.common.xcontent.LoggingDeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.indexmanagement.spi.indexstatemanagement.Step import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData.Companion.NAME diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ValidationResult.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ValidationResult.kt index 60c2debeb..3008207c1 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ValidationResult.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ValidationResult.kt @@ -6,16 +6,16 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model import org.opensearch.common.Strings -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.common.xcontent.LoggingDeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.indexmanagement.spi.indexstatemanagement.Validate import java.io.ByteArrayInputStream diff --git a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementIndices.kt b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementIndices.kt index 40c9c3767..b954cd799 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementIndices.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementIndices.kt @@ -29,7 +29,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.util.INDEX_NUMBER_OF_ import org.opensearch.indexmanagement.opensearchapi.suspendUntil import org.opensearch.indexmanagement.util.IndexUtils import org.opensearch.indexmanagement.util.OpenForTesting -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException import kotlin.coroutines.suspendCoroutine diff --git a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt index e8eb0b094..7a5f0ee29 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt @@ -18,7 +18,7 @@ import org.opensearch.common.component.Lifecycle import org.opensearch.common.component.LifecycleComponent import org.opensearch.common.component.LifecycleListener import org.opensearch.common.inject.Inject -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.IndexScopedSettings import org.opensearch.common.settings.Setting @@ -27,7 +27,7 @@ import org.opensearch.common.settings.SettingsFilter import org.opensearch.common.util.concurrent.ThreadContext import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.env.Environment import org.opensearch.env.NodeEnvironment import org.opensearch.indexmanagement.controlcenter.notification.ControlCenterIndices diff --git a/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/DateHistogram.kt b/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/DateHistogram.kt index 73de49726..4f09758ce 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/DateHistogram.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/DateHistogram.kt @@ -5,13 +5,13 @@ package org.opensearch.indexmanagement.common.model.dimension -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.index.query.AbstractQueryBuilder import org.opensearch.index.query.RangeQueryBuilder import org.opensearch.indexmanagement.util.IndexUtils.Companion.getFieldFromMappings diff --git a/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Dimension.kt b/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Dimension.kt index 008036061..cea2d094c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Dimension.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Dimension.kt @@ -5,11 +5,11 @@ package org.opensearch.indexmanagement.common.model.dimension -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.index.query.AbstractQueryBuilder import org.opensearch.search.aggregations.bucket.composite.CompositeValuesSourceBuilder import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Histogram.kt b/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Histogram.kt index 46190a41d..558a42b5d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Histogram.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Histogram.kt @@ -5,13 +5,13 @@ package org.opensearch.indexmanagement.common.model.dimension -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.index.mapper.NumberFieldMapper import org.opensearch.index.query.AbstractQueryBuilder import org.opensearch.index.query.RangeQueryBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Terms.kt b/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Terms.kt index 5e7c872a1..11eb6ef3b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Terms.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/common/model/dimension/Terms.kt @@ -5,13 +5,13 @@ package org.opensearch.indexmanagement.common.model.dimension -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.index.query.AbstractQueryBuilder import org.opensearch.index.query.TermsQueryBuilder import org.opensearch.indexmanagement.util.IndexUtils.Companion.getFieldFromMappings diff --git a/src/main/kotlin/org/opensearch/indexmanagement/common/model/notification/Channel.kt b/src/main/kotlin/org/opensearch/indexmanagement/common/model/notification/Channel.kt index ef1a13f2b..ebdff4e35 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/common/model/notification/Channel.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/common/model/notification/Channel.kt @@ -7,13 +7,13 @@ package org.opensearch.indexmanagement.common.model.notification import org.opensearch.client.Client import org.opensearch.client.node.NodeClient -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.ConfigConstants import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.NotificationsPluginInterface diff --git a/src/main/kotlin/org/opensearch/indexmanagement/common/model/notification/NotificationUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/common/model/notification/NotificationUtils.kt index bbadd25c4..e39ef0445 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/common/model/notification/NotificationUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/common/model/notification/NotificationUtils.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.common.model.notification import org.opensearch.OpenSearchStatusException -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus /** * all valid response status diff --git a/src/main/kotlin/org/opensearch/indexmanagement/common/model/rest/SearchParams.kt b/src/main/kotlin/org/opensearch/indexmanagement/common/model/rest/SearchParams.kt index 40e50ce8e..53a6ac795 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/common/model/rest/SearchParams.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/common/model/rest/SearchParams.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.common.model.rest -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.search.sort.FieldSortBuilder import org.opensearch.search.sort.SortBuilders import org.opensearch.search.sort.SortOrder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigResponse.kt index bc5a69f34..07f0d23b0 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.controlcenter.notification import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/delete/DeleteLRONConfigRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/delete/DeleteLRONConfigRequest.kt index b133ae13f..e6a73030a 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/delete/DeleteLRONConfigRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/delete/DeleteLRONConfigRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.controlcenter.notification.action.delete import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions -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.indexmanagement.controlcenter.notification.util.LRON_DOC_ID_PREFIX import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigRequest.kt index 4b7c44297..6d41f7fdb 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.controlcenter.notification.action.get import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions -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.indexmanagement.common.model.rest.SearchParams import org.opensearch.indexmanagement.controlcenter.notification.util.LRON_DOC_ID_PREFIX import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigResponse.kt index 4519b4bd5..edcbd980d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.controlcenter.notification.action.get import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/IndexLRONConfigRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/IndexLRONConfigRequest.kt index 2dbc24889..f8041930c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/IndexLRONConfigRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/IndexLRONConfigRequest.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.controlcenter.notification.action.index 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 org.opensearch.indexmanagement.controlcenter.notification.model.LRONConfig import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/TransportIndexLRONConfigAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/TransportIndexLRONConfigAction.kt index 5ea8984e2..826e4402d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/TransportIndexLRONConfigAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/TransportIndexLRONConfigAction.kt @@ -29,7 +29,7 @@ import org.opensearch.indexmanagement.controlcenter.notification.LRONConfigRespo import org.opensearch.indexmanagement.controlcenter.notification.util.getDocID import org.opensearch.indexmanagement.controlcenter.notification.util.getPriority import org.opensearch.indexmanagement.util.SecurityUtils -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONCondition.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONCondition.kt index cfc2e5386..ebdf14039 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONCondition.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONCondition.kt @@ -5,14 +5,14 @@ package org.opensearch.indexmanagement.controlcenter.notification.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.util.NO_ID import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONConfig.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONConfig.kt index 3808fe516..adffc0d9f 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONConfig.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONConfig.kt @@ -5,14 +5,14 @@ package org.opensearch.indexmanagement.controlcenter.notification.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.authuser.User import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.controlcenter.notification.util.WITH_PRIORITY diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtils.kt index c4992d3f3..c06b0b511 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtils.kt @@ -20,7 +20,7 @@ import org.opensearch.indexmanagement.IndexManagementPlugin import org.opensearch.indexmanagement.controlcenter.notification.LRONConfigResponse import org.opensearch.indexmanagement.controlcenter.notification.model.LRONConfig import org.opensearch.indexmanagement.opensearchapi.parseFromGetResponse -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.TaskId const val LRON_DOC_ID_PREFIX = "LRON:" diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMActionsParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMActionsParser.kt index 0d85b53f9..a45cfddae 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMActionsParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMActionsParser.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.indexmanagement.indexstatemanagement.action.AliasActionParser import org.opensearch.indexmanagement.indexstatemanagement.action.AllocationActionParser import org.opensearch.indexmanagement.indexstatemanagement.action.CloseActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt index ad361d4cb..4b9a7fa80 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt @@ -36,14 +36,13 @@ import org.opensearch.cluster.ClusterStateListener import org.opensearch.cluster.block.ClusterBlockException import org.opensearch.cluster.metadata.IndexMetadata import org.opensearch.cluster.service.ClusterService -import org.opensearch.common.component.LifecycleListener +import org.opensearch.common.lifecycle.LifecycleListener import org.opensearch.common.regex.Regex import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue import org.opensearch.commons.authuser.User import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.index.Index -import org.opensearch.index.IndexNotFoundException +import org.opensearch.core.index.Index import org.opensearch.index.query.QueryBuilders import org.opensearch.indexmanagement.IndexManagementIndices import org.opensearch.indexmanagement.IndexManagementPlugin @@ -82,7 +81,8 @@ import org.opensearch.indexmanagement.opensearchapi.withClosableContext import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ISMIndexMetadata import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData import org.opensearch.indexmanagement.util.OpenForTesting -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus +import org.opensearch.index.IndexNotFoundException import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.threadpool.Scheduler import org.opensearch.threadpool.ThreadPool diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexRunner.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexRunner.kt index c8d65321a..4ab3f48d0 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexRunner.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexRunner.kt @@ -36,7 +36,7 @@ import org.opensearch.core.xcontent.ToXContent import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.common.xcontent.XContentType import org.opensearch.index.engine.VersionConflictEngineException import org.opensearch.index.seqno.SequenceNumbers @@ -97,7 +97,7 @@ import org.opensearch.jobscheduler.spi.LockModel import org.opensearch.jobscheduler.spi.ScheduledJobParameter import org.opensearch.jobscheduler.spi.ScheduledJobRunner import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.script.Script import org.opensearch.script.ScriptService import org.opensearch.script.TemplateScript diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AliasAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AliasAction.kt index 3a807aaaf..47111a823 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AliasAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AliasAction.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.indexmanagement.indexstatemanagement.step.alias.AttemptAliasActionsStep diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AliasActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AliasActionParser.kt index 3df032e01..cee344faf 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AliasActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AliasActionParser.kt @@ -7,10 +7,10 @@ package org.opensearch.indexmanagement.indexstatemanagement.action import org.apache.logging.log4j.LogManager import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.indexstatemanagement.action.AliasAction.Companion.ACTIONS import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AllocationAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AllocationAction.kt index 280cbec45..d1bf0d6df 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AllocationAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AllocationAction.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.indexmanagement.indexstatemanagement.step.allocation.AttemptAllocationStep diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AllocationActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AllocationActionParser.kt index 7494a7408..129e4e342 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AllocationActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/AllocationActionParser.kt @@ -5,10 +5,10 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.indexstatemanagement.action.AllocationAction.Companion.EXCLUDE import org.opensearch.indexmanagement.indexstatemanagement.action.AllocationAction.Companion.INCLUDE import org.opensearch.indexmanagement.indexstatemanagement.action.AllocationAction.Companion.REQUIRE diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/CloseActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/CloseActionParser.kt index aa6c6951b..a8ac8ff01 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/CloseActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/CloseActionParser.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/DeleteActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/DeleteActionParser.kt index e7f707434..42a269cd0 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/DeleteActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/DeleteActionParser.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ForceMergeAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ForceMergeAction.kt index f5615c884..e4516b068 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ForceMergeAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ForceMergeAction.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.indexmanagement.indexstatemanagement.step.forcemerge.AttemptCallForceMergeStep diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ForceMergeActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ForceMergeActionParser.kt index 2236095f7..4eb14de2f 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ForceMergeActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ForceMergeActionParser.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.indexstatemanagement.action.ForceMergeAction.Companion.MAX_NUM_SEGMENTS_FIELD import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/IndexPriorityAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/IndexPriorityAction.kt index 79e828212..4be14448b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/IndexPriorityAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/IndexPriorityAction.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.indexmanagement.indexstatemanagement.step.indexpriority.AttemptSetIndexPriorityStep diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/IndexPriorityActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/IndexPriorityActionParser.kt index 54b78c4a6..2db7d6758 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/IndexPriorityActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/IndexPriorityActionParser.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.indexstatemanagement.action.IndexPriorityAction.Companion.INDEX_PRIORITY_FIELD import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/NotificationAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/NotificationAction.kt index 2e1940d2b..c361d080f 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/NotificationAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/NotificationAction.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.indexmanagement.common.model.notification.Channel diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/NotificationActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/NotificationActionParser.kt index 8e012f5ec..760f81c28 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/NotificationActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/NotificationActionParser.kt @@ -5,10 +5,10 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.indexstatemanagement.action.NotificationAction.Companion.CHANNEL_FIELD import org.opensearch.indexmanagement.indexstatemanagement.action.NotificationAction.Companion.DESTINATION_FIELD import org.opensearch.indexmanagement.indexstatemanagement.action.NotificationAction.Companion.MESSAGE_TEMPLATE_FIELD diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/OpenActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/OpenActionParser.kt index d7b3c5418..5974a2656 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/OpenActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/OpenActionParser.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReadOnlyActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReadOnlyActionParser.kt index 6a49f025c..6257886fa 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReadOnlyActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReadOnlyActionParser.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReadWriteActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReadWriteActionParser.kt index 3de46a693..76626bbd4 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReadWriteActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReadWriteActionParser.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReplicaCountAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReplicaCountAction.kt index c05793f62..88ef2f450 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReplicaCountAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReplicaCountAction.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.indexmanagement.indexstatemanagement.step.replicacount.AttemptReplicaCountStep diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReplicaCountActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReplicaCountActionParser.kt index 945450758..a92156167 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReplicaCountActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ReplicaCountActionParser.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt index 48f892032..3e45beea8 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt index 7671754ad..e9a979f61 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt @@ -5,11 +5,11 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RollupAction.kt index f695078e8..8adbf9f01 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RollupAction.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.indexmanagement.indexstatemanagement.step.rollup.AttemptCreateRollupJobStep diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RollupActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RollupActionParser.kt index 1d5d09f4c..d512661d0 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RollupActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RollupActionParser.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.indexmanagement.rollup.model.ISMRollup import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkAction.kt index 91a3a1a24..85d8f5142 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkAction.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action import org.opensearch.action.admin.indices.alias.Alias -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.common.unit.ByteSizeValue import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionParser.kt index 9a51b036e..a4cf04f20 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionParser.kt @@ -6,10 +6,10 @@ package org.opensearch.indexmanagement.indexstatemanagement.action import org.opensearch.action.admin.indices.alias.Alias -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.common.unit.ByteSizeValue import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.indexstatemanagement.action.ShrinkAction.Companion.ALIASES_FIELD import org.opensearch.indexmanagement.indexstatemanagement.action.ShrinkAction.Companion.FORCE_UNSAFE_FIELD import org.opensearch.indexmanagement.indexstatemanagement.action.ShrinkAction.Companion.MAX_SHARD_SIZE_FIELD diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/SnapshotAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/SnapshotAction.kt index ded700b94..05489d8bf 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/SnapshotAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/SnapshotAction.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.indexmanagement.indexstatemanagement.step.snapshot.AttemptSnapshotStep diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/SnapshotActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/SnapshotActionParser.kt index c7f4ba16f..97bf15c0d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/SnapshotActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/SnapshotActionParser.kt @@ -5,10 +5,10 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.indexstatemanagement.action.SnapshotAction.Companion.REPOSITORY_FIELD import org.opensearch.indexmanagement.indexstatemanagement.action.SnapshotAction.Companion.SNAPSHOT_FIELD import org.opensearch.indexmanagement.spi.indexstatemanagement.Action diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ChangePolicy.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ChangePolicy.kt index 6f4ba99b5..36b51af61 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ChangePolicy.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ChangePolicy.kt @@ -5,15 +5,15 @@ package org.opensearch.indexmanagement.indexstatemanagement.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.authuser.User import org.opensearch.indexmanagement.indexstatemanagement.util.WITH_USER import org.opensearch.indexmanagement.opensearchapi.optionalUserField diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ErrorNotification.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ErrorNotification.kt index 42543560a..6fbef5edb 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ErrorNotification.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ErrorNotification.kt @@ -5,15 +5,15 @@ package org.opensearch.indexmanagement.indexstatemanagement.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.common.model.notification.Channel import org.opensearch.indexmanagement.indexstatemanagement.model.destination.Destination import org.opensearch.script.Script diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ISMTemplate.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ISMTemplate.kt index f963755fd..dde11627e 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ISMTemplate.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ISMTemplate.kt @@ -5,15 +5,15 @@ package org.opensearch.indexmanagement.indexstatemanagement.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.opensearchapi.instant import org.opensearch.indexmanagement.opensearchapi.optionalTimeField import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ManagedIndexConfig.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ManagedIndexConfig.kt index a27b1bf7b..7e8d36268 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ManagedIndexConfig.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ManagedIndexConfig.kt @@ -9,7 +9,7 @@ import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.indexstatemanagement.util.XCONTENT_WITHOUT_TYPE import org.opensearch.indexmanagement.opensearchapi.instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Policy.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Policy.kt index 2091801ce..1d96e0fc4 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Policy.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Policy.kt @@ -5,15 +5,15 @@ package org.opensearch.indexmanagement.indexstatemanagement.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.authuser.User import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.indexstatemanagement.util.WITH_TYPE diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/State.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/State.kt index ca0128aab..43be9a6d8 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/State.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/State.kt @@ -5,15 +5,15 @@ package org.opensearch.indexmanagement.indexstatemanagement.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.indexstatemanagement.ISMActionsParser import org.opensearch.indexmanagement.indexstatemanagement.IndexMetadataProvider import org.opensearch.indexmanagement.indexstatemanagement.action.DeleteAction diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/StateFilter.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/StateFilter.kt index 73f706e4a..615bac27a 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/StateFilter.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/StateFilter.kt @@ -5,12 +5,12 @@ package org.opensearch.indexmanagement.indexstatemanagement.model -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.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException data class StateFilter(val state: String) : Writeable { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Transition.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Transition.kt index ca0907b97..d6b617150 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Transition.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Transition.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.model -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.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.core.xcontent.ToXContent @@ -15,7 +15,7 @@ import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.jobscheduler.spi.schedule.CronSchedule import org.opensearch.jobscheduler.spi.schedule.ScheduleParser import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/coordinator/SweptManagedIndexConfig.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/coordinator/SweptManagedIndexConfig.kt index dd733ff58..a84dba159 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/coordinator/SweptManagedIndexConfig.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/coordinator/SweptManagedIndexConfig.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.model.coordinator import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.indexstatemanagement.model.ChangePolicy import org.opensearch.indexmanagement.indexstatemanagement.model.ManagedIndexConfig import org.opensearch.indexmanagement.indexstatemanagement.model.Policy diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Chime.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Chime.kt index 064a9957b..802569f10 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Chime.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Chime.kt @@ -6,14 +6,14 @@ package org.opensearch.indexmanagement.indexstatemanagement.model.destination import org.opensearch.core.common.Strings -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException /** diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/CustomWebhook.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/CustomWebhook.kt index 4220af107..6d5d9d4ce 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/CustomWebhook.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/CustomWebhook.kt @@ -6,14 +6,14 @@ package org.opensearch.indexmanagement.indexstatemanagement.model.destination import org.opensearch.core.common.Strings -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException /** diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Destination.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Destination.kt index 01d6eff0f..32ff35b38 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Destination.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Destination.kt @@ -5,15 +5,15 @@ package org.opensearch.indexmanagement.indexstatemanagement.model.destination -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.destination.message.LegacyBaseMessage import org.opensearch.commons.destination.message.LegacyChimeMessage import org.opensearch.commons.destination.message.LegacyCustomWebhookMessage diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Slack.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Slack.kt index f79c97026..c75759310 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Slack.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/destination/Slack.kt @@ -6,14 +6,14 @@ package org.opensearch.indexmanagement.indexstatemanagement.model.destination import org.opensearch.core.common.Strings -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException /** diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestChangePolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestChangePolicyAction.kt index be123df24..8b2dc16a4 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestChangePolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestChangePolicyAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.resthandler import org.opensearch.client.node.NodeClient import org.opensearch.core.common.Strings import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.ISM_BASE_URI import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.LEGACY_ISM_BASE_URI import org.opensearch.indexmanagement.indexstatemanagement.model.ChangePolicy diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestIndexPolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestIndexPolicyAction.kt index ff6d0d03b..a75b5dfc6 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestIndexPolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestIndexPolicyAction.kt @@ -31,7 +31,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.PUT import org.opensearch.rest.RestResponse -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.rest.action.RestResponseListener import java.io.IOException import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/AttemptCallForceMergeStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/AttemptCallForceMergeStep.kt index 640d2c662..58b455d00 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/AttemptCallForceMergeStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/AttemptCallForceMergeStep.kt @@ -21,7 +21,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.Step import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionProperties import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepMetaData -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.transport.RemoteTransportException import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/WaitForForceMergeStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/WaitForForceMergeStep.kt index 83ac0e073..e07560975 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/WaitForForceMergeStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/WaitForForceMergeStep.kt @@ -16,7 +16,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionPrope import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepContext import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepMetaData -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Duration import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt index 6657e672a..5af656db5 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt @@ -23,7 +23,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.Step import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepContext import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepMetaData -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.transport.RemoteTransportException import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/snapshot/AttemptSnapshotStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/snapshot/AttemptSnapshotStep.kt index f4ffef794..4256cd0aa 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/snapshot/AttemptSnapshotStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/snapshot/AttemptSnapshotStep.kt @@ -18,7 +18,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.Step import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionProperties import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepMetaData -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.script.Script import org.opensearch.script.ScriptService import org.opensearch.script.ScriptType diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transition/AttemptTransitionStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transition/AttemptTransitionStep.kt index 843987b4e..82fde5fad 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transition/AttemptTransitionStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transition/AttemptTransitionStep.kt @@ -22,7 +22,7 @@ import org.opensearch.indexmanagement.opensearchapi.suspendUntil import org.opensearch.indexmanagement.spi.indexstatemanagement.Step import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepMetaData -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.transport.RemoteTransportException import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponse.kt index 0a78fac8d..15acd62bb 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/AddPolicyRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/AddPolicyRequest.kt index c9ac3bb51..99304e00c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/AddPolicyRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/AddPolicyRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.add import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions -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.indexmanagement.indexstatemanagement.util.DEFAULT_INDEX_TYPE import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/TransportAddPolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/TransportAddPolicyAction.kt index f16d8a92e..250df26c4 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/TransportAddPolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/TransportAddPolicyAction.kt @@ -35,7 +35,7 @@ import org.opensearch.common.unit.TimeValue import org.opensearch.commons.ConfigConstants import org.opensearch.commons.authuser.User import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.index.Index +import org.opensearch.core.index.Index import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX import org.opensearch.indexmanagement.indexstatemanagement.DefaultIndexMetadataService import org.opensearch.indexmanagement.indexstatemanagement.IndexMetadataProvider @@ -60,7 +60,7 @@ import org.opensearch.indexmanagement.util.IndexUtils import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource import org.opensearch.indexmanagement.util.SecurityUtils.Companion.validateUserConfiguration -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.time.Duration diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequest.kt index fcec1bf74..cc53f6d78 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.cha import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions -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.indexmanagement.indexstatemanagement.model.ChangePolicy import org.opensearch.indexmanagement.indexstatemanagement.util.DEFAULT_INDEX_TYPE import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/TransportChangePolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/TransportChangePolicyAction.kt index f586b1d79..e77c744ce 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/TransportChangePolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/TransportChangePolicyAction.kt @@ -33,7 +33,7 @@ import org.opensearch.common.settings.Settings import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.commons.ConfigConstants import org.opensearch.commons.authuser.User -import org.opensearch.index.Index +import org.opensearch.core.index.Index import org.opensearch.indexmanagement.IndexManagementPlugin import org.opensearch.indexmanagement.indexstatemanagement.DefaultIndexMetadataService import org.opensearch.indexmanagement.indexstatemanagement.IndexMetadataProvider @@ -64,7 +64,7 @@ import org.opensearch.indexmanagement.util.NO_ID import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource import org.opensearch.indexmanagement.util.SecurityUtils.Companion.validateUserConfiguration -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/DeletePolicyRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/DeletePolicyRequest.kt index ae462034a..ded140242 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/DeletePolicyRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/DeletePolicyRequest.kt @@ -9,8 +9,8 @@ import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions import org.opensearch.action.support.WriteRequest -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 class DeletePolicyRequest(val policyID: String, val refreshPolicy: WriteRequest.RefreshPolicy) : ActionRequest() { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/TransportDeletePolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/TransportDeletePolicyAction.kt index d9fcd040c..adfa7760e 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/TransportDeletePolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/TransportDeletePolicyAction.kt @@ -29,7 +29,7 @@ import org.opensearch.indexmanagement.opensearchapi.parseFromGetResponse import org.opensearch.indexmanagement.settings.IndexManagementSettings import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.lang.IllegalArgumentException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainRequest.kt index cebb73a0a..a34ce2020 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.exp import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions -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.indexmanagement.common.model.rest.SearchParams import org.opensearch.indexmanagement.indexstatemanagement.util.DEFAULT_INDEX_TYPE diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponse.kt index 3fbc7d84c..25f6c5cfa 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.explain import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesRequest.kt index d220de6f7..0bf74d646 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.get import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -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.indexmanagement.common.model.rest.SearchParams import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponse.kt index 7d0548188..eb1b9bdd6 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.getpolicy import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyRequest.kt index d63d3afbd..5e9762ed9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.get import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions -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.search.fetch.subphase.FetchSourceContext import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponse.kt index ee2e6d58b..4369a8c60 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.getpolicy import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPolicyAction.kt index 0b33c3091..21778df1e 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPolicyAction.kt @@ -26,7 +26,7 @@ import org.opensearch.indexmanagement.opensearchapi.parseFromGetResponse import org.opensearch.indexmanagement.settings.IndexManagementSettings.Companion.FILTER_BY_BACKEND_ROLES import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.lang.IllegalArgumentException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyRequest.kt index 4cc515cd6..e4a04f788 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyRequest.kt @@ -9,8 +9,8 @@ import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions import org.opensearch.action.support.WriteRequest -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.indexmanagement.indexstatemanagement.model.Policy import org.opensearch.indexmanagement.util.NO_ID import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponse.kt index b21287446..0c0e90163 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.indexpolicy import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder @@ -18,7 +18,7 @@ import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO import org.opensearch.indexmanagement.util._VERSION -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.io.IOException class IndexPolicyResponse : ActionResponse, ToXContentObject { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt index d49f9ef7e..11ca906b7 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt @@ -48,7 +48,7 @@ import org.opensearch.indexmanagement.util.IndexManagementException import org.opensearch.indexmanagement.util.IndexUtils import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.validateUserConfiguration -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/managedIndex/ManagedIndexRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/managedIndex/ManagedIndexRequest.kt index da19524df..808abda52 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/managedIndex/ManagedIndexRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/managedIndex/ManagedIndexRequest.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.managedIndex import org.opensearch.action.support.broadcast.BroadcastRequest -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import java.io.IOException @Suppress("SpreadOperator") diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/RemovePolicyRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/RemovePolicyRequest.kt index 38d13a9eb..66caa4d74 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/RemovePolicyRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/RemovePolicyRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.rem import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions -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.indexmanagement.indexstatemanagement.util.DEFAULT_INDEX_TYPE import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/TransportRemovePolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/TransportRemovePolicyAction.kt index 1e14b525a..36250d460 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/TransportRemovePolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/TransportRemovePolicyAction.kt @@ -34,7 +34,7 @@ import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings import org.opensearch.commons.ConfigConstants import org.opensearch.commons.authuser.User -import org.opensearch.index.Index +import org.opensearch.core.index.Index import org.opensearch.index.IndexNotFoundException import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX import org.opensearch.indexmanagement.indexstatemanagement.DefaultIndexMetadataService @@ -52,7 +52,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.util.removeClusterSta import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ISMIndexMetadata import org.opensearch.indexmanagement.util.IndexManagementException import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/RetryFailedManagedIndexRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/RetryFailedManagedIndexRequest.kt index 576ca24b7..b6d6eea60 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/RetryFailedManagedIndexRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/RetryFailedManagedIndexRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.ret import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions -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.indexmanagement.indexstatemanagement.util.DEFAULT_INDEX_TYPE import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/TransportRetryFailedManagedIndexAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/TransportRetryFailedManagedIndexAction.kt index fd34938fb..e70a6532b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/TransportRetryFailedManagedIndexAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/TransportRetryFailedManagedIndexAction.kt @@ -32,7 +32,7 @@ import org.opensearch.core.xcontent.ToXContent import org.opensearch.common.xcontent.XContentFactory import org.opensearch.commons.ConfigConstants import org.opensearch.commons.authuser.User -import org.opensearch.index.Index +import org.opensearch.core.index.Index import org.opensearch.index.IndexNotFoundException import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX import org.opensearch.indexmanagement.indexstatemanagement.DefaultIndexMetadataService @@ -53,7 +53,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedInde import org.opensearch.indexmanagement.spi.indexstatemanagement.model.PolicyRetryInfoMetaData import org.opensearch.indexmanagement.util.IndexManagementException import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/TransportUpdateManagedIndexMetaDataAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/TransportUpdateManagedIndexMetaDataAction.kt index e3fb93dc0..1e983a340 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/TransportUpdateManagedIndexMetaDataAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/TransportUpdateManagedIndexMetaDataAction.kt @@ -23,9 +23,9 @@ import org.opensearch.cluster.metadata.Metadata import org.opensearch.cluster.service.ClusterService import org.opensearch.common.Priority import org.opensearch.common.inject.Inject -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.Writeable -import org.opensearch.index.Index +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.Writeable +import org.opensearch.core.index.Index import org.opensearch.indexmanagement.IndexManagementPlugin import org.opensearch.indexmanagement.indexstatemanagement.IndexMetadataProvider import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/UpdateManagedIndexMetaDataAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/UpdateManagedIndexMetaDataAction.kt index 6c87d1c97..7078f2d59 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/UpdateManagedIndexMetaDataAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/UpdateManagedIndexMetaDataAction.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.upd import org.opensearch.action.ActionType import org.opensearch.action.support.master.AcknowledgedResponse -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.Writeable class UpdateManagedIndexMetaDataAction : ActionType(NAME, reader) { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/UpdateManagedIndexMetaDataRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/UpdateManagedIndexMetaDataRequest.kt index 3fa8e436c..5d5d31b69 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/UpdateManagedIndexMetaDataRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/UpdateManagedIndexMetaDataRequest.kt @@ -8,9 +8,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.upd import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions.addValidationError import org.opensearch.action.support.master.AcknowledgedRequest -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.index.Index +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.index.Index import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData class UpdateManagedIndexMetaDataRequest : AcknowledgedRequest { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/NotificationUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/NotificationUtils.kt index ce8d531f0..b943e08ee 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/NotificationUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/NotificationUtils.kt @@ -19,7 +19,7 @@ import org.opensearch.indexmanagement.common.model.notification.Channel import org.opensearch.indexmanagement.common.model.notification.validateResponseStatus import org.opensearch.indexmanagement.opensearchapi.suspendUntil import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus /** * Extension function for publishing a notification to a legacy destination. diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/RestHandlerUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/RestHandlerUtils.kt index 529729ce7..5fe439716 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/RestHandlerUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/RestHandlerUtils.kt @@ -11,16 +11,16 @@ import org.opensearch.OpenSearchParseException import org.opensearch.action.support.clustermanager.ClusterManagerNodeRequest import org.opensearch.action.support.master.AcknowledgedResponse import org.opensearch.client.Client -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.common.logging.DeprecationLogger import org.opensearch.common.unit.TimeValue import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.common.xcontent.XContentFactory -import org.opensearch.index.Index +import org.opensearch.core.index.Index import org.opensearch.indexmanagement.indexstatemanagement.model.ChangePolicy import org.opensearch.indexmanagement.indexstatemanagement.model.ManagedIndexConfig import org.opensearch.indexmanagement.indexstatemanagement.transport.action.updateindexmetadata.UpdateManagedIndexMetaDataAction diff --git a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt index 79ae13a65..e8ea0773e 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt @@ -20,24 +20,24 @@ import org.opensearch.action.admin.indices.alias.Alias import org.opensearch.action.bulk.BackoffPolicy import org.opensearch.action.get.GetResponse import org.opensearch.action.search.SearchResponse -import org.opensearch.action.support.DefaultShardOperationFailedException import org.opensearch.client.OpenSearchClient -import org.opensearch.common.bytes.BytesReference -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.common.settings.Settings import org.opensearch.common.unit.TimeValue import org.opensearch.common.util.concurrent.ThreadContext import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.InjectSecurity import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.NotificationsPluginInterface +import org.opensearch.core.action.support.DefaultShardOperationFailedException +import org.opensearch.core.common.bytes.BytesReference import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException import org.opensearch.core.xcontent.MediaType import org.opensearch.core.xcontent.NamedXContentRegistry @@ -54,7 +54,7 @@ import org.opensearch.indexmanagement.util.NO_ID import org.opensearch.indexmanagement.util.SecurityUtils.Companion.DEFAULT_INJECT_ROLES import org.opensearch.indexmanagement.util.SecurityUtils.Companion.INTERNAL_REQUEST import org.opensearch.jobscheduler.spi.utils.LockService -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.transport.RemoteTransportException import java.io.IOException import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerAction.kt index 8dc8ae191..93a306214 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerAction.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.refreshanalyzer import org.opensearch.action.ActionType -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.Writeable class RefreshSearchAnalyzerAction : ActionType(NAME, reader) { companion object { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerRequest.kt index 6952c4c34..7f6a612c4 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerRequest.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.refreshanalyzer import org.opensearch.action.support.broadcast.BroadcastRequest -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import java.io.IOException class RefreshSearchAnalyzerRequest : BroadcastRequest { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerResponse.kt index 211a1b543..f4722644c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerResponse.kt @@ -5,10 +5,10 @@ package org.opensearch.indexmanagement.refreshanalyzer -import org.opensearch.action.support.DefaultShardOperationFailedException +import org.opensearch.core.action.support.DefaultShardOperationFailedException import org.opensearch.action.support.broadcast.BroadcastResponse -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.ConstructingObjectParser import org.opensearch.core.xcontent.ToXContent.Params import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerShardResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerShardResponse.kt index 7277d6f4d..0a87f15ee 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerShardResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerShardResponse.kt @@ -6,9 +6,9 @@ package org.opensearch.indexmanagement.refreshanalyzer import org.opensearch.action.support.broadcast.BroadcastShardResponse -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.index.shard.ShardId +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamOutput +import org.opensearch.core.index.shard.ShardId import java.io.IOException class RefreshSearchAnalyzerShardResponse : BroadcastShardResponse { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/TransportRefreshSearchAnalyzerAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/TransportRefreshSearchAnalyzerAction.kt index 12bfc2a3b..28473d451 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/TransportRefreshSearchAnalyzerAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/refreshanalyzer/TransportRefreshSearchAnalyzerAction.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.refreshanalyzer import org.apache.logging.log4j.LogManager import org.opensearch.action.support.ActionFilters -import org.opensearch.action.support.DefaultShardOperationFailedException +import org.opensearch.core.action.support.DefaultShardOperationFailedException import org.opensearch.action.support.broadcast.node.TransportBroadcastByNodeAction import org.opensearch.cluster.ClusterState import org.opensearch.cluster.block.ClusterBlockException @@ -17,8 +17,8 @@ import org.opensearch.cluster.routing.ShardRouting import org.opensearch.cluster.routing.ShardsIterator 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.Writeable +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.index.analysis.AnalysisRegistry import org.opensearch.index.shard.IndexShard import org.opensearch.indices.IndicesService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupIndexer.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupIndexer.kt index 6bc35fb0d..ac077a707 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupIndexer.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupIndexer.kt @@ -17,6 +17,7 @@ import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.XContentType +import org.opensearch.core.rest.RestStatus import org.opensearch.indexmanagement.opensearchapi.retry import org.opensearch.indexmanagement.opensearchapi.suspendUntil import org.opensearch.indexmanagement.rollup.model.Rollup @@ -27,7 +28,6 @@ import org.opensearch.indexmanagement.rollup.util.RollupFieldValueExpressionReso import org.opensearch.indexmanagement.rollup.util.getInitialDocValues import org.opensearch.indexmanagement.util.IndexUtils.Companion.ODFE_MAGIC_NULL import org.opensearch.indexmanagement.util.IndexUtils.Companion.hashToFixedSize -import org.opensearch.rest.RestStatus import org.opensearch.search.aggregations.bucket.composite.InternalComposite import org.opensearch.search.aggregations.metrics.InternalAvg import org.opensearch.search.aggregations.metrics.InternalMax diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/DeleteRollupRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/DeleteRollupRequest.kt index 166054048..ab0a87b91 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/DeleteRollupRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/DeleteRollupRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.rollup.action.delete import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions.addValidationError import org.opensearch.action.delete.DeleteRequest -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 class DeleteRollupRequest : DeleteRequest { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/TransportDeleteRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/TransportDeleteRollupAction.kt index 3a057a388..010467ca3 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/TransportDeleteRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/TransportDeleteRollupAction.kt @@ -28,7 +28,7 @@ import org.opensearch.indexmanagement.rollup.util.parseRollup import org.opensearch.indexmanagement.settings.IndexManagementSettings import org.opensearch.indexmanagement.util.SecurityUtils import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.lang.Exception diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupRequest.kt index 5123bdd75..e24fc5f9f 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.rollup.action.explain import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions.addValidationError -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 class ExplainRollupRequest : ActionRequest { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupResponse.kt index 73ca5e2f4..19f58e890 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.rollup.action.explain import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupRequest.kt index 7e5b631ae..95f319ff1 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.rollup.action.get import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions -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.search.fetch.subphase.FetchSourceContext import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupResponse.kt index 243e61016..b5b184432 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.rollup.action.get import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder @@ -18,7 +18,7 @@ import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO import org.opensearch.indexmanagement.util._VERSION -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.io.IOException class GetRollupResponse : ActionResponse, ToXContentObject { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsRequest.kt index 20e97ebfe..e5f78662b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.indexmanagement.rollup.action.get import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -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.indexmanagement.rollup.model.Rollup import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsResponse.kt index 6d8ab8080..63299ec85 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.rollup.action.get import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder @@ -17,7 +17,7 @@ import org.opensearch.indexmanagement.rollup.model.Rollup.Companion.ROLLUP_TYPE import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.io.IOException class GetRollupsResponse : ActionResponse, ToXContentObject { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupAction.kt index 245ab4abb..537e62950 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupAction.kt @@ -24,7 +24,7 @@ import org.opensearch.indexmanagement.rollup.util.parseRollup import org.opensearch.indexmanagement.settings.IndexManagementSettings import org.opensearch.indexmanagement.util.SecurityUtils import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.lang.Exception diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupsAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupsAction.kt index a1e3c7055..d3ec39ada 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupsAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupsAction.kt @@ -29,7 +29,7 @@ import org.opensearch.indexmanagement.rollup.model.Rollup import org.opensearch.indexmanagement.settings.IndexManagementSettings import org.opensearch.indexmanagement.util.SecurityUtils.Companion.addUserFilter import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.sort.SortOrder import org.opensearch.tasks.Task diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupRequest.kt index fd1564165..3983621f7 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupRequest.kt @@ -10,8 +10,8 @@ import org.opensearch.action.DocWriteRequest import org.opensearch.action.ValidateActions.addValidationError import org.opensearch.action.index.IndexRequest import org.opensearch.action.support.WriteRequest -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.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.rollup.model.Rollup import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupResponse.kt index 323e22b9d..ec7de7589 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.rollup.action.index import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder @@ -18,7 +18,7 @@ import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO import org.opensearch.indexmanagement.util._VERSION -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.io.IOException class IndexRollupResponse : ActionResponse, ToXContentObject { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/TransportIndexRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/TransportIndexRollupAction.kt index c1f6070d4..0a6412c8c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/TransportIndexRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/TransportIndexRollupAction.kt @@ -35,7 +35,7 @@ import org.opensearch.indexmanagement.util.IndexUtils import org.opensearch.indexmanagement.util.SecurityUtils import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.validateUserConfiguration -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/TransportUpdateRollupMappingAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/TransportUpdateRollupMappingAction.kt index 2f0caf351..53222e093 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/TransportUpdateRollupMappingAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/TransportUpdateRollupMappingAction.kt @@ -17,10 +17,10 @@ import org.opensearch.cluster.block.ClusterBlockException import org.opensearch.cluster.block.ClusterBlockLevel import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.service.ClusterService -import org.opensearch.common.bytes.BytesReference +import org.opensearch.core.common.bytes.BytesReference import org.opensearch.common.inject.Inject -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.MediaType import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/UpdateRollupMappingAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/UpdateRollupMappingAction.kt index 4bd6a77d0..2f84b9822 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/UpdateRollupMappingAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/UpdateRollupMappingAction.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.rollup.action.mapping import org.opensearch.action.ActionType import org.opensearch.action.support.master.AcknowledgedResponse -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.Writeable class UpdateRollupMappingAction : ActionType(NAME, reader) { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/UpdateRollupMappingRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/UpdateRollupMappingRequest.kt index 7461bdb80..ec114b944 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/UpdateRollupMappingRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/UpdateRollupMappingRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.indexmanagement.rollup.action.mapping import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.support.master.AcknowledgedRequest -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.indexmanagement.rollup.model.Rollup class UpdateRollupMappingRequest : AcknowledgedRequest { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/StartRollupRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/StartRollupRequest.kt index 9df8a05f8..4a22b98a9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/StartRollupRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/StartRollupRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.rollup.action.start import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions.addValidationError import org.opensearch.action.update.UpdateRequest -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 class StartRollupRequest : UpdateRequest { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/TransportStartRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/TransportStartRollupAction.kt index b6c7965dc..133413ac8 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/TransportStartRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/TransportStartRollupAction.kt @@ -35,7 +35,7 @@ import org.opensearch.indexmanagement.rollup.util.parseRollup import org.opensearch.indexmanagement.settings.IndexManagementSettings import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.lang.IllegalArgumentException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/StopRollupRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/StopRollupRequest.kt index 370969898..1b8d78e8d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/StopRollupRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/StopRollupRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.rollup.action.stop import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions.addValidationError import org.opensearch.action.update.UpdateRequest -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 class StopRollupRequest : UpdateRequest { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/TransportStopRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/TransportStopRollupAction.kt index 8d944a737..6016e4d59 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/TransportStopRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/TransportStopRollupAction.kt @@ -34,7 +34,7 @@ import org.opensearch.indexmanagement.rollup.util.parseRollup import org.opensearch.indexmanagement.settings.IndexManagementSettings import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.lang.IllegalArgumentException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/SerDeHelper.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/SerDeHelper.kt index 11c44dbd8..5d75b4379 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/SerDeHelper.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/SerDeHelper.kt @@ -7,9 +7,9 @@ package org.opensearch.indexmanagement.rollup.actionfilter import org.opensearch.action.fieldcaps.FieldCapabilitiesResponse import org.opensearch.common.io.stream.BytesStreamOutput -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 /** * To support rollup indices being returned in correct format in FieldCaps API we have to rewrite the FieldCapabilitiesResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/ExplainRollup.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/ExplainRollup.kt index f695f7e2c..fc9763ac3 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/ExplainRollup.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/ExplainRollup.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.rollup.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/ISMRollup.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/ISMRollup.kt index 0428746e0..faa7b2244 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/ISMRollup.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/ISMRollup.kt @@ -6,14 +6,14 @@ package org.opensearch.indexmanagement.rollup.model import org.apache.commons.codec.digest.DigestUtils -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.commons.authuser.User import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.common.model.dimension.DateHistogram diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/Rollup.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/Rollup.kt index 6806a887b..c45c1d71b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/Rollup.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/Rollup.kt @@ -5,14 +5,14 @@ package org.opensearch.indexmanagement.rollup.model -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.authuser.User import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.common.model.dimension.DateHistogram diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/RollupMetadata.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/RollupMetadata.kt index 6884b0b9e..8c8a32ee7 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/RollupMetadata.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/RollupMetadata.kt @@ -6,15 +6,15 @@ package org.opensearch.indexmanagement.rollup.model import org.opensearch.action.search.SearchResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.indexstatemanagement.util.WITH_TYPE import org.opensearch.indexmanagement.opensearchapi.instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/RollupMetrics.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/RollupMetrics.kt index d7670ee62..26286ae0c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/RollupMetrics.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/RollupMetrics.kt @@ -5,15 +5,15 @@ package org.opensearch.indexmanagement.rollup.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.rollup.model.metric.Average import org.opensearch.indexmanagement.rollup.model.metric.Max import org.opensearch.indexmanagement.rollup.model.metric.Metric diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Average.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Average.kt index aa14ae859..c337f7919 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Average.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Average.kt @@ -5,13 +5,13 @@ package org.opensearch.indexmanagement.rollup.model.metric -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken class Average() : Metric(Type.AVERAGE) { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Max.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Max.kt index f2b265d18..1cfd2f8f0 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Max.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Max.kt @@ -5,13 +5,13 @@ package org.opensearch.indexmanagement.rollup.model.metric -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken class Max() : Metric(Type.MAX) { @Suppress("UNUSED_PARAMETER") diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Metric.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Metric.kt index 0b9fd0296..1fe96dcf5 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Metric.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Metric.kt @@ -5,11 +5,11 @@ package org.opensearch.indexmanagement.rollup.model.metric -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import java.io.IOException abstract class Metric(val type: Type) : ToXContentObject, Writeable { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Min.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Min.kt index cb5881d4b..02e6afaa0 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Min.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Min.kt @@ -5,13 +5,13 @@ package org.opensearch.indexmanagement.rollup.model.metric -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken class Min() : Metric(Type.MIN) { @Suppress("UNUSED_PARAMETER") diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Sum.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Sum.kt index f996ae97f..0be69fd14 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Sum.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/Sum.kt @@ -5,13 +5,13 @@ package org.opensearch.indexmanagement.rollup.model.metric -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken class Sum() : Metric(Type.SUM) { @Suppress("UNUSED_PARAMETER") diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/ValueCount.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/ValueCount.kt index 77b700517..c58398be9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/ValueCount.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/model/metric/ValueCount.kt @@ -5,13 +5,13 @@ package org.opensearch.indexmanagement.rollup.model.metric -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken class ValueCount() : Metric(Type.VALUE_COUNT) { @Suppress("UNUSED_PARAMETER") diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestIndexRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestIndexRollupAction.kt index 78cb3860a..28e807c20 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestIndexRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestIndexRollupAction.kt @@ -29,7 +29,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.PUT import org.opensearch.rest.RestResponse -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.rest.action.RestResponseListener import java.io.IOException import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/QueryShardContextFactory.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/QueryShardContextFactory.kt index c2f28113f..fc9bac0b4 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/QueryShardContextFactory.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/QueryShardContextFactory.kt @@ -9,7 +9,7 @@ import org.opensearch.Version import org.opensearch.client.Client import org.opensearch.cluster.metadata.IndexMetadata 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.regex.Regex import org.opensearch.common.settings.IndexScopedSettings import org.opensearch.common.settings.Settings @@ -17,7 +17,7 @@ import org.opensearch.common.settings.SettingsModule import org.opensearch.common.util.BigArrays import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.env.Environment -import org.opensearch.index.Index +import org.opensearch.core.index.Index import org.opensearch.index.IndexSettings import org.opensearch.index.mapper.MapperService import org.opensearch.index.query.QueryShardContext diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtils.kt index f6d749fbb..7b310a4f7 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtils.kt @@ -13,7 +13,7 @@ import org.opensearch.cluster.ClusterState import org.opensearch.cluster.metadata.IndexMetadata import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.common.xcontent.XContentType import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser.Token diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunner.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunner.kt index 272f3307d..10636891d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunner.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunner.kt @@ -31,7 +31,7 @@ import org.opensearch.indexmanagement.util.releaseLockForScheduledJob import org.opensearch.jobscheduler.spi.JobExecutionContext import org.opensearch.jobscheduler.spi.ScheduledJobParameter import org.opensearch.jobscheduler.spi.ScheduledJobRunner -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.threadpool.ThreadPool import java.time.Instant.now diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt index 23d025754..0ff9cc691 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt @@ -41,7 +41,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy.Companio import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy.Companion.SM_TYPE import org.opensearch.snapshots.SnapshotsService import org.opensearch.jobscheduler.spi.schedule.Schedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.snapshots.SnapshotInfo import org.opensearch.snapshots.SnapshotMissingException import org.opensearch.transport.RemoteTransportException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/resthandler/RestBaseIndexSMPolicyHandler.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/resthandler/RestBaseIndexSMPolicyHandler.kt index 7c406db22..32ca9f9c1 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/resthandler/RestBaseIndexSMPolicyHandler.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/resthandler/RestBaseIndexSMPolicyHandler.kt @@ -23,7 +23,7 @@ import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.BytesRestResponse import org.opensearch.rest.RestRequest import org.opensearch.rest.RestResponse -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.rest.action.RestResponseListener import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/BaseTransportAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/BaseTransportAction.kt index f04704569..0f1587148 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/BaseTransportAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/BaseTransportAction.kt @@ -16,14 +16,14 @@ import org.opensearch.action.ActionResponse import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction import org.opensearch.client.Client -import org.opensearch.common.io.stream.Writeable +import org.opensearch.core.common.io.stream.Writeable import org.opensearch.common.util.concurrent.ThreadContext.StoredContext import org.opensearch.commons.ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT import org.opensearch.commons.authuser.User import org.opensearch.index.engine.VersionConflictEngineException import org.opensearch.indexmanagement.util.IndexManagementException import org.opensearch.indexmanagement.util.SecurityUtils -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/delete/DeleteSMPolicyRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/delete/DeleteSMPolicyRequest.kt index e594a7801..d8a95fd3f 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/delete/DeleteSMPolicyRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/delete/DeleteSMPolicyRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.delete import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.delete.DeleteRequest -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 class DeleteSMPolicyRequest : DeleteRequest { override fun validate(): ActionRequestValidationException? { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/delete/TransportDeleteSMPolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/delete/TransportDeleteSMPolicyAction.kt index 87dabdd67..03853b603 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/delete/TransportDeleteSMPolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/delete/TransportDeleteSMPolicyAction.kt @@ -23,7 +23,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.api.transport.SMActions import org.opensearch.indexmanagement.snapshotmanagement.getSMPolicy import org.opensearch.indexmanagement.snapshotmanagement.settings.SnapshotManagementSettings.Companion.FILTER_BY_BACKEND_ROLES import org.opensearch.indexmanagement.util.SecurityUtils.Companion.verifyUserHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.transport.TransportService class TransportDeleteSMPolicyAction @Inject constructor( diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyRequest.kt index a141a08c8..4e2d6cd7b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.explain import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -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 class ExplainSMPolicyRequest( val policyNames: Array diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyResponse.kt index 5de2782f5..fb642b677 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.explain import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/TransportExplainSMAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/TransportExplainSMAction.kt index a8e09411c..dcd1e5fa1 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/TransportExplainSMAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/TransportExplainSMAction.kt @@ -16,7 +16,7 @@ import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings import org.opensearch.common.util.concurrent.ThreadContext import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.authuser.User import org.opensearch.index.IndexNotFoundException import org.opensearch.index.query.BoolQueryBuilder @@ -39,7 +39,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy.Companio import org.opensearch.indexmanagement.snapshotmanagement.settings.SnapshotManagementSettings.Companion.FILTER_BY_BACKEND_ROLES import org.opensearch.indexmanagement.snapshotmanagement.smMetadataDocIdToPolicyName import org.opensearch.indexmanagement.util.SecurityUtils -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesRequest.kt index fc52bf76e..5464556d9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.get import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -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.indexmanagement.common.model.rest.SearchParams import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesResponse.kt index 2412da175..04c9fd8e3 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.get import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyRequest.kt index 899705927..439d93f2e 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.get import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -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 class GetSMPolicyRequest( val policyID: String diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyResponse.kt index 255557723..2df00a5bc 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.get import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/TransportGetSMPoliciesAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/TransportGetSMPoliciesAction.kt index 0e4c6e775..a93daf398 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/TransportGetSMPoliciesAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/TransportGetSMPoliciesAction.kt @@ -32,7 +32,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy import org.opensearch.indexmanagement.snapshotmanagement.settings.SnapshotManagementSettings.Companion.FILTER_BY_BACKEND_ROLES import org.opensearch.indexmanagement.snapshotmanagement.util.SM_POLICY_NAME_KEYWORD import org.opensearch.indexmanagement.util.SecurityUtils -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/TransportGetSMPolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/TransportGetSMPolicyAction.kt index 55bb981d0..dbfc4f857 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/TransportGetSMPolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/TransportGetSMPolicyAction.kt @@ -24,7 +24,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.api.transport.SMActions import org.opensearch.indexmanagement.snapshotmanagement.parseSMPolicy import org.opensearch.indexmanagement.snapshotmanagement.settings.SnapshotManagementSettings.Companion.FILTER_BY_BACKEND_ROLES import org.opensearch.indexmanagement.util.SecurityUtils.Companion.verifyUserHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.transport.TransportService class TransportGetSMPolicyAction @Inject constructor( diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyRequest.kt index 5dcd21fbe..03662cf14 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyRequest.kt @@ -10,8 +10,8 @@ import org.opensearch.action.DocWriteRequest import org.opensearch.action.ValidateActions import org.opensearch.action.index.IndexRequest import org.opensearch.action.support.WriteRequest -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.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy import java.time.Instant.now diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyResponse.kt index 0b6e91b78..095edf677 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.index import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder @@ -18,7 +18,7 @@ import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO import org.opensearch.indexmanagement.util._VERSION -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus class IndexSMPolicyResponse( val id: String, diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/start/StartSMRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/start/StartSMRequest.kt index 22f37167b..23e00e16b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/start/StartSMRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/start/StartSMRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.start import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions import org.opensearch.action.update.UpdateRequest -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 class StartSMRequest : UpdateRequest { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/start/TransportStartSMAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/start/TransportStartSMAction.kt index 6d5d5a442..ac802a290 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/start/TransportStartSMAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/start/TransportStartSMAction.kt @@ -27,7 +27,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.getSMPolicy import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy import org.opensearch.indexmanagement.snapshotmanagement.settings.SnapshotManagementSettings.Companion.FILTER_BY_BACKEND_ROLES import org.opensearch.indexmanagement.util.SecurityUtils.Companion.verifyUserHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.transport.TransportService import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/stop/StopSMRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/stop/StopSMRequest.kt index e854f72a3..4d70096b6 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/stop/StopSMRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/stop/StopSMRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.stop import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions import org.opensearch.action.update.UpdateRequest -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 class StopSMRequest : UpdateRequest { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/stop/TransportStopSMAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/stop/TransportStopSMAction.kt index 9f424923d..08626ef43 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/stop/TransportStopSMAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/stop/TransportStopSMAction.kt @@ -27,7 +27,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.getSMPolicy import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy import org.opensearch.indexmanagement.snapshotmanagement.settings.SnapshotManagementSettings.Companion.FILTER_BY_BACKEND_ROLES import org.opensearch.indexmanagement.util.SecurityUtils.Companion.verifyUserHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.transport.TransportService import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/ExplainSMPolicy.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/ExplainSMPolicy.kt index 6dd82a801..b1f6288c9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/ExplainSMPolicy.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/ExplainSMPolicy.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.snapshotmanagement.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/NotificationConfig.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/NotificationConfig.kt index eb819e07e..88b38df8d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/NotificationConfig.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/NotificationConfig.kt @@ -7,15 +7,15 @@ package org.opensearch.indexmanagement.snapshotmanagement.model import org.apache.logging.log4j.Logger import org.opensearch.client.Client -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.model.EventSource import org.opensearch.commons.notifications.model.SeverityType diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/SMMetadata.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/SMMetadata.kt index adec9304c..e42486a6f 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/SMMetadata.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/SMMetadata.kt @@ -5,15 +5,15 @@ package org.opensearch.indexmanagement.snapshotmanagement.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.indexstatemanagement.util.WITH_TYPE import org.opensearch.indexmanagement.opensearchapi.instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/SMPolicy.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/SMPolicy.kt index 2804545a8..358b84c80 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/SMPolicy.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/SMPolicy.kt @@ -5,15 +5,15 @@ package org.opensearch.indexmanagement.snapshotmanagement.model -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.common.unit.TimeValue import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.commons.authuser.User import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.indexstatemanagement.util.WITH_TYPE diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/TargetIndexMappingService.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/TargetIndexMappingService.kt index 0a5954a94..0d29502a5 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/TargetIndexMappingService.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/TargetIndexMappingService.kt @@ -9,7 +9,7 @@ import org.apache.logging.log4j.LogManager import org.opensearch.action.admin.indices.mapping.get.GetMappingsRequest import org.opensearch.action.admin.indices.mapping.get.GetMappingsResponse import org.opensearch.client.Client -import org.opensearch.common.bytes.BytesReference +import org.opensearch.core.common.bytes.BytesReference import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformIndexer.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformIndexer.kt index 8f5805f0f..904c6c6cd 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformIndexer.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformIndexer.kt @@ -24,7 +24,7 @@ import org.opensearch.indexmanagement.opensearchapi.suspendUntil import org.opensearch.indexmanagement.transform.exceptions.TransformIndexException import org.opensearch.indexmanagement.transform.settings.TransformSettings import org.opensearch.indexmanagement.transform.util.TransformContext -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.transport.RemoteTransportException @Suppress("ComplexMethod") diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformRunner.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformRunner.kt index 0cf658a29..799b49e39 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformRunner.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformRunner.kt @@ -17,7 +17,7 @@ import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.Settings import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.index.shard.ShardId +import org.opensearch.core.index.shard.ShardId import org.opensearch.indexmanagement.opensearchapi.IndexManagementSecurityContext import org.opensearch.indexmanagement.opensearchapi.suspendUntil import org.opensearch.indexmanagement.opensearchapi.withClosableContext diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformSearchService.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformSearchService.kt index 6afa93637..e341cba60 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformSearchService.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformSearchService.kt @@ -22,14 +22,14 @@ import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.XContentType -import org.opensearch.index.Index +import org.opensearch.core.index.Index import org.opensearch.index.query.BoolQueryBuilder import org.opensearch.index.query.ExistsQueryBuilder import org.opensearch.index.query.QueryBuilder import org.opensearch.index.query.QueryBuilders import org.opensearch.index.query.RangeQueryBuilder import org.opensearch.index.seqno.SequenceNumbers -import org.opensearch.index.shard.ShardId +import org.opensearch.core.index.shard.ShardId import org.opensearch.indexmanagement.common.model.dimension.Dimension import org.opensearch.indexmanagement.opensearchapi.retry import org.opensearch.indexmanagement.opensearchapi.suspendUntil @@ -46,7 +46,7 @@ import org.opensearch.indexmanagement.transform.util.TransformContext import org.opensearch.indexmanagement.util.IndexUtils.Companion.LUCENE_MAX_CLAUSES import org.opensearch.indexmanagement.util.IndexUtils.Companion.ODFE_MAGIC_NULL import org.opensearch.indexmanagement.util.IndexUtils.Companion.hashToFixedSize -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.aggregations.Aggregation import org.opensearch.search.aggregations.bucket.composite.CompositeAggregation import org.opensearch.search.aggregations.bucket.composite.CompositeAggregationBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/DeleteTransformsRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/DeleteTransformsRequest.kt index 8688ba7fb..9f28d15cc 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/DeleteTransformsRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/DeleteTransformsRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.transform.action.delete import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions.addValidationError -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 class DeleteTransformsRequest( diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/TransportDeleteTransformsAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/TransportDeleteTransformsAction.kt index e36733934..141cae5d3 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/TransportDeleteTransformsAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/TransportDeleteTransformsAction.kt @@ -29,7 +29,7 @@ import org.opensearch.indexmanagement.settings.IndexManagementSettings import org.opensearch.indexmanagement.transform.model.Transform import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformRequest.kt index a387eec36..7ad468f46 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.transform.action.explain import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions.addValidationError -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 class ExplainTransformRequest(val transformIDs: List) : ActionRequest() { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformResponse.kt index 38bf8bcd9..240e74eb1 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.transform.action.explain import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/TransportExplainTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/TransportExplainTransformAction.kt index 352863ab9..e12202269 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/TransportExplainTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/TransportExplainTransformAction.kt @@ -18,7 +18,7 @@ import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService -import org.opensearch.common.bytes.BytesReference +import org.opensearch.core.common.bytes.BytesReference import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformRequest.kt index b01579c64..80b7f2157 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.transform.action.get import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions -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.search.fetch.subphase.FetchSourceContext import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformResponse.kt index de34d214a..a3c3b3bf3 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.transform.action.get import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder @@ -18,7 +18,7 @@ import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO import org.opensearch.indexmanagement.util._VERSION -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.io.IOException class GetTransformResponse( diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsRequest.kt index 518ff010a..cfdaa8375 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.indexmanagement.transform.action.get import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -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.indexmanagement.transform.model.Transform import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsResponse.kt index cbd90b24b..e75f8361d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.transform.action.get import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder @@ -17,7 +17,7 @@ import org.opensearch.indexmanagement.transform.model.Transform.Companion.TRANSF import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.io.IOException class GetTransformsResponse( diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformAction.kt index bc4e6dcac..eecaefda5 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformAction.kt @@ -25,7 +25,7 @@ import org.opensearch.indexmanagement.settings.IndexManagementSettings import org.opensearch.indexmanagement.transform.model.Transform import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformsAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformsAction.kt index 12ee32ac2..124d7b363 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformsAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformsAction.kt @@ -12,7 +12,7 @@ import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService -import org.opensearch.common.bytes.BytesReference +import org.opensearch.core.common.bytes.BytesReference import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformRequest.kt index bd10f1e03..d0e26dc95 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformRequest.kt @@ -10,8 +10,8 @@ import org.opensearch.action.DocWriteRequest import org.opensearch.action.ValidateActions.addValidationError import org.opensearch.action.index.IndexRequest import org.opensearch.action.support.WriteRequest -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.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.transform.model.Transform import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformResponse.kt index d3786720e..fd43fdf4e 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformResponse.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.transform.action.index import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder @@ -18,7 +18,7 @@ import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO import org.opensearch.indexmanagement.util._VERSION -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.io.IOException class IndexTransformResponse( diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/TransportIndexTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/TransportIndexTransformAction.kt index 28b1c293a..5b3282529 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/TransportIndexTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/TransportIndexTransformAction.kt @@ -40,7 +40,7 @@ import org.opensearch.indexmanagement.util.IndexUtils import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource import org.opensearch.indexmanagement.util.SecurityUtils.Companion.validateUserConfiguration -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformRequest.kt index 9a2facaf7..1c65421e4 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformRequest.kt @@ -7,8 +7,8 @@ package org.opensearch.indexmanagement.transform.action.preview import org.opensearch.action.ActionRequest import org.opensearch.action.ActionRequestValidationException -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.indexmanagement.transform.model.Transform import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformResponse.kt index 47a4589c9..8d1378510 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformResponse.kt @@ -6,12 +6,12 @@ package org.opensearch.indexmanagement.transform.action.preview import org.opensearch.action.ActionResponse -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus class PreviewTransformResponse( val documents: List>, diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/TransportPreviewTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/TransportPreviewTransformAction.kt index aef1859bd..06724e950 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/TransportPreviewTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/TransportPreviewTransformAction.kt @@ -34,7 +34,7 @@ import org.opensearch.indexmanagement.transform.TransformSearchService import org.opensearch.indexmanagement.transform.TransformValidator import org.opensearch.indexmanagement.transform.model.Transform import org.opensearch.indexmanagement.util.SecurityUtils -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/StartTransformRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/StartTransformRequest.kt index 30c277ae1..528b564a2 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/StartTransformRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/StartTransformRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.transform.action.start import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions.addValidationError import org.opensearch.action.update.UpdateRequest -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 class StartTransformRequest : UpdateRequest { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/TransportStartTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/TransportStartTransformAction.kt index 5c98f220e..8e92798a8 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/TransportStartTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/TransportStartTransformAction.kt @@ -34,7 +34,7 @@ import org.opensearch.indexmanagement.transform.model.Transform import org.opensearch.indexmanagement.transform.model.TransformMetadata import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/StopTransformRequest.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/StopTransformRequest.kt index 45dbb8946..85295560d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/StopTransformRequest.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/StopTransformRequest.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.transform.action.stop import org.opensearch.action.ActionRequestValidationException import org.opensearch.action.ValidateActions.addValidationError import org.opensearch.action.update.UpdateRequest -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 class StopTransformRequest : UpdateRequest { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/TransportStopTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/TransportStopTransformAction.kt index 350ef1d27..8be4b831f 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/TransportStopTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/TransportStopTransformAction.kt @@ -35,7 +35,7 @@ import org.opensearch.indexmanagement.transform.model.Transform import org.opensearch.indexmanagement.transform.model.TransformMetadata import org.opensearch.indexmanagement.util.SecurityUtils.Companion.buildUser import org.opensearch.indexmanagement.util.SecurityUtils.Companion.userHasPermissionForResource -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.Task import org.opensearch.transport.TransportService import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ContinuousTransformStats.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ContinuousTransformStats.kt index 85b84cc7a..884a9eca5 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ContinuousTransformStats.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ContinuousTransformStats.kt @@ -5,14 +5,14 @@ package org.opensearch.indexmanagement.transform.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.indexmanagement.opensearchapi.instant import java.io.IOException import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ExplainTransform.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ExplainTransform.kt index 94965d223..ad52a21b1 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ExplainTransform.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ExplainTransform.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.transform.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt index 38925d65d..ce6e50401 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/Transform.kt @@ -9,24 +9,24 @@ import org.opensearch.action.admin.indices.stats.IndicesStatsAction import org.opensearch.action.admin.indices.stats.IndicesStatsRequest import org.opensearch.action.admin.indices.stats.IndicesStatsResponse import org.opensearch.client.Client -import org.opensearch.common.bytes.BytesReference -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.bytes.BytesReference +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.common.xcontent.LoggingDeprecationHandler import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.common.xcontent.XContentFactory import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.authuser.User import org.opensearch.index.query.AbstractQueryBuilder import org.opensearch.index.query.MatchAllQueryBuilder import org.opensearch.index.query.QueryBuilder import org.opensearch.index.seqno.SequenceNumbers -import org.opensearch.index.shard.ShardId +import org.opensearch.core.index.shard.ShardId import org.opensearch.indexmanagement.common.model.dimension.DateHistogram import org.opensearch.indexmanagement.common.model.dimension.Dimension import org.opensearch.indexmanagement.common.model.dimension.Histogram @@ -45,7 +45,7 @@ import org.opensearch.jobscheduler.spi.schedule.CronSchedule import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule import org.opensearch.jobscheduler.spi.schedule.Schedule import org.opensearch.jobscheduler.spi.schedule.ScheduleParser -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.aggregations.AggregatorFactories import java.io.IOException import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformMetadata.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformMetadata.kt index c136246d2..a45505878 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformMetadata.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformMetadata.kt @@ -5,16 +5,16 @@ package org.opensearch.indexmanagement.transform.model -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.index.shard.ShardId import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.index.seqno.SequenceNumbers -import org.opensearch.index.shard.ShardId import org.opensearch.indexmanagement.indexstatemanagement.util.WITH_TYPE import org.opensearch.indexmanagement.opensearchapi.instant import org.opensearch.indexmanagement.opensearchapi.optionalTimeField diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformSearchResult.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformSearchResult.kt index a920bccd5..0b833965a 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformSearchResult.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformSearchResult.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.transform.model import org.opensearch.action.index.IndexRequest -import org.opensearch.index.shard.ShardId +import org.opensearch.core.index.shard.ShardId data class TransformSearchResult(val stats: TransformStats, val docsToIndex: List, val afterKey: Map? = null) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformStats.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformStats.kt index 98a055dbd..3b68a61b4 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformStats.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/TransformStats.kt @@ -5,14 +5,14 @@ package org.opensearch.indexmanagement.transform.model -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.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import java.io.IOException data class TransformStats( diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/OpenSearchExtensions.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/OpenSearchExtensions.kt index 3df66f16f..da6840acf 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/OpenSearchExtensions.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/OpenSearchExtensions.kt @@ -12,7 +12,7 @@ import org.opensearch.action.bulk.BackoffPolicy import org.opensearch.common.unit.TimeValue import org.opensearch.indexmanagement.opensearchapi.isRetryable import org.opensearch.indexmanagement.transform.util.TransformLockManager -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.TaskCancelledException import java.util.regex.Pattern diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestIndexTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestIndexTransformAction.kt index d3ef6dc76..d68061809 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestIndexTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestIndexTransformAction.kt @@ -27,7 +27,7 @@ import org.opensearch.rest.RestHandler import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.PUT import org.opensearch.rest.RestResponse -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.rest.action.RestResponseListener import java.io.IOException import java.time.Instant diff --git a/src/main/kotlin/org/opensearch/indexmanagement/util/IndexManagementException.kt b/src/main/kotlin/org/opensearch/indexmanagement/util/IndexManagementException.kt index c6b6b08a2..9242c71a9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/util/IndexManagementException.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/util/IndexManagementException.kt @@ -10,7 +10,7 @@ import org.opensearch.OpenSearchStatusException import org.opensearch.core.common.Strings import org.opensearch.common.ValidationException import org.opensearch.index.IndexNotFoundException -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.lang.IllegalArgumentException class IndexManagementException(message: String, val status: RestStatus, ex: Exception) : OpenSearchException(message, ex) { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/util/ScheduledJobUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/util/ScheduledJobUtils.kt index 59d6fc317..0a637c7b5 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/util/ScheduledJobUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/util/ScheduledJobUtils.kt @@ -12,7 +12,7 @@ import org.opensearch.action.ActionResponse import org.opensearch.action.search.SearchRequest import org.opensearch.action.search.SearchResponse import org.opensearch.client.Client -import org.opensearch.common.bytes.BytesReference +import org.opensearch.core.common.bytes.BytesReference import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.common.xcontent.XContentHelper @@ -24,7 +24,7 @@ import org.opensearch.indexmanagement.rollup.action.get.GetRollupsResponse import org.opensearch.indexmanagement.rollup.model.Rollup import org.opensearch.indexmanagement.transform.action.get.GetTransformsResponse import org.opensearch.indexmanagement.transform.model.Transform -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder fun getJobs( diff --git a/src/main/kotlin/org/opensearch/indexmanagement/util/SecurityUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/util/SecurityUtils.kt index 65a0903e6..9aa18dbd3 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/util/SecurityUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/util/SecurityUtils.kt @@ -13,7 +13,7 @@ import org.opensearch.commons.authuser.User import org.opensearch.index.query.BoolQueryBuilder import org.opensearch.index.query.ExistsQueryBuilder import org.opensearch.index.query.TermsQueryBuilder -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus @Suppress("ReturnCount", "UtilityClassWithPublicConstructor") class SecurityUtils { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementIndicesIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementIndicesIT.kt index 56a0cc0b8..78b3a7bef 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementIndicesIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementIndicesIT.kt @@ -32,7 +32,7 @@ import org.opensearch.indexmanagement.opensearchapi.string import org.opensearch.indexmanagement.refreshanalyzer.RestRefreshSearchAnalyzerAction import org.opensearch.indexmanagement.rollup.randomRollup import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import java.util.Locale diff --git a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt index d1fcf42cf..152338487 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt @@ -24,7 +24,7 @@ import org.opensearch.core.xcontent.DeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.common.xcontent.XContentType import org.opensearch.indexmanagement.indexstatemanagement.util.INDEX_HIDDEN -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.io.IOException import java.nio.file.Files import java.util.* diff --git a/src/test/kotlin/org/opensearch/indexmanagement/IndexStateManagementSecurityBehaviorIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/IndexStateManagementSecurityBehaviorIT.kt index 7966222c6..7e4d58f20 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/IndexStateManagementSecurityBehaviorIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/IndexStateManagementSecurityBehaviorIT.kt @@ -33,7 +33,7 @@ import org.opensearch.indexmanagement.rollup.model.metric.Max import org.opensearch.indexmanagement.rollup.model.metric.Min import org.opensearch.indexmanagement.rollup.model.metric.Sum import org.opensearch.indexmanagement.rollup.model.metric.ValueCount -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging import java.time.Instant import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/PolicySecurityBehaviorIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/PolicySecurityBehaviorIT.kt index 5af30a616..9f898ff12 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/PolicySecurityBehaviorIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/PolicySecurityBehaviorIT.kt @@ -23,7 +23,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.model.Policy import org.opensearch.indexmanagement.indexstatemanagement.model.State import org.opensearch.indexmanagement.indexstatemanagement.randomErrorNotification import org.opensearch.indexmanagement.indexstatemanagement.transport.action.addpolicy.AddPolicyAction -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import org.opensearch.test.junit.annotations.TestLogging import java.time.Instant diff --git a/src/test/kotlin/org/opensearch/indexmanagement/RollupSecurityBehaviorIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/RollupSecurityBehaviorIT.kt index a34930c90..503df5495 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/RollupSecurityBehaviorIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/RollupSecurityBehaviorIT.kt @@ -27,7 +27,7 @@ import org.opensearch.indexmanagement.rollup.model.metric.Sum import org.opensearch.indexmanagement.rollup.model.metric.ValueCount import org.opensearch.indexmanagement.rollup.randomRollup import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging import java.time.Instant import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/SecurityBehaviorIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/SecurityBehaviorIT.kt index e7678745c..29e77dcd8 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/SecurityBehaviorIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/SecurityBehaviorIT.kt @@ -16,7 +16,7 @@ import org.junit.Before import org.opensearch.client.RestClient import org.opensearch.commons.rest.SecureRestClientBuilder import org.opensearch.indexmanagement.indexstatemanagement.settings.ManagedIndexSettings -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging @TestLogging("level:DEBUG", reason = "Debug for tests.") diff --git a/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt index 4f6b67d74..208722eba 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt @@ -39,7 +39,7 @@ import org.opensearch.indexmanagement.transform.TransformRestTestCase import org.opensearch.indexmanagement.transform.model.Transform import org.opensearch.indexmanagement.transform.toJsonString import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import java.util.Locale diff --git a/src/test/kotlin/org/opensearch/indexmanagement/TransformSecurityBehaviorIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/TransformSecurityBehaviorIT.kt index 071ece9c9..1545b68e3 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/TransformSecurityBehaviorIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/TransformSecurityBehaviorIT.kt @@ -21,7 +21,7 @@ import org.opensearch.indexmanagement.transform.model.Transform import org.opensearch.indexmanagement.transform.model.TransformMetadata import org.opensearch.indexmanagement.transform.randomTransform import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging import java.time.Instant import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/bwc/IndexManagementBackwardsCompatibilityIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/bwc/IndexManagementBackwardsCompatibilityIT.kt index 099fb5dc2..b50039485 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/bwc/IndexManagementBackwardsCompatibilityIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/bwc/IndexManagementBackwardsCompatibilityIT.kt @@ -18,7 +18,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.util.XCONTENT_WITHOUT import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.opensearchapi.string import org.opensearch.indexmanagement.util.NO_ID -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.builder.SearchSourceBuilder class IndexManagementBackwardsCompatibilityIT : IndexManagementRestTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigSecurityBehaviorIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigSecurityBehaviorIT.kt index 83ea7a0c2..bed2e0b9f 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigSecurityBehaviorIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigSecurityBehaviorIT.kt @@ -15,7 +15,7 @@ import org.opensearch.indexmanagement.GET_LRON_CONFIG import org.opensearch.indexmanagement.INDEX_LRON_CONFIG import org.opensearch.indexmanagement.IndexManagementPlugin import org.opensearch.indexmanagement.SecurityRestTestCase -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus @Suppress("UNCHECKED_CAST") class LRONConfigSecurityBehaviorIT : SecurityRestTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListenerIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListenerIT.kt index 0f4b9f20c..0200da8ec 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListenerIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListenerIT.kt @@ -23,7 +23,7 @@ import org.opensearch.indexmanagement.IndexManagementRestTestCase import org.opensearch.indexmanagement.controlcenter.notification.util.supportedActions import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.waitFor -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.net.InetAddress import java.net.InetSocketAddress import java.time.Instant diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ForceMergeIndexRespParserTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ForceMergeIndexRespParserTests.kt index 68fa16488..89b61d16a 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ForceMergeIndexRespParserTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ForceMergeIndexRespParserTests.kt @@ -9,12 +9,12 @@ import org.junit.Assert import org.opensearch.OpenSearchException import org.opensearch.action.admin.indices.forcemerge.ForceMergeRequest import org.opensearch.action.admin.indices.forcemerge.ForceMergeResponse -import org.opensearch.action.support.DefaultShardOperationFailedException +import org.opensearch.core.action.support.DefaultShardOperationFailedException import org.opensearch.action.support.broadcast.BroadcastResponse import org.opensearch.common.xcontent.XContentType import org.opensearch.core.xcontent.DeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.index.Index +import org.opensearch.core.index.Index import org.opensearch.indexmanagement.controlcenter.notification.filter.OperationResult import org.opensearch.indexmanagement.snapshotmanagement.toJsonString diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/OpenRespParserTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/OpenRespParserTests.kt index 68908ac04..85e312f3e 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/OpenRespParserTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/OpenRespParserTests.kt @@ -18,7 +18,7 @@ import org.opensearch.action.support.ActiveShardCount import org.opensearch.action.support.ActiveShardsObserver import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.common.unit.TimeValue -import org.opensearch.index.Index +import org.opensearch.core.index.Index import org.opensearch.indexmanagement.controlcenter.notification.filter.OperationResult import kotlin.Exception diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParserTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParserTests.kt index 44c446680..9a834448b 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParserTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParserTests.kt @@ -10,7 +10,7 @@ import org.junit.Before import org.opensearch.OpenSearchException import org.opensearch.action.bulk.BulkItemResponse import org.opensearch.common.unit.TimeValue -import org.opensearch.index.Index +import org.opensearch.core.index.Index import org.opensearch.index.reindex.BulkByScrollResponse import org.opensearch.index.reindex.BulkByScrollTask import org.opensearch.index.reindex.ReindexAction diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ResizeIndexRespParserTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ResizeIndexRespParserTests.kt index 2b107d7d8..4456c695d 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ResizeIndexRespParserTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ResizeIndexRespParserTests.kt @@ -19,7 +19,7 @@ import org.opensearch.action.admin.indices.shrink.ResizeType import org.opensearch.action.support.ActiveShardCount import org.opensearch.action.support.ActiveShardsObserver import org.opensearch.common.unit.TimeValue -import org.opensearch.index.Index +import org.opensearch.core.index.Index import org.opensearch.index.IndexNotFoundException import org.opensearch.indexmanagement.controlcenter.notification.filter.OperationResult import java.lang.IllegalStateException diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/LRONConfigRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/LRONConfigRestTestCase.kt index 8c5294051..65c18c517 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/LRONConfigRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/LRONConfigRestTestCase.kt @@ -19,7 +19,7 @@ import org.opensearch.indexmanagement.controlcenter.notification.initNodeIdsInRe import org.opensearch.indexmanagement.controlcenter.notification.model.LRONConfig import org.opensearch.indexmanagement.controlcenter.notification.toJsonString import org.opensearch.indexmanagement.makeRequest -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus abstract class LRONConfigRestTestCase : IndexManagementRestTestCase() { @Before diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestDeleteLRONConfigActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestDeleteLRONConfigActionIT.kt index 82e6d9ebd..e603ea886 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestDeleteLRONConfigActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestDeleteLRONConfigActionIT.kt @@ -13,7 +13,7 @@ import org.opensearch.indexmanagement.controlcenter.notification.randomLRONConfi import org.opensearch.indexmanagement.controlcenter.notification.randomTaskId import org.opensearch.indexmanagement.controlcenter.notification.util.getDocID import org.opensearch.indexmanagement.makeRequest -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus @Suppress("UNCHECKED_CAST") class RestDeleteLRONConfigActionIT : LRONConfigRestTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestGetLRONConfigActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestGetLRONConfigActionIT.kt index f9dbef7d9..c2193a7b9 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestGetLRONConfigActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestGetLRONConfigActionIT.kt @@ -16,7 +16,7 @@ import org.opensearch.indexmanagement.controlcenter.notification.randomTaskId import org.opensearch.indexmanagement.controlcenter.notification.util.getDocID import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.opensearchapi.convertToMap -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase @Suppress("UNCHECKED_CAST") diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestIndexLRONConfigActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestIndexLRONConfigActionIT.kt index e2d1f0b24..00ecd594a 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestIndexLRONConfigActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/resthandler/RestIndexLRONConfigActionIT.kt @@ -24,7 +24,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.randomChannel import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.opensearchapi.convertToMap import org.opensearch.indexmanagement.util.DRY_RUN -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.util.concurrent.Executors @Suppress("UNCHECKED_CAST") diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt index 03d7940e2..dcfbe5aa1 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt @@ -27,7 +27,7 @@ import org.opensearch.core.xcontent.DeprecationHandler import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.common.xcontent.XContentType import org.opensearch.common.xcontent.json.JsonXContent.jsonXContent import org.opensearch.index.seqno.SequenceNumbers @@ -69,8 +69,8 @@ import org.opensearch.indexmanagement.util._SEQ_NO import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus import org.opensearch.search.SearchModule +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import java.io.IOException import java.time.Duration diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt index 4c2822601..85cfc0c55 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt @@ -26,7 +26,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.Step import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionRetry import org.opensearch.indexmanagement.waitFor import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import java.time.Instant import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionIT.kt index 3e2be695c..5976653dc 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionIT.kt @@ -29,7 +29,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.step.shrink.WaitForSh import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.spi.indexstatemanagement.Step import org.opensearch.indexmanagement.waitFor -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.script.Script import org.opensearch.script.ScriptType import java.time.Instant diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/extension/SampleCustomActionParser.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/extension/SampleCustomActionParser.kt index d74f36ad8..64b80ad31 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/extension/SampleCustomActionParser.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/extension/SampleCustomActionParser.kt @@ -5,12 +5,12 @@ package org.opensearch.indexmanagement.indexstatemanagement.extension -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.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser import org.opensearch.indexmanagement.spi.indexstatemanagement.Step diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ActionTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ActionTests.kt index a4c719537..b9abee69a 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ActionTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ActionTests.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.model import org.opensearch.cluster.routing.allocation.DiskThresholdSettings -import org.opensearch.common.io.stream.InputStreamStreamInput -import org.opensearch.common.io.stream.OutputStreamStreamOutput +import org.opensearch.core.common.io.stream.InputStreamStreamInput +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput import org.opensearch.common.settings.ClusterSettings import org.opensearch.common.settings.Settings import org.opensearch.common.unit.ByteSizeValue diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ISMTemplateTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ISMTemplateTests.kt index 1f7a750ee..faf200a9a 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ISMTemplateTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ISMTemplateTests.kt @@ -5,8 +5,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.model -import org.opensearch.common.io.stream.InputStreamStreamInput -import org.opensearch.common.io.stream.OutputStreamStreamOutput +import org.opensearch.core.common.io.stream.InputStreamStreamInput +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput import org.opensearch.indexmanagement.indexstatemanagement.randomISMTemplate import org.opensearch.test.OpenSearchTestCase import java.io.ByteArrayInputStream diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ManagedIndexMetaDataTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ManagedIndexMetaDataTests.kt index e16f91319..dc1810219 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ManagedIndexMetaDataTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ManagedIndexMetaDataTests.kt @@ -5,8 +5,8 @@ package org.opensearch.indexmanagement.indexstatemanagement.model -import org.opensearch.common.io.stream.InputStreamStreamInput -import org.opensearch.common.io.stream.OutputStreamStreamOutput +import org.opensearch.core.common.io.stream.InputStreamStreamInput +import org.opensearch.core.common.io.stream.OutputStreamStreamOutput import org.opensearch.indexmanagement.spi.indexstatemanagement.Step import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionMetaData import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionProperties diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/ISMTemplateRestAPIIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/ISMTemplateRestAPIIT.kt index e7e804944..63af39f5b 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/ISMTemplateRestAPIIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/ISMTemplateRestAPIIT.kt @@ -18,7 +18,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.util.INDEX_HIDDEN import org.opensearch.indexmanagement.randomInstant import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData import org.opensearch.indexmanagement.waitFor -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant import java.time.temporal.ChronoUnit import java.util.Locale diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/IndexStateManagementRestApiIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/IndexStateManagementRestApiIT.kt index 600a53262..99b43048b 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/IndexStateManagementRestApiIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/IndexStateManagementRestApiIT.kt @@ -27,7 +27,7 @@ import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import org.opensearch.test.junit.annotations.TestLogging diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestAddPolicyActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestAddPolicyActionIT.kt index 68ec19936..e863bb097 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestAddPolicyActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestAddPolicyActionIT.kt @@ -20,7 +20,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.util.UPDATED_INDICES import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.waitFor import org.opensearch.rest.RestRequest.Method.POST -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus class RestAddPolicyActionIT : IndexStateManagementRestTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestChangePolicyActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestChangePolicyActionIT.kt index e225d559b..17f96cda6 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestChangePolicyActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestChangePolicyActionIT.kt @@ -33,7 +33,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedInde import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StateMetaData import org.opensearch.indexmanagement.waitFor import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant import java.util.Locale diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestExplainActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestExplainActionIT.kt index 586a86c60..7138a903a 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestExplainActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestExplainActionIT.kt @@ -19,7 +19,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.model.PolicyRetry import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StateMetaData import org.opensearch.indexmanagement.waitFor import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant import java.util.Locale diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRemovePolicyActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRemovePolicyActionIT.kt index 188d02d4e..4449049e3 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRemovePolicyActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRemovePolicyActionIT.kt @@ -15,7 +15,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.util.UPDATED_INDICES import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.waitFor import org.opensearch.rest.RestRequest.Method.POST -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus class RestRemovePolicyActionIT : IndexStateManagementRestTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRetryFailedManagedIndexActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRetryFailedManagedIndexActionIT.kt index c1b385030..0cf0e97cf 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRetryFailedManagedIndexActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRetryFailedManagedIndexActionIT.kt @@ -21,7 +21,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionRetry import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData import org.opensearch.indexmanagement.waitFor import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant import java.util.Locale diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSnapshotStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSnapshotStepTests.kt index 74d07b449..aa7292d16 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSnapshotStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSnapshotStepTests.kt @@ -31,7 +31,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedInde import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepContext import org.opensearch.ingest.TestTemplateService.MockTemplateScript import org.opensearch.jobscheduler.spi.utils.LockService -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.script.ScriptService import org.opensearch.script.TemplateScript import org.opensearch.snapshots.ConcurrentSnapshotExecutionException diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptTransitionStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptTransitionStepTests.kt index 3f3114f10..223e20912 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptTransitionStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptTransitionStepTests.kt @@ -37,7 +37,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedInde import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepContext import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepMetaData import org.opensearch.jobscheduler.spi.utils.LockService -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.script.ScriptService import org.opensearch.test.OpenSearchTestCase import org.opensearch.transport.RemoteTransportException diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponseTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponseTests.kt index 1ee5c5b9b..480d734c9 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponseTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponseTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.indexstatemanagement.util.FailedIndex import org.opensearch.test.OpenSearchTestCase diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/AddPolicyRequestTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/AddPolicyRequestTests.kt index 704fef4b5..bdbf69819 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/AddPolicyRequestTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/AddPolicyRequestTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.addpolicy import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.indexstatemanagement.util.DEFAULT_INDEX_TYPE import org.opensearch.test.OpenSearchTestCase diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequestTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequestTests.kt index ac49b2432..e77141197 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequestTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/ChangePolicyRequestTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.changepolicy import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.indexstatemanagement.model.ChangePolicy import org.opensearch.indexmanagement.indexstatemanagement.model.StateFilter import org.opensearch.indexmanagement.indexstatemanagement.util.DEFAULT_INDEX_TYPE diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/DeletePolicyRequestTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/DeletePolicyRequestTests.kt index a5730cb7e..ce6488a4a 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/DeletePolicyRequestTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/DeletePolicyRequestTests.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.del import org.opensearch.action.support.WriteRequest import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.test.OpenSearchTestCase class DeletePolicyRequestTests : OpenSearchTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainRequestTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainRequestTests.kt index 34c694eeb..0c8d0e01e 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainRequestTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainRequestTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.explain import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.common.unit.TimeValue import org.opensearch.indexmanagement.common.model.rest.SearchParams import org.opensearch.indexmanagement.indexstatemanagement.util.DEFAULT_INDEX_TYPE diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponseTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponseTests.kt index 680b04009..bbab164f3 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponseTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponseTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.explain import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.indexstatemanagement.randomPolicy import org.opensearch.indexmanagement.spi.indexstatemanagement.Validate import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesRequestTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesRequestTests.kt index bac8580dc..84a2c78dc 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesRequestTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesRequestTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.getpolicy import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.common.model.rest.SearchParams import org.opensearch.test.OpenSearchTestCase diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponseTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponseTests.kt index 1606ca2d6..939774f07 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponseTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponseTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.getpolicy import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.ToXContent import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyRequestTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyRequestTests.kt index f8d5b300d..a05e45145 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyRequestTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyRequestTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.getpolicy import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.search.fetch.subphase.FetchSourceContext import org.opensearch.test.OpenSearchTestCase diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponseTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponseTests.kt index 7acf7fe88..b84b9150c 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponseTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponseTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.getpolicy import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.ToXContent import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyRequestTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyRequestTests.kt index 5ec01105e..3cc77a0ad 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyRequestTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyRequestTests.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.ind import org.opensearch.action.support.WriteRequest import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.indexstatemanagement.ISMActionsParser import org.opensearch.indexmanagement.indexstatemanagement.action.AllocationAction import org.opensearch.indexmanagement.indexstatemanagement.action.DeleteAction diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponseTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponseTests.kt index 23acd426a..7e68b0a0c 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponseTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponseTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.indexpolicy import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.ToXContent import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper @@ -19,7 +19,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.model.State import org.opensearch.indexmanagement.indexstatemanagement.randomErrorNotification import org.opensearch.indexmanagement.opensearchapi.convertToMap import org.opensearch.indexmanagement.opensearchapi.string -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import java.time.Instant import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/RemovePolicyRequestTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/RemovePolicyRequestTests.kt index 1631066f1..2386c010b 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/RemovePolicyRequestTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/RemovePolicyRequestTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.removepolicy import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.indexstatemanagement.util.DEFAULT_INDEX_TYPE import org.opensearch.test.OpenSearchTestCase diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/RetryFailedManagedIndexRequestTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/RetryFailedManagedIndexRequestTests.kt index cdb297959..6cf699be6 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/RetryFailedManagedIndexRequestTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/RetryFailedManagedIndexRequestTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.retryfailedmanagedindex import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.common.unit.TimeValue import org.opensearch.indexmanagement.indexstatemanagement.util.DEFAULT_INDEX_TYPE import org.opensearch.test.OpenSearchTestCase diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtilsTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtilsTests.kt index e24a8bb33..8f8c96acc 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtilsTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtilsTests.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.util -import org.opensearch.common.bytes.BytesReference +import org.opensearch.core.common.bytes.BytesReference import org.opensearch.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverIT.kt index f1b20c14f..98c71ee52 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverIT.kt @@ -18,7 +18,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.Validate import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionRetry import org.opensearch.indexmanagement.waitFor import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant import java.time.temporal.ChronoUnit import java.util.Locale diff --git a/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerResponseTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerResponseTests.kt index 079cf6cd2..bfa880a5f 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerResponseTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerResponseTests.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.refreshanalyzer import org.junit.Assert -import org.opensearch.action.support.DefaultShardOperationFailedException -import org.opensearch.index.shard.ShardId +import org.opensearch.core.action.support.DefaultShardOperationFailedException +import org.opensearch.core.index.shard.ShardId import org.opensearch.test.OpenSearchTestCase class RefreshSearchAnalyzerResponseTests : OpenSearchTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerShardResponseTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerShardResponseTests.kt index 45a3e014e..9c58fad81 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerShardResponseTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RefreshSearchAnalyzerShardResponseTests.kt @@ -7,8 +7,8 @@ package org.opensearch.indexmanagement.refreshanalyzer import org.junit.Assert import org.opensearch.common.io.stream.BytesStreamOutput -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.test.OpenSearchTestCase class RefreshSearchAnalyzerShardResponseTests : OpenSearchTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RestRefreshSearchAnalyzerActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RestRefreshSearchAnalyzerActionIT.kt index f58ff4d43..f523b7c6c 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RestRefreshSearchAnalyzerActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/refreshanalyzer/RestRefreshSearchAnalyzerActionIT.kt @@ -12,7 +12,7 @@ import org.opensearch.indexmanagement.IndexManagementRestTestCase import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.refreshanalyzer.RestRefreshSearchAnalyzerAction.Companion.REFRESH_SEARCH_ANALYZER_BASE_URI import org.opensearch.rest.RestRequest.Method.POST -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus class RestRefreshSearchAnalyzerActionIT : IndexManagementRestTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMetadataServiceTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMetadataServiceTests.kt index 46e62057d..e4180a734 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMetadataServiceTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMetadataServiceTests.kt @@ -18,9 +18,9 @@ import org.opensearch.action.get.GetResponse import org.opensearch.action.index.IndexResponse import org.opensearch.action.search.SearchResponse import org.opensearch.client.Client -import org.opensearch.common.bytes.BytesArray -import org.opensearch.common.bytes.BytesReference +import org.opensearch.core.common.bytes.BytesReference import org.opensearch.common.document.DocumentField +import org.opensearch.core.common.bytes.BytesArray import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.ToXContent import org.opensearch.indexmanagement.common.model.dimension.DateHistogram diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupRestTestCase.kt index eeceb338e..9009ba775 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupRestTestCase.kt @@ -22,7 +22,7 @@ import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser.Token -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.common.xcontent.XContentType import org.opensearch.common.xcontent.json.JsonXContent import org.opensearch.index.seqno.SequenceNumbers @@ -39,7 +39,7 @@ import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import java.time.Duration import java.time.Instant diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/action/RequestTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/action/RequestTests.kt index adf4e3995..6389e6f91 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/action/RequestTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/action/RequestTests.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.rollup.action import org.opensearch.action.DocWriteRequest import org.opensearch.action.support.WriteRequest import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX import org.opensearch.indexmanagement.rollup.action.delete.DeleteRollupRequest diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/action/ResponseTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/action/ResponseTests.kt index bfa2a043d..19508dd28 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/action/ResponseTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/action/ResponseTests.kt @@ -6,14 +6,14 @@ package org.opensearch.indexmanagement.rollup.action import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.rollup.action.explain.ExplainRollupResponse import org.opensearch.indexmanagement.rollup.action.get.GetRollupResponse import org.opensearch.indexmanagement.rollup.action.get.GetRollupsResponse import org.opensearch.indexmanagement.rollup.action.index.IndexRollupResponse import org.opensearch.indexmanagement.rollup.randomExplainRollup import org.opensearch.indexmanagement.rollup.randomRollup -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase class ResponseTests : OpenSearchTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/FieldCapsFilterIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/FieldCapsFilterIT.kt index 7f0812ce6..3566c367d 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/FieldCapsFilterIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/FieldCapsFilterIT.kt @@ -10,7 +10,7 @@ import org.opensearch.common.settings.Settings import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.rollup.RollupRestTestCase import org.opensearch.indexmanagement.rollup.settings.RollupSettings -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus // TODO: Add assertions on fields @Suppress("UNCHECKED_CAST") diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptorIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptorIT.kt index 8af7a035b..9d38220cd 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptorIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptorIT.kt @@ -23,7 +23,7 @@ import org.opensearch.indexmanagement.rollup.model.metric.Sum import org.opensearch.indexmanagement.rollup.model.metric.ValueCount import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/model/WriteableTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/model/WriteableTests.kt index feb76c98f..216b16d6f 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/model/WriteableTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/model/WriteableTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.rollup.model import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.common.model.dimension.DateHistogram import org.opensearch.indexmanagement.common.model.dimension.Histogram import org.opensearch.indexmanagement.common.model.dimension.Terms diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestDeleteRollupActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestDeleteRollupActionIT.kt index 43fc6dca5..bcd1a5645 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestDeleteRollupActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestDeleteRollupActionIT.kt @@ -10,7 +10,7 @@ import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANA import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.ROLLUP_JOBS_BASE_URI import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.rollup.RollupRestTestCase -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging @TestLogging(value = "level:DEBUG", reason = "Debugging tests") diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestExplainRollupActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestExplainRollupActionIT.kt index d46b3a414..0f7fd50e9 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestExplainRollupActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestExplainRollupActionIT.kt @@ -13,7 +13,7 @@ import org.opensearch.indexmanagement.rollup.model.RollupMetadata import org.opensearch.indexmanagement.rollup.randomRollup import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging import java.time.Instant import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestGetRollupActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestGetRollupActionIT.kt index 6f9bf779d..ab421d90b 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestGetRollupActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestGetRollupActionIT.kt @@ -11,7 +11,7 @@ import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.rollup.RollupRestTestCase import org.opensearch.indexmanagement.rollup.action.get.GetRollupsRequest.Companion.DEFAULT_SIZE import org.opensearch.indexmanagement.rollup.randomRollup -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging @TestLogging(value = "level:DEBUG", reason = "Debugging tests") diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestIndexRollupActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestIndexRollupActionIT.kt index 9ac1b8af6..fdfd99f40 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestIndexRollupActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestIndexRollupActionIT.kt @@ -28,7 +28,7 @@ import org.opensearch.indexmanagement.rollup.randomRollupMetrics import org.opensearch.indexmanagement.util.NO_ID import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._SEQ_NO -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import org.opensearch.test.junit.annotations.TestLogging diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestStartRollupActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestStartRollupActionIT.kt index 1f9a32f3c..4f2dde8bf 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestStartRollupActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestStartRollupActionIT.kt @@ -20,7 +20,7 @@ import org.opensearch.indexmanagement.rollup.model.RollupMetadata import org.opensearch.indexmanagement.rollup.randomRollup import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestStopRollupActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestStopRollupActionIT.kt index 3a7c60256..a4d7a6d18 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestStopRollupActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestStopRollupActionIT.kt @@ -23,7 +23,7 @@ import org.opensearch.indexmanagement.rollup.model.RollupMetadata import org.opensearch.indexmanagement.rollup.randomRollup import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/runner/RollupRunnerIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/runner/RollupRunnerIT.kt index 168ea3a64..17028ccb7 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/runner/RollupRunnerIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/runner/RollupRunnerIT.kt @@ -30,7 +30,7 @@ import org.opensearch.indexmanagement.rollup.settings.RollupSettings.Companion.R import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule import org.opensearch.rest.RestRequest -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant import java.time.temporal.ChronoUnit import java.util.Collections.emptyMap diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunnerIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunnerIT.kt index e7a1f30ea..95a4a58d4 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunnerIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunnerIT.kt @@ -11,7 +11,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.model.SMMetadata import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.CronSchedule import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant.now import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SnapshotManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SnapshotManagementRestTestCase.kt index 7a1d075ab..2ee7ef61c 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SnapshotManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SnapshotManagementRestTestCase.kt @@ -15,7 +15,7 @@ import org.junit.Before import org.opensearch.client.Response import org.opensearch.client.ResponseException import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.common.xcontent.XContentType import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.IndexManagementPlugin @@ -29,7 +29,7 @@ import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.io.InputStream import java.time.Duration import java.time.Instant diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/TestUtils.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/TestUtils.kt index c9ecbf1eb..9b924c2b9 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/TestUtils.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/TestUtils.kt @@ -33,7 +33,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.model.SMMetadata import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy import org.opensearch.jobscheduler.spi.schedule.CronSchedule import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.snapshots.Snapshot import org.opensearch.snapshots.SnapshotId import org.opensearch.snapshots.SnapshotInfo diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/action/RequestTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/action/RequestTests.kt index 6c724c89d..e9cf78c09 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/action/RequestTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/action/RequestTests.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.snapshotmanagement.action import org.opensearch.action.DocWriteRequest import org.opensearch.action.support.WriteRequest import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX import org.opensearch.indexmanagement.common.model.rest.SearchParams diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/action/ResponseTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/action/ResponseTests.kt index 9ad7d8eeb..18987f768 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/action/ResponseTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/action/ResponseTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.snapshotmanagement.action import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.indexstatemanagement.util.XCONTENT_WITHOUT_TYPE_AND_USER import org.opensearch.indexmanagement.snapshotmanagement.api.transport.explain.ExplainSMPolicyResponse import org.opensearch.indexmanagement.snapshotmanagement.api.transport.get.GetSMPoliciesResponse @@ -17,7 +17,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.randomSMMetadata import org.opensearch.indexmanagement.snapshotmanagement.randomSMPolicy import org.opensearch.indexmanagement.snapshotmanagement.smDocIdToPolicyName import org.opensearch.indexmanagement.snapshotmanagement.toMap -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase class ResponseTests : OpenSearchTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/WriteableTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/WriteableTests.kt index fc9b9edf9..b197e4cdb 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/WriteableTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/WriteableTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.snapshotmanagement.model import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.snapshotmanagement.randomNotificationConfig import org.opensearch.indexmanagement.snapshotmanagement.randomSMMetadata import org.opensearch.indexmanagement.snapshotmanagement.randomSMPolicy diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestDeleteSnapshotManagementIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestDeleteSnapshotManagementIT.kt index 7bffd87a5..130e8bf4b 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestDeleteSnapshotManagementIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestDeleteSnapshotManagementIT.kt @@ -11,7 +11,7 @@ import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANA import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.snapshotmanagement.SnapshotManagementRestTestCase import org.opensearch.indexmanagement.snapshotmanagement.randomSMPolicy -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus class RestDeleteSnapshotManagementIT : SnapshotManagementRestTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestExplainSnapshotManagementIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestExplainSnapshotManagementIT.kt index 55ebb314b..ba31ad552 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestExplainSnapshotManagementIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestExplainSnapshotManagementIT.kt @@ -16,7 +16,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy import org.opensearch.indexmanagement.snapshotmanagement.randomSMPolicy import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant.now import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestGetSnapshotManagementIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestGetSnapshotManagementIT.kt index bed1a1da3..88cae159b 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestGetSnapshotManagementIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestGetSnapshotManagementIT.kt @@ -16,7 +16,7 @@ import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy.Companion.ENABLED_TIME_FIELD import org.opensearch.indexmanagement.snapshotmanagement.model.SMPolicy.Companion.SM_TYPE import org.opensearch.indexmanagement.snapshotmanagement.randomSMPolicy -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus class RestGetSnapshotManagementIT : SnapshotManagementRestTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestIndexSnapshotManagementIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestIndexSnapshotManagementIT.kt index 5c1b213d2..d260f5868 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestIndexSnapshotManagementIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestIndexSnapshotManagementIT.kt @@ -20,7 +20,7 @@ import org.opensearch.indexmanagement.util.IndexUtils import org.opensearch.indexmanagement.util.NO_ID import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._SEQ_NO -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant class RestIndexSnapshotManagementIT : SnapshotManagementRestTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStartSnapshotManagementIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStartSnapshotManagementIT.kt index de12a4db4..df58d309b 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStartSnapshotManagementIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStartSnapshotManagementIT.kt @@ -10,7 +10,7 @@ import org.opensearch.indexmanagement.IndexManagementPlugin import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.snapshotmanagement.SnapshotManagementRestTestCase import org.opensearch.indexmanagement.snapshotmanagement.randomSMPolicy -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant class RestStartSnapshotManagementIT : SnapshotManagementRestTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStopSnapshotManagementIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStopSnapshotManagementIT.kt index b1e38a0a8..e0711beb6 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStopSnapshotManagementIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStopSnapshotManagementIT.kt @@ -10,7 +10,7 @@ import org.opensearch.indexmanagement.IndexManagementPlugin import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.snapshotmanagement.SnapshotManagementRestTestCase import org.opensearch.indexmanagement.snapshotmanagement.randomSMPolicy -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import java.time.Instant class RestStopSnapshotManagementIT : SnapshotManagementRestTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/TestHelpers.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/TestHelpers.kt index c2658b5c5..415e44718 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/TestHelpers.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/TestHelpers.kt @@ -7,13 +7,13 @@ package org.opensearch.indexmanagement.transform import org.opensearch.cluster.metadata.IndexMetadata import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput -import org.opensearch.common.io.stream.NamedWriteableRegistry +import org.opensearch.core.common.io.stream.NamedWriteableAwareStreamInput +import org.opensearch.core.common.io.stream.NamedWriteableRegistry import org.opensearch.common.settings.Settings import org.opensearch.core.xcontent.ToXContent import org.opensearch.common.xcontent.XContentFactory -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.indexmanagement.common.model.dimension.Dimension import org.opensearch.indexmanagement.opensearchapi.string import org.opensearch.indexmanagement.randomInstant diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRestTestCase.kt index d082e7a3e..4d01e49b2 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRestTestCase.kt @@ -17,7 +17,7 @@ import org.opensearch.client.RestClient import org.opensearch.common.settings.Settings import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.common.xcontent.XContentType import org.opensearch.index.seqno.SequenceNumbers import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX @@ -32,7 +32,7 @@ import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.SearchModule import java.time.Duration import java.time.Instant diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRunnerIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRunnerIT.kt index b0870005b..e4c7daad1 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRunnerIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRunnerIT.kt @@ -21,7 +21,7 @@ import org.opensearch.indexmanagement.transform.model.TransformMetadata import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule import org.opensearch.rest.RestRequest -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.aggregations.AggregationBuilders diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/action/ResponseTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/action/ResponseTests.kt index a31358333..9605495ba 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/action/ResponseTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/action/ResponseTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.transform.action import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.transform.action.explain.ExplainTransformResponse import org.opensearch.indexmanagement.transform.action.get.GetTransformResponse import org.opensearch.indexmanagement.transform.action.get.GetTransformsResponse @@ -15,7 +15,7 @@ import org.opensearch.indexmanagement.transform.action.preview.PreviewTransformR import org.opensearch.indexmanagement.transform.buildStreamInputForTransforms import org.opensearch.indexmanagement.transform.randomExplainTransform import org.opensearch.indexmanagement.transform.randomTransform -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import org.opensearch.test.OpenSearchTestCase.randomList diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/model/WriteableTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/model/WriteableTests.kt index 5072bd126..06c3a6b71 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/model/WriteableTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/model/WriteableTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.transform.model import org.opensearch.common.io.stream.BytesStreamOutput -import org.opensearch.common.io.stream.StreamInput +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.transform.buildStreamInputForTransforms import org.opensearch.indexmanagement.transform.randomTransform import org.opensearch.indexmanagement.transform.randomTransformMetadata diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/ExtensionsTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/ExtensionsTests.kt index 5d0d251f7..0482c2c66 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/ExtensionsTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/ExtensionsTests.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.transform.opensearchapi import org.junit.Assert import org.opensearch.OpenSearchException import org.opensearch.indexmanagement.util.IndexManagementException -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.tasks.TaskCancelledException import org.opensearch.test.OpenSearchTestCase diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestDeleteTransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestDeleteTransformActionIT.kt index 2656904d9..93b5da251 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestDeleteTransformActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestDeleteTransformActionIT.kt @@ -11,7 +11,7 @@ import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.TRANSFORM_ import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.transform.TransformRestTestCase import org.opensearch.indexmanagement.transform.randomTransform -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging @TestLogging(value = "level:DEBUG", reason = "Debugging tests") diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestExplainTransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestExplainTransformActionIT.kt index e8e4019ab..badc26d7a 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestExplainTransformActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestExplainTransformActionIT.kt @@ -15,7 +15,7 @@ import org.opensearch.indexmanagement.transform.model.TransformMetadata import org.opensearch.indexmanagement.transform.randomTransform import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging import java.time.Instant import java.time.temporal.ChronoUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestGetTransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestGetTransformActionIT.kt index 0a679a343..63264d68c 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestGetTransformActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestGetTransformActionIT.kt @@ -12,7 +12,7 @@ import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.transform.TransformRestTestCase import org.opensearch.indexmanagement.transform.action.get.GetTransformsRequest.Companion.DEFAULT_SIZE import org.opensearch.indexmanagement.transform.randomTransform -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.OpenSearchTestCase import org.opensearch.test.junit.annotations.TestLogging diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestIndexTransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestIndexTransformActionIT.kt index d184f1c2c..df424ac86 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestIndexTransformActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestIndexTransformActionIT.kt @@ -13,7 +13,7 @@ import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.transform.TransformRestTestCase import org.opensearch.indexmanagement.transform.randomTransform import org.opensearch.indexmanagement.util.NO_ID -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.test.junit.annotations.TestLogging @TestLogging(value = "level:DEBUG", reason = "Debugging tests") diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestPreviewTransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestPreviewTransformActionIT.kt index d3239edaa..35272c75d 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestPreviewTransformActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestPreviewTransformActionIT.kt @@ -17,7 +17,7 @@ import org.opensearch.indexmanagement.transform.TransformRestTestCase import org.opensearch.indexmanagement.transform.model.Transform import org.opensearch.indexmanagement.transform.randomTransform import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.aggregations.AggregationBuilders import org.opensearch.search.aggregations.AggregatorFactories import java.time.Instant diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStartTransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStartTransformActionIT.kt index d4cef5b90..5022a0768 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStartTransformActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStartTransformActionIT.kt @@ -15,7 +15,7 @@ import org.opensearch.indexmanagement.transform.model.TransformMetadata import org.opensearch.indexmanagement.transform.randomTransform import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.aggregations.AggregatorFactories import org.opensearch.test.junit.annotations.TestLogging import java.time.Instant diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStopTransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStopTransformActionIT.kt index 7e8efea9b..c1de752fc 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStopTransformActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStopTransformActionIT.kt @@ -16,7 +16,7 @@ import org.opensearch.indexmanagement.transform.model.TransformMetadata import org.opensearch.indexmanagement.transform.randomTransform import org.opensearch.indexmanagement.waitFor import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule -import org.opensearch.rest.RestStatus +import org.opensearch.core.rest.RestStatus import org.opensearch.search.aggregations.AggregatorFactories import org.opensearch.test.junit.annotations.TestLogging import java.time.Instant From 157960de03485807f31248bcb9e0fcce02a4b571 Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Wed, 19 Jul 2023 01:13:15 -0700 Subject: [PATCH 06/29] Upgrade the backport workflow (#862) Signed-off-by: Ashish Agrawal Signed-off-by: Tanqiu Liu --- .github/workflows/backport.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index e3f96a44f..5f7cb712b 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -23,7 +23,9 @@ jobs: installation_id: 22958780 - name: Backport - uses: VachaShah/backport@v1.1.4 + uses: VachaShah/backport@v2.2.0 with: github_token: ${{ steps.github_app_token.outputs.token }} branch_name: backport/backport-${{ github.event.number }} + labels_template: "<%= JSON.stringify([...labels, 'autocut']) %>" + failure_labels: "failed backport" \ No newline at end of file From 98ddb8d56a33cd9ac5f5db3de738db8da531b63c Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Fri, 21 Jul 2023 11:15:45 -0700 Subject: [PATCH 07/29] Added 2.9 release notes. (#851) * Added 2.9 release notes. Signed-off-by: AWSHurneyt * Added 2.9 release notes. Signed-off-by: AWSHurneyt * Added 2.9 release notes. Signed-off-by: AWSHurneyt --------- Signed-off-by: AWSHurneyt Signed-off-by: Tanqiu Liu --- ...-index-management.release-notes-2.9.0.0.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 release-notes/opensearch-index-management.release-notes-2.9.0.0.md diff --git a/release-notes/opensearch-index-management.release-notes-2.9.0.0.md b/release-notes/opensearch-index-management.release-notes-2.9.0.0.md new file mode 100644 index 000000000..1196cbb46 --- /dev/null +++ b/release-notes/opensearch-index-management.release-notes-2.9.0.0.md @@ -0,0 +1,21 @@ +## Version 2.9.0.0 2023-07-11 + +Compatible with OpenSearch 2.9.0 + +### Maintenance +* Increment version to 2.9.0-SNAPSHOT. ([#805](https://github.com/opensearch-project/index-management/pull/805)) +* Added to CODEOWNERS and MAINTAINERS files. ([#810](https://github.com/opensearch-project/index-management/pull/810)) +* Upgrade httpcomponent version after OpenSearch core's upgrade. ([#847](https://github.com/opensearch-project/index-management/pull/847)) + +### Features +* Support for system index interface. ([#789](https://github.com/opensearch-project/index-management/pull/789)) + +### Bug fixes +* Bugfix/202 transform date add date conversion. ([#622](https://github.com/opensearch-project/index-management/pull/622)) +* Fix build errors after refactoring of Strings class in core. ([#786](https://github.com/opensearch-project/index-management/pull/786)) +* Fix LRON concurrent indexing throw ResourceAlreadyExists. ([#831](https://github.com/opensearch-project/index-management/pull/831)) +* ImmutableOpenMap to j.u.Map. ([#838](https://github.com/opensearch-project/index-management/pull/838)) +* Remove runtime notification settings. ([#839](https://github.com/opensearch-project/index-management/pull/839)) + +### Documentation +* Added 2.9 release notes. ([#851](https://github.com/opensearch-project/index-management/pull/851)) \ No newline at end of file From 271b25b1bfea9a92886b836153dcd91904ec7ec2 Mon Sep 17 00:00:00 2001 From: Bryce Lampe Date: Fri, 21 Jul 2023 18:08:30 -0700 Subject: [PATCH 08/29] Handle NPE in isRollupIndex (#855) * Handle NPE in isRollupIndex `metadata.index()` can return `null`, so handle that case by returning `false`. Signed-off-by: Bryce Lampe * unit test Signed-off-by: Bryce Lampe --------- Signed-off-by: Bryce Lampe Co-authored-by: bowenlan-amzn Signed-off-by: Tanqiu Liu --- .../indexmanagement/rollup/util/RollupUtils.kt | 7 +++++-- .../rollup/util/RollupUtilsTests.kt | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtils.kt index 7b310a4f7..502cc181f 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtils.kt @@ -68,9 +68,12 @@ const val DATE_FIELD_EPOCH_MILLIS_FORMAT = "epoch_millis" @Suppress("ReturnCount") fun isRollupIndex(index: String, clusterState: ClusterState): Boolean { - if (RollupSettings.ROLLUP_INDEX.get(clusterState.metadata.index(index).settings)) { + val idx = clusterState.metadata.index(index) + if (idx == null) { + return false + } else if (RollupSettings.ROLLUP_INDEX.get(idx.settings)) { return true - } else if (LegacyOpenDistroRollupSettings.ROLLUP_INDEX.get(clusterState.metadata.index(index).settings)) { + } else if (LegacyOpenDistroRollupSettings.ROLLUP_INDEX.get(idx.settings)) { return true } return false diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtilsTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtilsTests.kt index c063a3487..d535f1fb7 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtilsTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtilsTests.kt @@ -5,6 +5,11 @@ package org.opensearch.indexmanagement.rollup.util +import com.nhaarman.mockitokotlin2.doReturn +import com.nhaarman.mockitokotlin2.mock +import com.nhaarman.mockitokotlin2.whenever +import org.opensearch.cluster.ClusterState +import org.opensearch.cluster.metadata.Metadata import org.opensearch.index.query.BoolQueryBuilder import org.opensearch.index.query.ConstantScoreQueryBuilder import org.opensearch.index.query.DisMaxQueryBuilder @@ -230,4 +235,16 @@ class RollupUtilsTests : OpenSearchTestCase() { assertEquals("Rewritten aggregation builder is not the correct type", aggBuilder.type, rewrittenAgg.type) } } + + fun `test isRollupIndex`() { + val indexName = "missing index" + val clusterState: ClusterState = mock() + val metadata: Metadata = mock() + + whenever(clusterState.metadata).doReturn(metadata) + whenever(metadata.index(indexName)).doReturn(null) + + val actual = isRollupIndex(indexName, clusterState) + assertFalse(actual) + } } From 8918a792df74c9af69212178b002f363655a7b94 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Fri, 28 Jul 2023 01:21:39 +0800 Subject: [PATCH 09/29] Fix core XcontentType refactor (#873) Signed-off-by: Hailong Cui Signed-off-by: Tanqiu Liu --- .../indexstatemanagement/resthandler/RestAddPolicyAction.kt | 3 +-- .../resthandler/RestRetryFailedManagedIndexAction.kt | 3 +-- .../indexmanagement/opensearchapi/OpenSearchExtensions.kt | 2 +- .../indexmanagement/IndexManagementRestTestCase.kt | 5 +++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestAddPolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestAddPolicyAction.kt index 6e509b4f6..2601b2b40 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestAddPolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestAddPolicyAction.kt @@ -7,7 +7,6 @@ package org.opensearch.indexmanagement.indexstatemanagement.resthandler import org.opensearch.client.node.NodeClient import org.opensearch.core.common.Strings -import org.opensearch.core.xcontent.MediaType import org.opensearch.common.xcontent.XContentHelper import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.ISM_BASE_URI import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.LEGACY_ISM_BASE_URI @@ -55,7 +54,7 @@ class RestAddPolicyAction : BaseRestHandler() { } val body = if (request.hasContent()) { - XContentHelper.convertToMap(request.requiredContent(), false, request.xContentType as (MediaType)).v2() + XContentHelper.convertToMap(request.requiredContent(), false, request.mediaType).v2() } else { mapOf() } diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRetryFailedManagedIndexAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRetryFailedManagedIndexAction.kt index ee07ddeaf..7d92534a0 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRetryFailedManagedIndexAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/resthandler/RestRetryFailedManagedIndexAction.kt @@ -8,7 +8,6 @@ package org.opensearch.indexmanagement.indexstatemanagement.resthandler import org.opensearch.client.node.NodeClient import org.opensearch.core.common.Strings import org.opensearch.common.logging.DeprecationLogger -import org.opensearch.core.xcontent.MediaType import org.opensearch.common.xcontent.XContentHelper import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.ISM_BASE_URI import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.LEGACY_ISM_BASE_URI @@ -55,7 +54,7 @@ class RestRetryFailedManagedIndexAction : BaseRestHandler() { throw IllegalArgumentException("Missing indices") } val body = if (request.hasContent()) { - XContentHelper.convertToMap(request.requiredContent(), false, request.xContentType as (MediaType)).v2() + XContentHelper.convertToMap(request.requiredContent(), false, request.mediaType).v2() } else { mapOf() } diff --git a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt index e8ea0773e..47004357d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt @@ -76,7 +76,7 @@ fun contentParser(bytesReference: BytesReference, xContentRegistry: NamedXConten /** Convert an object to maps and lists representation */ fun ToXContent.convertToMap(): Map { - val bytesReference = XContentHelper.toXContent(this, XContentType.JSON, false) + val bytesReference = XContentHelper.toXContent(this, MediaType.fromMediaType(XContentType.JSON.mediaType()), ToXContent.EMPTY_PARAMS, false) return XContentHelper.convertToMap(bytesReference, false, XContentType.JSON as (MediaType)).v2() } diff --git a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt index 152338487..c3462d65c 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt @@ -25,6 +25,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.common.xcontent.XContentType import org.opensearch.indexmanagement.indexstatemanagement.util.INDEX_HIDDEN import org.opensearch.core.rest.RestStatus +import org.opensearch.core.xcontent.MediaType import java.io.IOException import java.nio.file.Files import java.util.* @@ -189,7 +190,7 @@ abstract class IndexManagementRestTestCase : ODFERestTestCase() { } val response = client.performRequest(Request("GET", "/_cat/indices?format=json&expand_wildcards=all")) - val xContentType = XContentType.fromMediaType(response.entity.contentType) + val xContentType = MediaType.fromMediaType(response.entity.contentType) xContentType.xContent().createParser( NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, response.entity.content @@ -258,7 +259,7 @@ abstract class IndexManagementRestTestCase : ODFERestTestCase() { protected fun waitForThreadPools(client: RestClient) { val response = client.performRequest(Request("GET", "/_cat/thread_pool?format=json")) - val xContentType = XContentType.fromMediaType(response.entity.contentType) + val xContentType = MediaType.fromMediaType(response.entity.contentType) xContentType.xContent().createParser( NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, response.entity.content From 60fc6f26713b839caea8641ed27993b675b32af5 Mon Sep 17 00:00:00 2001 From: Subhobrata Dey Date: Fri, 28 Jul 2023 20:34:44 +0000 Subject: [PATCH 10/29] fix for max & min aggregations when no metric property exist (#870) Signed-off-by: Subhobrata Dey Signed-off-by: Tanqiu Liu --- detekt.yml | 4 +- .../indexmanagement/rollup/RollupIndexer.kt | 5 +- .../IndexManagementRestTestCase.kt | 5 ++ .../rollup/runner/RollupRunnerIT.kt | 72 +++++++++++++++++++ src/test/resources/data/message_logs.ndjson | 4 ++ 5 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 src/test/resources/data/message_logs.ndjson diff --git a/detekt.yml b/detekt.yml index 77c5afe01..8ed992998 100644 --- a/detekt.yml +++ b/detekt.yml @@ -22,4 +22,6 @@ complexity: LongMethod: excludes: ['**/test/**'] LongParameterList: - excludes: ['**/test/**'] \ No newline at end of file + excludes: ['**/test/**'] + NestedBlockDepth: + threshold: 5 \ No newline at end of file diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupIndexer.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupIndexer.kt index ac077a707..55db96c21 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupIndexer.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupIndexer.kt @@ -116,8 +116,9 @@ class RollupIndexer( it.aggregations.forEach { when (it) { is InternalSum -> aggResults[it.name] = it.value - is InternalMax -> aggResults[it.name] = it.value - is InternalMin -> aggResults[it.name] = it.value + // TODO: Need to redo the logic in corresponding doXContentBody of InternalMax and InternalMin + is InternalMax -> if (it.value.isInfinite()) aggResults[it.name] = null else aggResults[it.name] = it.value + is InternalMin -> if (it.value.isInfinite()) aggResults[it.name] = null else aggResults[it.name] = it.value is InternalValueCount -> aggResults[it.name] = it.value is InternalAvg -> aggResults[it.name] = it.value else -> error("Found aggregation in composite result that is not supported [${it.type} - ${it.name}]") diff --git a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt index c3462d65c..23bcaebcd 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt @@ -153,6 +153,11 @@ abstract class IndexManagementRestTestCase : ODFERestTestCase() { insertSampleBulkData(index, javaClass.classLoader.getResource("data/nyc_5000.ndjson").readText()) } + protected fun generateMessageLogsData(index: String = "message-logs") { + createIndex(index, Settings.EMPTY, """"properties": {"message":{"properties":{"bytes_in":{"type":"long"},"bytes_out":{"type":"long"},"plugin":{"eager_global_ordinals":true,"ignore_above":10000,"type":"keyword"},"timestamp_received":{"type":"date"}}}}""") + insertSampleBulkData(index, javaClass.classLoader.getResource("data/message_logs.ndjson").readText()) + } + @Suppress("UNCHECKED_CAST") protected fun extractFailuresFromSearchResponse(searchResponse: Response): List?>? { val shards = searchResponse.asMap()["_shards"] as Map>> diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/runner/RollupRunnerIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/runner/RollupRunnerIT.kt index 17028ccb7..529f166f4 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/runner/RollupRunnerIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/runner/RollupRunnerIT.kt @@ -1319,6 +1319,78 @@ class RollupRunnerIT : RollupRestTestCase() { } } + @Suppress("UNCHECKED_CAST") + fun `test rollup with max metric when metric property not present`() { + val sourceIdxTestName = "source_idx_test_max" + val targetIdxTestName = "target_idx_test_max" + val propertyName = "message.bytes_in" + val maxMetricName = "min_message_bytes_in" + + generateMessageLogsData(sourceIdxTestName) + val rollup = Rollup( + id = "rollup_test_max", + schemaVersion = 1L, + enabled = true, + jobSchedule = IntervalSchedule(Instant.now(), 1, ChronoUnit.MINUTES), + jobLastUpdatedTime = Instant.now(), + jobEnabledTime = Instant.now(), + description = "basic stats test", + sourceIndex = sourceIdxTestName, + targetIndex = targetIdxTestName, + metadataID = null, + roles = emptyList(), + pageSize = 100, + delay = 0, + continuous = false, + dimensions = listOf( + DateHistogram(sourceField = "message.timestamp_received", targetField = "message.timestamp_received", fixedInterval = "10m"), + Terms("message.plugin", "message.plugin") + ), + metrics = listOf( + RollupMetrics(sourceField = propertyName, targetField = propertyName, metrics = listOf(Max())) + ) + ).let { createRollup(it, it.id) } + + updateRollupStartTime(rollup) + + waitFor { assertTrue("Target rollup index was not created", indexExists(rollup.targetIndex)) } + + waitFor { + val rollupJob = getRollup(rollupId = rollup.id) + assertNotNull("Rollup job doesn't have metadata set", rollupJob.metadataID) + val rollupMetadata = getRollupMetadata(rollupJob.metadataID!!) + assertEquals("Rollup is not finished", RollupMetadata.Status.FINISHED, rollupMetadata.status) + + // Term query + val req = """ + { + "size": 0, + "query": { + "match_all": {} + }, + "aggs": { + "$maxMetricName": { + "max": { + "field": "$propertyName" + } + } + } + } + """.trimIndent() + var rawRes = client().makeRequest(RestRequest.Method.POST.name, "/$sourceIdxTestName/_search", emptyMap(), StringEntity(req, ContentType.APPLICATION_JSON)) + assertTrue(rawRes.restStatus() == RestStatus.OK) + var rollupRes = client().makeRequest(RestRequest.Method.POST.name, "/$targetIdxTestName/_search", emptyMap(), StringEntity(req, ContentType.APPLICATION_JSON)) + assertTrue(rollupRes.restStatus() == RestStatus.OK) + var rawAggRes = rawRes.asMap()["aggregations"] as Map> + var rollupAggRes = rollupRes.asMap()["aggregations"] as Map> + assertEquals( + "Source and rollup index did not return same max results", + rawAggRes.getValue(maxMetricName)["value"], + rollupAggRes.getValue(maxMetricName)["value"] + ) + } + } + // TODO: Test scenarios: // - Source index deleted after first execution // * If this is with a source index pattern and the underlying indices are recreated but with different data diff --git a/src/test/resources/data/message_logs.ndjson b/src/test/resources/data/message_logs.ndjson new file mode 100644 index 000000000..06b92003e --- /dev/null +++ b/src/test/resources/data/message_logs.ndjson @@ -0,0 +1,4 @@ +{"create":{}} +{"message":{"bytes_out":4256,"plugin":"AlienVault NIDS","timestamp_received":1689786716020}} +{"create":{}} +{"message":{"bytes_out":4526,"plugin":"AlienVault NIDS","timestamp_received":1689886716020}} From c9ba2fb2c6ef73541387f218da2062171144a08b Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Fri, 4 Aug 2023 00:57:01 +0800 Subject: [PATCH 11/29] core refactor change (#884) Signed-off-by: Hailong Cui Signed-off-by: Tanqiu Liu --- .../opensearch/indexmanagement/IndexManagementPlugin.kt | 6 +++--- .../action/get/TransportGetLRONConfigAction.kt | 8 +++++--- .../indexstatemanagement/PluginVersionSweepCoordinator.kt | 2 +- .../indexstatemanagement/action/RolloverAction.kt | 2 +- .../indexstatemanagement/action/RolloverActionParser.kt | 2 +- .../indexstatemanagement/action/ShrinkAction.kt | 2 +- .../indexstatemanagement/action/ShrinkActionParser.kt | 2 +- .../indexstatemanagement/model/Transition.kt | 2 +- .../step/rollover/AttemptRolloverStep.kt | 2 +- .../step/transition/AttemptTransitionStep.kt | 2 +- .../indexstatemanagement/util/ManagedIndexUtils.kt | 2 +- .../indexmanagement/opensearchapi/OpenSearchExtensions.kt | 4 +--- .../indexmanagement/rollup/RollupSearchService.kt | 2 +- .../indexmanagement/indexstatemanagement/TestHelpers.kt | 2 +- .../indexstatemanagement/action/RolloverActionIT.kt | 4 ++-- .../indexstatemanagement/action/ShrinkActionIT.kt | 2 +- .../indexstatemanagement/model/ActionTests.kt | 2 +- .../indexstatemanagement/model/ConditionsTests.kt | 2 +- .../indexstatemanagement/util/ManagedIndexUtilsTests.kt | 2 +- .../indexstatemanagement/util/StepUtilsTests.kt | 2 +- 20 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt index 7a5f0ee29..f90adacc6 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt @@ -14,9 +14,9 @@ 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.Lifecycle -import org.opensearch.common.component.LifecycleComponent -import org.opensearch.common.component.LifecycleListener +import org.opensearch.common.lifecycle.Lifecycle +import org.opensearch.common.lifecycle.LifecycleComponent +import org.opensearch.common.lifecycle.LifecycleListener import org.opensearch.common.inject.Inject import org.opensearch.core.common.io.stream.NamedWriteableRegistry import org.opensearch.common.settings.ClusterSettings diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt index aea80dbd8..33593d49d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt @@ -15,7 +15,7 @@ import org.opensearch.action.support.HandledTransportAction import org.opensearch.client.node.NodeClient import org.opensearch.common.inject.Inject import org.opensearch.common.xcontent.LoggingDeprecationHandler -import org.opensearch.common.xcontent.XContentFactory +import org.opensearch.common.xcontent.XContentHelper import org.opensearch.common.xcontent.XContentType import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.commons.ConfigConstants @@ -100,8 +100,10 @@ class TransportGetLRONConfigAction @Inject constructor( override fun onResponse(response: SearchResponse) { val totalNumber = response.hits.totalHits?.value ?: 0 val lronConfigResponses = response.hits.hits.map { - val xcp = XContentFactory.xContent(XContentType.JSON) - .createParser(xContentRegistry, LoggingDeprecationHandler.INSTANCE, it.sourceAsString) + val xcp = XContentHelper.createParser( + xContentRegistry, + LoggingDeprecationHandler.INSTANCE, it.sourceRef, XContentType.JSON + ) LRONConfigResponse( id = it.id, lronConfig = xcp.parseWithType(id = it.id, parse = LRONConfig.Companion::parse) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/PluginVersionSweepCoordinator.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/PluginVersionSweepCoordinator.kt index d59bc27b1..ccf341fe4 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/PluginVersionSweepCoordinator.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/PluginVersionSweepCoordinator.kt @@ -14,7 +14,7 @@ import org.apache.logging.log4j.LogManager import org.opensearch.cluster.ClusterChangedEvent import org.opensearch.cluster.ClusterStateListener import org.opensearch.cluster.service.ClusterService -import org.opensearch.common.component.LifecycleListener +import org.opensearch.common.lifecycle.LifecycleListener import org.opensearch.common.settings.Settings import org.opensearch.indexmanagement.indexstatemanagement.settings.ManagedIndexSettings import org.opensearch.indexmanagement.util.OpenForTesting diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt index 3e45beea8..196f4d818 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action import org.opensearch.core.common.io.stream.StreamOutput -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt index e9a979f61..379ef54b9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action import org.opensearch.core.common.io.stream.StreamInput -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkAction.kt index 85d8f5142..d91bd281b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkAction.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action import org.opensearch.action.admin.indices.alias.Alias import org.opensearch.core.common.io.stream.StreamOutput -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.indexmanagement.indexstatemanagement.action.NotificationAction.Companion.MUSTACHE diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionParser.kt index a4cf04f20..4d32de907 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionParser.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action import org.opensearch.action.admin.indices.alias.Alias import org.opensearch.core.common.io.stream.StreamInput -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken import org.opensearch.indexmanagement.indexstatemanagement.action.ShrinkAction.Companion.ALIASES_FIELD diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Transition.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Transition.kt index d6b617150..bab7bf1e1 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Transition.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/Transition.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.model 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.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt index 5af656db5..a58dc98f6 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt @@ -11,7 +11,7 @@ import org.opensearch.action.admin.indices.rollover.RolloverRequest import org.opensearch.action.admin.indices.rollover.RolloverResponse import org.opensearch.action.admin.indices.stats.IndicesStatsRequest import org.opensearch.action.admin.indices.stats.IndicesStatsResponse -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.indexmanagement.indexstatemanagement.action.RolloverAction import org.opensearch.indexmanagement.indexstatemanagement.opensearchapi.getRolloverAlias diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transition/AttemptTransitionStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transition/AttemptTransitionStep.kt index 82fde5fad..a71fa1f18 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transition/AttemptTransitionStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transition/AttemptTransitionStep.kt @@ -10,7 +10,7 @@ import org.opensearch.ExceptionsHelper import org.opensearch.action.admin.indices.stats.IndicesStatsRequest import org.opensearch.action.admin.indices.stats.IndicesStatsResponse import org.opensearch.cluster.service.ClusterService -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.indexmanagement.indexstatemanagement.IndexMetadataProvider import org.opensearch.indexmanagement.indexstatemanagement.action.TransitionsAction import org.opensearch.indexmanagement.indexstatemanagement.opensearchapi.getOldestRolloverTime diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt index 1e031193d..c4f31bc87 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt @@ -21,7 +21,7 @@ import org.opensearch.action.support.WriteRequest import org.opensearch.action.update.UpdateRequest // import org.opensearch.alerting.destination.message.BaseMessage import org.opensearch.client.Client -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry diff --git a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt index 47004357d..19c6cc9fb 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt @@ -28,7 +28,6 @@ import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue import org.opensearch.common.util.concurrent.ThreadContext import org.opensearch.common.xcontent.LoggingDeprecationHandler -import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentHelper import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken @@ -131,8 +130,7 @@ fun parseFromSearchResponse( val id = it.id val seqNo = it.seqNo val primaryTerm = it.primaryTerm - val xcp = XContentFactory.xContent(XContentType.JSON) - .createParser(xContentRegistry, LoggingDeprecationHandler.INSTANCE, it.sourceAsString) + val xcp = XContentHelper.createParser(xContentRegistry, LoggingDeprecationHandler.INSTANCE, it.sourceRef, XContentType.JSON) xcp.parseWithType(id, seqNo, primaryTerm, parse) } } diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupSearchService.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupSearchService.kt index a69ec735a..b198483cf 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupSearchService.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupSearchService.kt @@ -14,7 +14,7 @@ import org.opensearch.action.search.SearchPhaseExecutionException import org.opensearch.action.search.SearchResponse import org.opensearch.client.Client import org.opensearch.cluster.service.ClusterService -import org.opensearch.common.breaker.CircuitBreakingException +import org.opensearch.core.common.breaker.CircuitBreakingException import org.opensearch.common.settings.Settings import org.opensearch.indexmanagement.opensearchapi.retry import org.opensearch.indexmanagement.opensearchapi.suspendUntil diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/TestHelpers.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/TestHelpers.kt index 3fd18b511..2ad77d312 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/TestHelpers.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/TestHelpers.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.indexstatemanagement import org.opensearch.action.admin.indices.alias.Alias import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.core.xcontent.ToXContent import org.opensearch.common.xcontent.XContentFactory diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt index 85cfc0c55..dfe91f2d1 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt @@ -10,8 +10,8 @@ import org.apache.hc.core5.http.io.entity.StringEntity import org.junit.Assert import org.opensearch.cluster.metadata.DataStream import org.opensearch.common.settings.Settings -import org.opensearch.common.unit.ByteSizeUnit -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeUnit +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.indexmanagement.indexstatemanagement.IndexStateManagementRestTestCase import org.opensearch.indexmanagement.indexstatemanagement.model.ISMTemplate diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionIT.kt index 5976653dc..6f4737761 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/ShrinkActionIT.kt @@ -15,7 +15,7 @@ import org.opensearch.cluster.routing.allocation.DiskThresholdSettings.CLUSTER_R import org.opensearch.cluster.routing.allocation.DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING import org.opensearch.cluster.routing.allocation.DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING import org.opensearch.common.settings.Settings -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.index.query.QueryBuilders import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX import org.opensearch.indexmanagement.indexstatemanagement.IndexStateManagementRestTestCase diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ActionTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ActionTests.kt index b9abee69a..070388cd9 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ActionTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ActionTests.kt @@ -10,7 +10,7 @@ import org.opensearch.core.common.io.stream.InputStreamStreamInput import org.opensearch.core.common.io.stream.OutputStreamStreamOutput import org.opensearch.common.settings.ClusterSettings import org.opensearch.common.settings.Settings -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ConditionsTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ConditionsTests.kt index 727c3a348..b3c0e6ebc 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ConditionsTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/model/ConditionsTests.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.model -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.indexmanagement.indexstatemanagement.randomByteSizeValue import org.opensearch.indexmanagement.indexstatemanagement.randomTimeValueObject import org.opensearch.test.OpenSearchTestCase diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtilsTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtilsTests.kt index 8f8c96acc..3dd7b20ec 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtilsTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtilsTests.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.util import org.opensearch.core.common.bytes.BytesReference -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/StepUtilsTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/StepUtilsTests.kt index a9a671e72..9eef04b65 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/StepUtilsTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/StepUtilsTests.kt @@ -11,7 +11,7 @@ import org.opensearch.action.admin.cluster.node.stats.NodeStats import org.opensearch.cluster.routing.allocation.DiskThresholdSettings import org.opensearch.common.settings.ClusterSettings import org.opensearch.common.settings.Settings -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX import org.opensearch.indexmanagement.indexstatemanagement.randomByteSizeValue import org.opensearch.indexmanagement.randomInstant From 58153bd88c0e20f96ce27decbe574981b4b43ea5 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Mon, 7 Aug 2023 09:59:38 +0800 Subject: [PATCH 12/29] update backport branch name (#885) Signed-off-by: Hailong Cui Signed-off-by: Tanqiu Liu --- .github/workflows/backport.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 5f7cb712b..06681a263 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -9,6 +9,15 @@ on: jobs: backport: runs-on: ubuntu-latest + if: > + github.event.pull_request.merged + && ( + github.event.action == 'closed' + || ( + github.event.action == 'labeled' + && contains(github.event.label.name, 'backport') + ) + ) permissions: contents: write pull-requests: write @@ -26,6 +35,6 @@ jobs: uses: VachaShah/backport@v2.2.0 with: github_token: ${{ steps.github_app_token.outputs.token }} - branch_name: backport/backport-${{ github.event.number }} + head_template: backport/backport-<%= number %>-to-<%= base %> labels_template: "<%= JSON.stringify([...labels, 'autocut']) %>" - failure_labels: "failed backport" \ No newline at end of file + failure_labels: "failed backport" From 513553b71f2c1511a8e1df7f6d25b963ff82ea70 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Tue, 8 Aug 2023 23:26:29 +0800 Subject: [PATCH 13/29] core refactor change (#887) Signed-off-by: Hailong Cui Signed-off-by: Tanqiu Liu --- .../indexstatemanagement/model/ActionMetaData.kt | 2 +- .../indexstatemanagement/model/ManagedIndexMetaData.kt | 3 +-- .../indexstatemanagement/model/PolicyRetryInfoMetaData.kt | 2 +- .../indexstatemanagement/model/StateMetaData.kt | 2 +- .../indexstatemanagement/model/StepMetaData.kt | 2 +- .../indexstatemanagement/model/ValidationResult.kt | 2 +- .../indexmanagement/indexstatemanagement/ISMTemplateService.kt | 2 +- .../opensearch/indexmanagement/snapshotmanagement/SMUtils.kt | 2 +- .../opensearch/indexmanagement/IndexManagementRestTestCase.kt | 2 +- .../org/opensearch/indexmanagement/SecurityRestTestCase.kt | 2 +- 10 files changed, 10 insertions(+), 11 deletions(-) diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionMetaData.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionMetaData.kt index 3775cb51c..1d7e94a74 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionMetaData.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ActionMetaData.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model -import org.opensearch.common.Strings +import org.opensearch.core.common.Strings import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.common.io.stream.Writeable diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt index c778f999d..90186c042 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt @@ -5,7 +5,6 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model -import org.opensearch.common.Strings import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.common.io.stream.Writeable @@ -57,7 +56,7 @@ data class ManagedIndexMetaData( if (actionMetaData != null) resultMap[ActionMetaData.ACTION] = actionMetaData.getMapValueString() if (stepMetaData != null) resultMap[StepMetaData.STEP] = stepMetaData.getMapValueString() if (policyRetryInfo != null) resultMap[PolicyRetryInfoMetaData.RETRY_INFO] = policyRetryInfo.getMapValueString() - if (info != null) resultMap[INFO] = Strings.toString(XContentFactory.jsonBuilder().map(info)) + if (info != null) resultMap[INFO] = XContentFactory.jsonBuilder().map(info).toString() return resultMap } diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/PolicyRetryInfoMetaData.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/PolicyRetryInfoMetaData.kt index 33390fd2a..a8fe8bf29 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/PolicyRetryInfoMetaData.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/PolicyRetryInfoMetaData.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model -import org.opensearch.common.Strings +import org.opensearch.core.common.Strings import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.common.io.stream.Writeable diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StateMetaData.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StateMetaData.kt index ee2cf5ed2..7c6174106 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StateMetaData.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StateMetaData.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model -import org.opensearch.common.Strings +import org.opensearch.core.common.Strings import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.common.io.stream.Writeable diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StepMetaData.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StepMetaData.kt index c4a214c65..defe49287 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StepMetaData.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/StepMetaData.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model -import org.opensearch.common.Strings +import org.opensearch.core.common.Strings import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.common.io.stream.Writeable diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ValidationResult.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ValidationResult.kt index 3008207c1..c2d24a86a 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ValidationResult.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ValidationResult.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model -import org.opensearch.common.Strings +import org.opensearch.core.common.Strings import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.common.io.stream.Writeable diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMTemplateService.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMTemplateService.kt index d1057676c..0cb0a7b84 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMTemplateService.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ISMTemplateService.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.indexstatemanagement import org.apache.lucene.util.automaton.Operations import org.opensearch.OpenSearchException -import org.opensearch.common.Strings +import org.opensearch.core.common.Strings import org.opensearch.common.ValidationException import org.opensearch.common.regex.Regex import org.opensearch.indexmanagement.indexstatemanagement.model.ISMTemplate diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt index 0ff9cc691..e3f381971 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt @@ -17,7 +17,7 @@ import org.opensearch.action.get.GetResponse import org.opensearch.action.index.IndexRequest import org.opensearch.action.index.IndexResponse import org.opensearch.client.Client -import org.opensearch.common.Strings +import org.opensearch.core.common.Strings import org.opensearch.common.time.DateFormatter import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler diff --git a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt index 23bcaebcd..fd823a15f 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt @@ -17,7 +17,7 @@ import org.opensearch.client.RestClient import org.opensearch.client.RequestOptions import org.opensearch.client.WarningsHandler import org.opensearch.client.ResponseException -import org.opensearch.common.Strings +import org.opensearch.core.common.Strings import org.opensearch.common.io.PathUtils import org.opensearch.common.settings.Settings import org.opensearch.core.xcontent.DeprecationHandler diff --git a/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt index 208722eba..540279a57 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt @@ -19,7 +19,7 @@ import org.opensearch.client.Request import org.opensearch.client.Response import org.opensearch.client.ResponseException import org.opensearch.client.RestClient -import org.opensearch.common.Strings +import org.opensearch.core.common.Strings import org.opensearch.common.settings.Settings import org.opensearch.common.xcontent.XContentType import org.opensearch.indexmanagement.indexstatemanagement.IndexStateManagementRestTestCase From 4cd7730b8954fff28529355604dde83d7960ce85 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Fri, 11 Aug 2023 00:42:09 +0800 Subject: [PATCH 14/29] Fix breaking change by core refactor (#888) Signed-off-by: Hailong Cui Signed-off-by: Tanqiu Liu --- .../indexmanagement/opensearchapi/OpenSearchExtensions.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt index 19c6cc9fb..09e70d1da 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt @@ -75,7 +75,9 @@ fun contentParser(bytesReference: BytesReference, xContentRegistry: NamedXConten /** Convert an object to maps and lists representation */ fun ToXContent.convertToMap(): Map { - val bytesReference = XContentHelper.toXContent(this, MediaType.fromMediaType(XContentType.JSON.mediaType()), ToXContent.EMPTY_PARAMS, false) + val bytesReference = org.opensearch.core.xcontent.XContentHelper.toXContent( + this, XContentType.JSON, ToXContent.EMPTY_PARAMS, false + ) return XContentHelper.convertToMap(bytesReference, false, XContentType.JSON as (MediaType)).v2() } From d8bb8343a9dd67469c79a36d2bf740371981d32a Mon Sep 17 00:00:00 2001 From: bowenlan-amzn Date: Fri, 25 Aug 2023 16:11:27 -0700 Subject: [PATCH 15/29] fix core breaking (#906) Signed-off-by: bowenlan-amzn Signed-off-by: Tanqiu Liu --- .../opensearch/indexmanagement/IndexManagementIndices.kt | 2 +- .../org/opensearch/indexmanagement/IndexManagementPlugin.kt | 2 +- .../controlcenter/notification/ControlCenterIndices.kt | 2 +- .../controlcenter/notification/LRONConfigResponse.kt | 2 +- .../action/delete/TransportDeleteLRONConfigAction.kt | 2 +- .../notification/action/get/GetLRONConfigResponse.kt | 2 +- .../notification/action/get/TransportGetLRONConfigAction.kt | 2 +- .../action/index/TransportIndexLRONConfigAction.kt | 2 +- .../notification/filter/IndexOperationActionFilter.kt | 6 +++--- .../notification/filter/NotificationActionListener.kt | 6 +++--- .../notification/filter/parser/ReindexRespParser.kt | 2 +- .../notification/filter/parser/ResponseParser.kt | 2 +- .../controlcenter/notification/model/LRONConfig.kt | 2 +- .../controlcenter/notification/util/LRONUtils.kt | 4 ++-- .../indexstatemanagement/IndexStateManagementHistory.kt | 2 +- .../indexmanagement/indexstatemanagement/SkipExecution.kt | 2 +- .../transport/action/ISMStatusResponse.kt | 2 +- .../transport/action/addpolicy/TransportAddPolicyAction.kt | 2 +- .../action/changepolicy/TransportChangePolicyAction.kt | 2 +- .../action/deletepolicy/TransportDeletePolicyAction.kt | 2 +- .../transport/action/explain/ExplainResponse.kt | 2 +- .../transport/action/explain/TransportExplainAction.kt | 2 +- .../transport/action/getpolicy/GetPoliciesResponse.kt | 2 +- .../transport/action/getpolicy/GetPolicyResponse.kt | 2 +- .../action/getpolicy/TransportGetPoliciesAction.kt | 2 +- .../transport/action/getpolicy/TransportGetPolicyAction.kt | 2 +- .../transport/action/indexpolicy/IndexPolicyResponse.kt | 2 +- .../action/indexpolicy/TransportIndexPolicyAction.kt | 2 +- .../action/managedIndex/TransportManagedIndexAction.kt | 2 +- .../action/removepolicy/TransportRemovePolicyAction.kt | 2 +- .../TransportRetryFailedManagedIndexAction.kt | 2 +- .../TransportUpdateManagedIndexMetaDataAction.kt | 2 +- .../indexmanagement/opensearchapi/OpenSearchExtensions.kt | 2 +- .../org/opensearch/indexmanagement/rollup/RollupRunner.kt | 2 +- .../indexmanagement/rollup/RollupSearchService.kt | 2 +- .../rollup/action/delete/TransportDeleteRollupAction.kt | 2 +- .../rollup/action/explain/ExplainRollupResponse.kt | 2 +- .../rollup/action/explain/TransportExplainRollupAction.kt | 2 +- .../indexmanagement/rollup/action/get/GetRollupResponse.kt | 2 +- .../indexmanagement/rollup/action/get/GetRollupsResponse.kt | 2 +- .../rollup/action/get/TransportGetRollupAction.kt | 2 +- .../rollup/action/get/TransportGetRollupsAction.kt | 2 +- .../rollup/action/index/IndexRollupResponse.kt | 2 +- .../rollup/action/index/TransportIndexRollupAction.kt | 2 +- .../action/mapping/TransportUpdateRollupMappingAction.kt | 2 +- .../rollup/action/start/TransportStartRollupAction.kt | 2 +- .../rollup/action/stop/TransportStopRollupAction.kt | 2 +- .../indexmanagement/rollup/actionfilter/FieldCapsFilter.kt | 4 ++-- .../snapshotmanagement/api/transport/BaseTransportAction.kt | 4 ++-- .../api/transport/explain/ExplainSMPolicyResponse.kt | 2 +- .../api/transport/get/GetSMPoliciesResponse.kt | 2 +- .../api/transport/get/GetSMPolicyResponse.kt | 2 +- .../api/transport/index/IndexSMPolicyResponse.kt | 2 +- .../indexmanagement/transform/TransformSearchService.kt | 2 +- .../action/delete/TransportDeleteTransformsAction.kt | 2 +- .../transform/action/explain/ExplainTransformResponse.kt | 2 +- .../action/explain/TransportExplainTransformAction.kt | 2 +- .../transform/action/get/GetTransformResponse.kt | 2 +- .../transform/action/get/GetTransformsResponse.kt | 2 +- .../transform/action/get/TransportGetTransformAction.kt | 2 +- .../transform/action/get/TransportGetTransformsAction.kt | 4 ++-- .../transform/action/index/IndexTransformResponse.kt | 2 +- .../transform/action/index/TransportIndexTransformAction.kt | 2 +- .../transform/action/preview/PreviewTransformResponse.kt | 2 +- .../action/preview/TransportPreviewTransformAction.kt | 2 +- .../transform/action/start/TransportStartTransformAction.kt | 2 +- .../transform/action/stop/TransportStopTransformAction.kt | 2 +- .../transform/opensearchapi/OpenSearchExtensions.kt | 2 +- .../org/opensearch/indexmanagement/util/IndexUtils.kt | 2 +- .../opensearch/indexmanagement/util/ScheduledJobUtils.kt | 4 ++-- .../org/opensearch/indexmanagement/util/SecurityUtils.kt | 2 +- .../kotlin/org/opensearch/indexmanagement/MocksTestCase.kt | 4 ++-- .../controlcenter/notification/TestHelpers.kt | 2 +- .../controlcenter/notification/XContentTests.kt | 2 +- .../notification/filter/IndexOperationActionFilterTests.kt | 6 +++--- .../notification/filter/NotificationActionListenerTests.kt | 4 ++-- .../notification/filter/parser/ReindexRespParserTests.kt | 2 +- .../controlcenter/notification/util/LRONUtilsTests.kt | 2 +- .../indexstatemanagement/step/AttemptCloseStepTests.kt | 2 +- .../indexstatemanagement/step/AttemptDeleteStepTests.kt | 2 +- .../indexstatemanagement/step/AttemptOpenStepTests.kt | 2 +- .../step/AttemptSetIndexPriorityStepTests.kt | 2 +- .../step/AttemptSetReplicaCountStepTests.kt | 2 +- .../indexstatemanagement/step/AttemptSnapshotStepTests.kt | 2 +- .../indexstatemanagement/step/AttemptTransitionStepTests.kt | 2 +- .../indexstatemanagement/step/SetReadOnlyStepTests.kt | 2 +- .../indexstatemanagement/step/SetReadWriteStepTests.kt | 2 +- .../indexstatemanagement/step/WaitForSnapshotStepTests.kt | 2 +- .../indexmanagement/rollup/RollupMapperServiceTests.kt | 2 +- .../indexmanagement/rollup/RollupMetadataServiceTests.kt | 2 +- .../transform/opensearchapi/ExtensionsTests.kt | 2 +- 91 files changed, 104 insertions(+), 104 deletions(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementIndices.kt b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementIndices.kt index b954cd799..8eb6a5156 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementIndices.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementIndices.kt @@ -10,7 +10,7 @@ import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.Logger import org.opensearch.OpenSearchStatusException import org.opensearch.ResourceAlreadyExistsException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.alias.Alias import org.opensearch.action.admin.indices.create.CreateIndexRequest import org.opensearch.action.admin.indices.create.CreateIndexResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt index f90adacc6..8f0d3ad93 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt @@ -7,7 +7,6 @@ package org.opensearch.indexmanagement import org.apache.logging.log4j.LogManager import org.opensearch.action.ActionRequest -import org.opensearch.action.ActionResponse import org.opensearch.action.support.ActionFilter import org.opensearch.action.support.ActiveShardsObserver import org.opensearch.client.Client @@ -25,6 +24,7 @@ import org.opensearch.common.settings.Setting import org.opensearch.common.settings.Settings import org.opensearch.common.settings.SettingsFilter import org.opensearch.common.util.concurrent.ThreadContext +import org.opensearch.core.action.ActionResponse import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.core.xcontent.XContentParser.Token import org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/ControlCenterIndices.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/ControlCenterIndices.kt index 29b2f65c1..1aa70dbf1 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/ControlCenterIndices.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/ControlCenterIndices.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.controlcenter.notification import org.opensearch.ExceptionsHelper import org.opensearch.ResourceAlreadyExistsException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.create.CreateIndexRequest import org.opensearch.action.admin.indices.create.CreateIndexResponse import org.opensearch.action.support.master.AcknowledgedResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigResponse.kt index 07f0d23b0..560384ed1 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/LRONConfigResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.controlcenter.notification -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/delete/TransportDeleteLRONConfigAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/delete/TransportDeleteLRONConfigAction.kt index 9e132ec34..ea9d40fba 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/delete/TransportDeleteLRONConfigAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/delete/TransportDeleteLRONConfigAction.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.controlcenter.notification.action.delete import org.apache.logging.log4j.LogManager -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.delete.DeleteRequest import org.opensearch.action.delete.DeleteResponse import org.opensearch.action.support.ActionFilters diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigResponse.kt index edcbd980d..d59308418 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/GetLRONConfigResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.controlcenter.notification.action.get -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt index 33593d49d..6c43d93a6 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.controlcenter.notification.action.get import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.search.SearchRequest import org.opensearch.action.search.SearchResponse import org.opensearch.action.support.ActionFilters diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/TransportIndexLRONConfigAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/TransportIndexLRONConfigAction.kt index 826e4402d..811a69a8c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/TransportIndexLRONConfigAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/index/TransportIndexLRONConfigAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.controlcenter.notification.action.index import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.DocWriteRequest import org.opensearch.action.index.IndexRequest import org.opensearch.action.index.IndexResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/IndexOperationActionFilter.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/IndexOperationActionFilter.kt index c13b28d9e..6b578b4bd 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/IndexOperationActionFilter.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/IndexOperationActionFilter.kt @@ -6,18 +6,18 @@ package org.opensearch.indexmanagement.controlcenter.notification.filter import org.apache.logging.log4j.LogManager -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.support.ActionFilter import org.opensearch.action.support.ActionFilterChain import org.opensearch.action.support.ActiveShardsObserver import org.opensearch.client.Client import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.service.ClusterService +import org.opensearch.core.tasks.TaskId import org.opensearch.indexmanagement.controlcenter.notification.util.supportedActions import org.opensearch.tasks.Task -import org.opensearch.tasks.TaskId class IndexOperationActionFilter( val client: Client, diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt index 81411165c..c69409dca 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt @@ -12,9 +12,9 @@ import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch import org.apache.logging.log4j.LogManager import org.opensearch.OpenSearchStatusException -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.DocWriteResponse import org.opensearch.action.admin.indices.forcemerge.ForceMergeAction import org.opensearch.action.admin.indices.forcemerge.ForceMergeRequest @@ -58,7 +58,7 @@ import org.opensearch.indexmanagement.controlcenter.notification.filter.parser.A import org.opensearch.indexmanagement.opensearchapi.retry import org.opensearch.indexmanagement.util.OpenForTesting import org.opensearch.tasks.Task -import org.opensearch.tasks.TaskId +import org.opensearch.core.tasks.TaskId import org.opensearch.threadpool.ThreadPool.Names.GENERIC import java.util.function.Consumer diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParser.kt index f4289ea77..3e47bb55e 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParser.kt @@ -11,7 +11,7 @@ import org.opensearch.index.reindex.ReindexRequest import org.opensearch.indexmanagement.controlcenter.notification.filter.NotificationActionListener import org.opensearch.indexmanagement.controlcenter.notification.filter.OperationResult import org.opensearch.tasks.Task -import org.opensearch.tasks.TaskId +import org.opensearch.core.tasks.TaskId import java.util.function.Consumer class ReindexRespParser( diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ResponseParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ResponseParser.kt index f1453de9f..d865e8faa 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ResponseParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ResponseParser.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.controlcenter.notification.filter.parser import org.opensearch.action.ActionRequest -import org.opensearch.action.ActionResponse +import org.opensearch.core.action.ActionResponse import org.opensearch.action.IndicesRequest import org.opensearch.cluster.service.ClusterService import org.opensearch.index.reindex.ReindexRequest diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONConfig.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONConfig.kt index adffc0d9f..8dab2978a 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONConfig.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/model/LRONConfig.kt @@ -22,7 +22,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.util.WITH_TYPE import org.opensearch.indexmanagement.indexstatemanagement.util.WITH_USER import org.opensearch.indexmanagement.opensearchapi.optionalUserField import org.opensearch.indexmanagement.util.NO_ID -import org.opensearch.tasks.TaskId +import org.opensearch.core.tasks.TaskId import java.io.IOException data class LRONConfig( diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtils.kt index c06b0b511..dfcf81398 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtils.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.controlcenter.notification.util import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.forcemerge.ForceMergeAction import org.opensearch.action.admin.indices.open.OpenIndexAction import org.opensearch.action.admin.indices.shrink.ResizeAction @@ -21,7 +21,7 @@ import org.opensearch.indexmanagement.controlcenter.notification.LRONConfigRespo import org.opensearch.indexmanagement.controlcenter.notification.model.LRONConfig import org.opensearch.indexmanagement.opensearchapi.parseFromGetResponse import org.opensearch.core.rest.RestStatus -import org.opensearch.tasks.TaskId +import org.opensearch.core.tasks.TaskId const val LRON_DOC_ID_PREFIX = "LRON:" diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementHistory.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementHistory.kt index b957f7714..a3e0fd313 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementHistory.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementHistory.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement import org.apache.logging.log4j.LogManager -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.DocWriteRequest import org.opensearch.action.admin.cluster.state.ClusterStateRequest import org.opensearch.action.admin.cluster.state.ClusterStateResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/SkipExecution.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/SkipExecution.kt index 753b4f534..78ccfb299 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/SkipExecution.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/SkipExecution.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement import org.apache.logging.log4j.LogManager -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.cluster.node.info.NodesInfoAction import org.opensearch.action.admin.cluster.node.info.NodesInfoRequest import org.opensearch.action.admin.cluster.node.info.NodesInfoResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponse.kt index 15acd62bb..96bbffec6 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/ISMStatusResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/TransportAddPolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/TransportAddPolicyAction.kt index 250df26c4..da4e81d77 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/TransportAddPolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/addpolicy/TransportAddPolicyAction.kt @@ -13,7 +13,7 @@ import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchSecurityException import org.opensearch.OpenSearchStatusException import org.opensearch.OpenSearchTimeoutException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.cluster.state.ClusterStateRequest import org.opensearch.action.admin.cluster.state.ClusterStateResponse import org.opensearch.action.bulk.BulkRequest diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/TransportChangePolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/TransportChangePolicyAction.kt index e77c744ce..7dca57343 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/TransportChangePolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/changepolicy/TransportChangePolicyAction.kt @@ -12,7 +12,7 @@ import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchSecurityException import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.cluster.state.ClusterStateRequest import org.opensearch.action.admin.cluster.state.ClusterStateResponse import org.opensearch.action.bulk.BulkRequest diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/TransportDeletePolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/TransportDeletePolicyAction.kt index adfa7760e..9be3966af 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/TransportDeletePolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/deletepolicy/TransportDeletePolicyAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.del import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.delete.DeleteRequest import org.opensearch.action.delete.DeleteResponse import org.opensearch.action.get.GetRequest diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponse.kt index 25f6c5cfa..7ba09b4f0 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/ExplainResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.explain -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/TransportExplainAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/TransportExplainAction.kt index 3ea39159c..f31d8e3d1 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/TransportExplainAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/TransportExplainAction.kt @@ -11,7 +11,7 @@ import kotlinx.coroutines.launch import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchSecurityException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.cluster.state.ClusterStateRequest import org.opensearch.action.admin.cluster.state.ClusterStateResponse import org.opensearch.action.get.GetResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponse.kt index eb1b9bdd6..16dff5fe4 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPoliciesResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.getpolicy -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponse.kt index 4369a8c60..54c64be1f 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/GetPolicyResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.getpolicy -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPoliciesAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPoliciesAction.kt index 4af3f6843..607f13a49 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPoliciesAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPoliciesAction.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.get import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.search.SearchRequest import org.opensearch.action.search.SearchResponse import org.opensearch.action.support.ActionFilters diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPolicyAction.kt index 21778df1e..a54d3868e 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPolicyAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.get import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.get.GetRequest import org.opensearch.action.get.GetResponse import org.opensearch.action.support.ActionFilters diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponse.kt index 0c0e90163..f1453058b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/IndexPolicyResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.indexpolicy -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt index 11ca906b7..7240c4f77 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt @@ -9,7 +9,7 @@ import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException import org.opensearch.ResourceAlreadyExistsException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.DocWriteRequest import org.opensearch.action.index.IndexRequest import org.opensearch.action.index.IndexResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/managedIndex/TransportManagedIndexAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/managedIndex/TransportManagedIndexAction.kt index a1030eba8..4e82b38bc 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/managedIndex/TransportManagedIndexAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/managedIndex/TransportManagedIndexAction.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.managedIndex -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction import org.opensearch.action.support.master.AcknowledgedResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/TransportRemovePolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/TransportRemovePolicyAction.kt index 36250d460..2c74e4b1a 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/TransportRemovePolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/removepolicy/TransportRemovePolicyAction.kt @@ -12,7 +12,7 @@ import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchSecurityException import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.cluster.state.ClusterStateRequest import org.opensearch.action.admin.cluster.state.ClusterStateResponse import org.opensearch.action.admin.indices.settings.put.UpdateSettingsRequest diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/TransportRetryFailedManagedIndexAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/TransportRetryFailedManagedIndexAction.kt index e70a6532b..fd21528eb 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/TransportRetryFailedManagedIndexAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/retryfailedmanagedindex/TransportRetryFailedManagedIndexAction.kt @@ -12,7 +12,7 @@ import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchSecurityException import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.cluster.state.ClusterStateRequest import org.opensearch.action.admin.cluster.state.ClusterStateResponse import org.opensearch.action.bulk.BulkRequest diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/TransportUpdateManagedIndexMetaDataAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/TransportUpdateManagedIndexMetaDataAction.kt index 1e983a340..8d9f4f731 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/TransportUpdateManagedIndexMetaDataAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/updateindexmetadata/TransportUpdateManagedIndexMetaDataAction.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.transport.action.updateindexmetadata import org.apache.logging.log4j.LogManager -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.clustermanager.TransportClusterManagerNodeAction import org.opensearch.action.support.master.AcknowledgedResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt index 09e70d1da..80f460028 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt @@ -15,7 +15,7 @@ import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.Logger import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.alias.Alias import org.opensearch.action.bulk.BackoffPolicy import org.opensearch.action.get.GetResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupRunner.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupRunner.kt index 642374620..8f779a5f6 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupRunner.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupRunner.kt @@ -11,7 +11,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch import org.apache.logging.log4j.LogManager -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.bulk.BackoffPolicy import org.opensearch.action.support.WriteRequest import org.opensearch.client.Client diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupSearchService.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupSearchService.kt index b198483cf..80405878d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupSearchService.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/RollupSearchService.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.rollup import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchSecurityException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.bulk.BackoffPolicy import org.opensearch.action.search.SearchPhaseExecutionException import org.opensearch.action.search.SearchResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/TransportDeleteRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/TransportDeleteRollupAction.kt index 010467ca3..b61f70d8b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/TransportDeleteRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/delete/TransportDeleteRollupAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.rollup.action.delete import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.delete.DeleteRequest import org.opensearch.action.delete.DeleteResponse import org.opensearch.action.get.GetRequest diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupResponse.kt index 19f58e890..69ad4e260 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/ExplainRollupResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.rollup.action.explain -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/TransportExplainRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/TransportExplainRollupAction.kt index 37949189d..0d90fee45 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/TransportExplainRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/explain/TransportExplainRollupAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.rollup.action.explain import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.ResourceNotFoundException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.search.SearchRequest import org.opensearch.action.search.SearchResponse import org.opensearch.action.support.ActionFilters diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupResponse.kt index b5b184432..526fa15b7 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.rollup.action.get -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsResponse.kt index 63299ec85..d4a58291a 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/GetRollupsResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.rollup.action.get -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupAction.kt index 537e62950..76e6a18b9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupAction.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.rollup.action.get import org.apache.logging.log4j.LogManager import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.get.GetRequest import org.opensearch.action.get.GetResponse import org.opensearch.action.support.ActionFilters diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupsAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupsAction.kt index d3ec39ada..ba7da1895 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupsAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/get/TransportGetRollupsAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.rollup.action.get import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.search.SearchRequest import org.opensearch.action.search.SearchResponse import org.opensearch.action.support.ActionFilters diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupResponse.kt index ec7de7589..30f2ecccc 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/IndexRollupResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.rollup.action.index -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/TransportIndexRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/TransportIndexRollupAction.kt index 0a6412c8c..ccfcfcad8 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/TransportIndexRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/index/TransportIndexRollupAction.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.rollup.action.index import org.apache.logging.log4j.LogManager import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.DocWriteRequest import org.opensearch.action.get.GetRequest import org.opensearch.action.get.GetResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/TransportUpdateRollupMappingAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/TransportUpdateRollupMappingAction.kt index 53222e093..1a3deb9f7 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/TransportUpdateRollupMappingAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/mapping/TransportUpdateRollupMappingAction.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.rollup.action.mapping import org.apache.logging.log4j.LogManager -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.mapping.put.PutMappingRequest import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.clustermanager.TransportClusterManagerNodeAction diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/TransportStartRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/TransportStartRollupAction.kt index 133413ac8..47320ed4f 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/TransportStartRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/start/TransportStartRollupAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.rollup.action.start import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.DocWriteResponse import org.opensearch.action.get.GetRequest import org.opensearch.action.get.GetResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/TransportStopRollupAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/TransportStopRollupAction.kt index 6016e4d59..4b4487c17 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/TransportStopRollupAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/action/stop/TransportStopRollupAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.rollup.action.stop import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.DocWriteResponse import org.opensearch.action.get.GetRequest import org.opensearch.action.get.GetResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/FieldCapsFilter.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/FieldCapsFilter.kt index 8d9757b6b..f870d4fb2 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/FieldCapsFilter.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/actionfilter/FieldCapsFilter.kt @@ -6,9 +6,9 @@ package org.opensearch.indexmanagement.rollup.actionfilter import org.apache.logging.log4j.LogManager -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.fieldcaps.FieldCapabilities import org.opensearch.action.fieldcaps.FieldCapabilitiesRequest import org.opensearch.action.fieldcaps.FieldCapabilitiesResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/BaseTransportAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/BaseTransportAction.kt index 0f1587148..2adcbdc0f 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/BaseTransportAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/BaseTransportAction.kt @@ -10,9 +10,9 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import org.apache.logging.log4j.LogManager import org.opensearch.OpenSearchStatusException -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.support.ActionFilters import org.opensearch.action.support.HandledTransportAction import org.opensearch.client.Client diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyResponse.kt index fb642b677..1bc775c6d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/explain/ExplainSMPolicyResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.explain -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesResponse.kt index 04c9fd8e3..d49b86917 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPoliciesResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.get -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyResponse.kt index 2df00a5bc..e02acfd7b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/get/GetSMPolicyResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.get -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyResponse.kt index 095edf677..3b4fe8331 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/api/transport/index/IndexSMPolicyResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.snapshotmanagement.api.transport.index -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformSearchService.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformSearchService.kt index e341cba60..8709a6b98 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformSearchService.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/TransformSearchService.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.transform import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchSecurityException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.stats.IndicesStatsAction import org.opensearch.action.admin.indices.stats.IndicesStatsRequest import org.opensearch.action.admin.indices.stats.IndicesStatsResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/TransportDeleteTransformsAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/TransportDeleteTransformsAction.kt index 141cae5d3..30f3d64d5 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/TransportDeleteTransformsAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/delete/TransportDeleteTransformsAction.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.transform.action.delete import org.apache.logging.log4j.LogManager import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.bulk.BulkRequest import org.opensearch.action.bulk.BulkResponse import org.opensearch.action.delete.DeleteRequest diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformResponse.kt index 240e74eb1..1035863fb 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/ExplainTransformResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.transform.action.explain -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/TransportExplainTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/TransportExplainTransformAction.kt index e12202269..591b348c9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/TransportExplainTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/explain/TransportExplainTransformAction.kt @@ -11,7 +11,7 @@ import kotlinx.coroutines.launch import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.ResourceNotFoundException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.search.SearchRequest import org.opensearch.action.search.SearchResponse import org.opensearch.action.support.ActionFilters diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformResponse.kt index a3c3b3bf3..27adaf5d3 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.transform.action.get -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsResponse.kt index e75f8361d..bdef75c1d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/GetTransformsResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.transform.action.get -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformAction.kt index eecaefda5..6808f58df 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.transform.action.get import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.get.GetRequest import org.opensearch.action.get.GetResponse import org.opensearch.action.support.ActionFilters diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformsAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformsAction.kt index 124d7b363..97ee0512a 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformsAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/get/TransportGetTransformsAction.kt @@ -6,8 +6,8 @@ package org.opensearch.indexmanagement.transform.action.get import org.apache.logging.log4j.LogManager -import org.opensearch.action.ActionListener -import org.opensearch.action.ActionResponse +import org.opensearch.core.action.ActionListener +import org.opensearch.core.action.ActionResponse import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction import org.opensearch.client.Client diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformResponse.kt index fd43fdf4e..f6d9fd44d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/IndexTransformResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.transform.action.index -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/TransportIndexTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/TransportIndexTransformAction.kt index 5b3282529..708bfa1d2 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/TransportIndexTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/index/TransportIndexTransformAction.kt @@ -7,7 +7,7 @@ package org.opensearch.indexmanagement.transform.action.index import org.apache.logging.log4j.LogManager import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.DocWriteRequest import org.opensearch.action.admin.indices.mapping.get.GetMappingsAction import org.opensearch.action.admin.indices.mapping.get.GetMappingsRequest diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformResponse.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformResponse.kt index 8d1378510..e9120829c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformResponse.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/PreviewTransformResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.transform.action.preview -import org.opensearch.action.ActionResponse +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.core.xcontent.ToXContent diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/TransportPreviewTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/TransportPreviewTransformAction.kt index 06724e950..bb4f9219e 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/TransportPreviewTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/preview/TransportPreviewTransformAction.kt @@ -11,7 +11,7 @@ import kotlinx.coroutines.launch import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.mapping.get.GetMappingsAction import org.opensearch.action.admin.indices.mapping.get.GetMappingsRequest import org.opensearch.action.admin.indices.mapping.get.GetMappingsResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/TransportStartTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/TransportStartTransformAction.kt index 8e92798a8..9fe33feed 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/TransportStartTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/start/TransportStartTransformAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.transform.action.start import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.DocWriteResponse import org.opensearch.action.get.GetRequest import org.opensearch.action.get.GetResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/TransportStopTransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/TransportStopTransformAction.kt index 8be4b831f..71cbb006e 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/TransportStopTransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/action/stop/TransportStopTransformAction.kt @@ -8,7 +8,7 @@ package org.opensearch.indexmanagement.transform.action.stop import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.DocWriteResponse import org.opensearch.action.get.GetRequest import org.opensearch.action.get.GetResponse diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/OpenSearchExtensions.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/OpenSearchExtensions.kt index da6840acf..48897a2c7 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/OpenSearchExtensions.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/OpenSearchExtensions.kt @@ -13,7 +13,7 @@ import org.opensearch.common.unit.TimeValue import org.opensearch.indexmanagement.opensearchapi.isRetryable import org.opensearch.indexmanagement.transform.util.TransformLockManager import org.opensearch.core.rest.RestStatus -import org.opensearch.tasks.TaskCancelledException +import org.opensearch.core.tasks.TaskCancelledException import java.util.regex.Pattern /** diff --git a/src/main/kotlin/org/opensearch/indexmanagement/util/IndexUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/util/IndexUtils.kt index c3c923bec..934fde0e1 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/util/IndexUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/util/IndexUtils.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.util import org.apache.logging.log4j.LogManager -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.mapping.put.PutMappingRequest import org.opensearch.action.support.master.AcknowledgedResponse import org.opensearch.client.IndicesAdminClient diff --git a/src/main/kotlin/org/opensearch/indexmanagement/util/ScheduledJobUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/util/ScheduledJobUtils.kt index 0a637c7b5..6880dd9c7 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/util/ScheduledJobUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/util/ScheduledJobUtils.kt @@ -7,8 +7,8 @@ package org.opensearch.indexmanagement.util import org.opensearch.ExceptionsHelper import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener -import org.opensearch.action.ActionResponse +import org.opensearch.core.action.ActionListener +import org.opensearch.core.action.ActionResponse import org.opensearch.action.search.SearchRequest import org.opensearch.action.search.SearchResponse import org.opensearch.client.Client diff --git a/src/main/kotlin/org/opensearch/indexmanagement/util/SecurityUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/util/SecurityUtils.kt index 9aa18dbd3..b087a4a7a 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/util/SecurityUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/util/SecurityUtils.kt @@ -6,7 +6,7 @@ package org.opensearch.indexmanagement.util import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.common.util.concurrent.ThreadContext import org.opensearch.commons.ConfigConstants import org.opensearch.commons.authuser.User diff --git a/src/test/kotlin/org/opensearch/indexmanagement/MocksTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/MocksTestCase.kt index 8b22086d8..43f1c075d 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/MocksTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/MocksTestCase.kt @@ -11,8 +11,8 @@ import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import org.junit.Before import org.mockito.Mockito -import org.opensearch.action.ActionListener -import org.opensearch.action.ActionResponse +import org.opensearch.core.action.ActionListener +import org.opensearch.core.action.ActionResponse import org.opensearch.action.index.IndexResponse import org.opensearch.client.AdminClient import org.opensearch.client.Client diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/TestHelpers.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/TestHelpers.kt index bf4b7413a..b1ca9a2fb 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/TestHelpers.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/TestHelpers.kt @@ -22,7 +22,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.randomChannel import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.opensearchapi.string import org.opensearch.indexmanagement.randomUser -import org.opensearch.tasks.TaskId +import org.opensearch.core.tasks.TaskId import org.opensearch.test.OpenSearchTestCase.randomBoolean import org.opensearch.test.OpenSearchTestCase.randomLong import org.opensearch.test.rest.OpenSearchRestTestCase diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/XContentTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/XContentTests.kt index 526d690a3..5cd779ada 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/XContentTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/XContentTests.kt @@ -23,7 +23,7 @@ import org.opensearch.indexmanagement.controlcenter.notification.action.get.GetL import org.opensearch.indexmanagement.opensearchapi.parseWithType import org.opensearch.indexmanagement.opensearchapi.string import org.opensearch.indexmanagement.randomUser -import org.opensearch.tasks.TaskId +import org.opensearch.core.tasks.TaskId import org.opensearch.test.OpenSearchTestCase class XContentTests : OpenSearchTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/IndexOperationActionFilterTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/IndexOperationActionFilterTests.kt index 76c823347..8a1a13f9d 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/IndexOperationActionFilterTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/IndexOperationActionFilterTests.kt @@ -8,8 +8,8 @@ package org.opensearch.indexmanagement.controlcenter.notification.filter import org.junit.Assert import org.junit.Before import org.mockito.Mockito -import org.opensearch.action.ActionListener -import org.opensearch.action.ActionResponse +import org.opensearch.core.action.ActionListener +import org.opensearch.core.action.ActionResponse import org.opensearch.action.admin.indices.forcemerge.ForceMergeAction import org.opensearch.action.admin.indices.open.OpenIndexAction import org.opensearch.action.admin.indices.shrink.ResizeAction @@ -22,7 +22,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.index.reindex.ReindexAction import org.opensearch.index.reindex.ReindexRequest import org.opensearch.tasks.Task -import org.opensearch.tasks.TaskId +import org.opensearch.core.tasks.TaskId import org.opensearch.threadpool.ThreadPool class IndexOperationActionFilterTests : OpenSearchAllocationTestCase() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListenerTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListenerTests.kt index bee22f4f0..29797757c 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListenerTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListenerTests.kt @@ -8,9 +8,9 @@ package org.opensearch.indexmanagement.controlcenter.notification.filter import org.junit.Assert import org.junit.Before import org.mockito.Mockito.mock -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.support.ActiveShardsObserver import org.opensearch.client.Client import org.opensearch.cluster.metadata.IndexNameExpressionResolver diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParserTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParserTests.kt index 9a834448b..ddaed9112 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParserTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/parser/ReindexRespParserTests.kt @@ -17,7 +17,7 @@ import org.opensearch.index.reindex.ReindexAction import org.opensearch.index.reindex.ReindexRequest import org.opensearch.indexmanagement.controlcenter.notification.filter.OperationResult import org.opensearch.tasks.Task -import org.opensearch.tasks.TaskId +import org.opensearch.core.tasks.TaskId import java.lang.Exception import java.util.concurrent.TimeUnit diff --git a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtilsTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtilsTests.kt index 6be83959a..527cf2401 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtilsTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/controlcenter/notification/util/LRONUtilsTests.kt @@ -9,7 +9,7 @@ import org.junit.Assert import org.opensearch.index.reindex.ReindexAction import org.opensearch.indexmanagement.controlcenter.notification.randomActionName import org.opensearch.indexmanagement.controlcenter.notification.randomTaskId -import org.opensearch.tasks.TaskId +import org.opensearch.core.tasks.TaskId import org.opensearch.test.OpenSearchTestCase import kotlin.IllegalArgumentException diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCloseStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCloseStepTests.kt index 147268227..68af07ac0 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCloseStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCloseStepTests.kt @@ -11,7 +11,7 @@ import com.nhaarman.mockitokotlin2.doReturn import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.close.CloseIndexResponse import org.opensearch.client.AdminClient import org.opensearch.client.Client diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptDeleteStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptDeleteStepTests.kt index d5faa4e48..4748e2107 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptDeleteStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptDeleteStepTests.kt @@ -11,7 +11,7 @@ import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking import org.mockito.Mockito.doAnswer -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.support.master.AcknowledgedResponse import org.opensearch.client.AdminClient import org.opensearch.client.Client diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptOpenStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptOpenStepTests.kt index fe70954ba..c7996be55 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptOpenStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptOpenStepTests.kt @@ -11,7 +11,7 @@ import com.nhaarman.mockitokotlin2.doReturn import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.open.OpenIndexResponse import org.opensearch.client.AdminClient import org.opensearch.client.Client diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSetIndexPriorityStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSetIndexPriorityStepTests.kt index e3248ae4d..4a4e33ae9 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSetIndexPriorityStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSetIndexPriorityStepTests.kt @@ -11,7 +11,7 @@ import com.nhaarman.mockitokotlin2.doReturn import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.support.master.AcknowledgedResponse import org.opensearch.client.AdminClient import org.opensearch.client.Client diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSetReplicaCountStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSetReplicaCountStepTests.kt index 4959a46d4..9256c5a83 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSetReplicaCountStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSetReplicaCountStepTests.kt @@ -11,7 +11,7 @@ import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking import org.mockito.Mockito.doAnswer -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.support.master.AcknowledgedResponse import org.opensearch.client.AdminClient import org.opensearch.client.Client diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSnapshotStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSnapshotStepTests.kt index aa7292d16..646f64964 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSnapshotStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptSnapshotStepTests.kt @@ -13,7 +13,7 @@ import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking import org.junit.Before -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse import org.opensearch.client.AdminClient import org.opensearch.client.Client diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptTransitionStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptTransitionStepTests.kt index 223e20912..158cc8d18 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptTransitionStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptTransitionStepTests.kt @@ -12,7 +12,7 @@ import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking import org.junit.Before -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.rollover.RolloverInfo import org.opensearch.action.admin.indices.stats.CommonStats import org.opensearch.action.admin.indices.stats.IndicesStatsResponse diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadOnlyStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadOnlyStepTests.kt index 8501f6d24..f46d142b3 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadOnlyStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadOnlyStepTests.kt @@ -11,7 +11,7 @@ import com.nhaarman.mockitokotlin2.doReturn import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.support.master.AcknowledgedResponse import org.opensearch.client.AdminClient import org.opensearch.client.Client diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadWriteStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadWriteStepTests.kt index 6c56fadb5..f42f92c82 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadWriteStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadWriteStepTests.kt @@ -11,7 +11,7 @@ import com.nhaarman.mockitokotlin2.doReturn import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.support.master.AcknowledgedResponse import org.opensearch.client.AdminClient import org.opensearch.client.Client diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForSnapshotStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForSnapshotStepTests.kt index 14f22918d..b30084392 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForSnapshotStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForSnapshotStepTests.kt @@ -11,7 +11,7 @@ import com.nhaarman.mockitokotlin2.doReturn import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.cluster.snapshots.status.SnapshotStatus import org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse import org.opensearch.client.AdminClient diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMapperServiceTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMapperServiceTests.kt index 5d8004107..fdaa225aa 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMapperServiceTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMapperServiceTests.kt @@ -13,7 +13,7 @@ import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking import org.mockito.ArgumentMatchers.anyBoolean -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.admin.indices.mapping.get.GetMappingsResponse import org.opensearch.client.AdminClient import org.opensearch.client.Client diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMetadataServiceTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMetadataServiceTests.kt index e4180a734..b181a9f4b 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMetadataServiceTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/RollupMetadataServiceTests.kt @@ -12,7 +12,7 @@ import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking import org.junit.Before -import org.opensearch.action.ActionListener +import org.opensearch.core.action.ActionListener import org.opensearch.action.DocWriteResponse import org.opensearch.action.get.GetResponse import org.opensearch.action.index.IndexResponse diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/ExtensionsTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/ExtensionsTests.kt index 0482c2c66..605b49b5b 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/ExtensionsTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/opensearchapi/ExtensionsTests.kt @@ -9,7 +9,7 @@ import org.junit.Assert import org.opensearch.OpenSearchException import org.opensearch.indexmanagement.util.IndexManagementException import org.opensearch.core.rest.RestStatus -import org.opensearch.tasks.TaskCancelledException +import org.opensearch.core.tasks.TaskCancelledException import org.opensearch.test.OpenSearchTestCase class ExtensionsTests : OpenSearchTestCase() { From 3ec3c3ec57b38ea1f52ca271d4112f4ff084b645 Mon Sep 17 00:00:00 2001 From: bowenlan-amzn Date: Thu, 31 Aug 2023 20:36:37 -0700 Subject: [PATCH 16/29] Support copy alias in rollover (#907) * Support copy alias in rollover Signed-off-by: bowenlan-amzn * 2.10 Signed-off-by: bowenlan-amzn --------- Signed-off-by: bowenlan-amzn Signed-off-by: Tanqiu Liu --- build.gradle | 73 +++--- .../model/ManagedIndexMetaData.kt | 48 ++-- .../action/RolloverAction.kt | 4 + .../action/RolloverActionParser.kt | 7 +- .../step/rollover/AttemptRolloverStep.kt | 115 +++++++++- .../util/ManagedIndexUtils.kt | 1 + .../mappings/opendistro-ism-config.json | 8 +- .../mappings/opendistro-ism-history.json | 3 + .../IndexManagementRestTestCase.kt | 20 +- .../bwc/ISMBackwardsCompatibilityIT.kt | 217 ++++++++++++++++++ .../IndexStateManagementRestTestCase.kt | 25 +- .../action/RolloverActionIT.kt | 124 +++++++++- .../step/AttemptRolloverStepTests.kt | 194 ++++++++++++++++ .../validation/ValidateRolloverIT.kt | 8 +- .../validation/ValidateRolloverTests.kt | 2 +- .../cached-opendistro-ism-config.json | 6 + .../cached-opendistro-ism-history.json | 3 + 17 files changed, 765 insertions(+), 93 deletions(-) create mode 100644 src/test/kotlin/org/opensearch/indexmanagement/bwc/ISMBackwardsCompatibilityIT.kt create mode 100644 src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptRolloverStepTests.kt diff --git a/build.gradle b/build.gradle index a589189e1..3d91528c5 100644 --- a/build.gradle +++ b/build.gradle @@ -613,49 +613,43 @@ task integTestRemote(type: RestIntegTestTask) { // === Set up BWC tests === -String bwcVersionShort = "2.5.0" +String bwcVersionShort = "2.10.0" String bwcVersion = bwcVersionShort + ".0" String baseName = "indexmanagementBwcCluster" -String bwcFilePath = "src/test/resources/bwc/" -String bwc_js_resource_location = bwcFilePath + "job-scheduler/" + bwcVersion -String bwc_im_resource_location = bwcFilePath + "indexmanagement/" + bwcVersion -// Downloads the bwc job scheduler version -String bwc_js_download_url = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + bwcVersionShort + '/latest/linux/x64/tar/builds/' + - 'opensearch/plugins/opensearch-job-scheduler-' + bwcVersion + '.zip' - -// Downloads the bwc index management version -String bwc_im_download_url = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + bwcVersionShort + '/latest/linux/x64/tar/builds/' + - 'opensearch/plugins/opensearch-index-management-' + bwcVersion + '.zip' - -2.times { i -> +configurations { + bwcZip +} +dependencies { + bwcZip "org.opensearch.plugin:opensearch-job-scheduler:${bwcVersion}-SNAPSHOT@zip" + bwcZip "org.opensearch.plugin:opensearch-index-management:${bwcVersion}-SNAPSHOT@zip" +} +ext.resolvebwcZipFile = { pluginId -> + return new Callable() { + @Override + RegularFile call() throws Exception { + return new RegularFile() { + @Override + File getAsFile() { + return configurations.bwcZip.resolvedConfiguration.resolvedArtifacts + .find { ResolvedArtifact f -> + f.name.startsWith(pluginId) + } + .file + } + } + } + } +} +Integer bwcNumNodes = 3 +2.times {i -> testClusters { "${baseName}$i" { testDistribution = "ARCHIVE" versions = [bwcVersionShort, opensearch_version] - numberOfNodes = 3 - plugin(provider(new Callable() { - @Override - RegularFile call() throws Exception { - return new RegularFile() { - @Override - File getAsFile() { - return getPluginResource(bwc_js_resource_location, bwc_js_download_url) - } - } - } - })) - plugin(provider(new Callable() { - @Override - RegularFile call() throws Exception { - return new RegularFile() { - @Override - File getAsFile() { - return getPluginResource(bwc_im_resource_location, bwc_im_download_url) - } - } - } - })) + numberOfNodes = bwcNumNodes + plugin(provider(resolvebwcZipFile("opensearch-job-scheduler"))) + plugin(provider(resolvebwcZipFile("opensearch-index-management"))) setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" setting 'http.content_type.required', 'true' } @@ -690,6 +684,7 @@ task prepareBwcTests { nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}$i".allHttpSocketURI.join(",")}") nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}$i".getName()}") systemProperty 'tests.security.manager', 'false' + systemProperty 'cluster.number_of_nodes', "${bwcNumNodes}" } } @@ -714,6 +709,7 @@ task "${baseName}#oneThirdsUpgradeCluster"(type: StandaloneRestIntegTestTask) { nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}") nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}") systemProperty 'tests.security.manager', 'false' + systemProperty 'cluster.number_of_nodes', "${bwcNumNodes}" } // Upgrade the second node to new OpenSearch version with upgraded plugin version after the first node is upgraded. @@ -734,6 +730,7 @@ task "${baseName}#twoThirdsUpgradedClusterTask"(type: StandaloneRestIntegTestTas nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}") nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}") systemProperty 'tests.security.manager', 'false' + systemProperty 'cluster.number_of_nodes', "${bwcNumNodes}" } // Upgrade the third node to new OpenSearch version with upgraded plugin version after the second node is upgraded. @@ -754,6 +751,7 @@ task "${baseName}#rollingUpgradeClusterTask"(type: StandaloneRestIntegTestTask) nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}0".allHttpSocketURI.join(",")}") nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}0".getName()}") systemProperty 'tests.security.manager', 'false' + systemProperty 'cluster.number_of_nodes', "${bwcNumNodes}" } // Upgrade all the nodes of the old cluster to new OpenSearch version with upgraded plugin version @@ -772,6 +770,7 @@ task "${baseName}#fullRestartClusterTask"(type: StandaloneRestIntegTestTask) { nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}1".allHttpSocketURI.join(",")}") nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}1".getName()}") systemProperty 'tests.security.manager', 'false' + systemProperty 'cluster.number_of_nodes', "${bwcNumNodes}" } // A bwc test suite which runs all the bwc tasks combined @@ -779,7 +778,7 @@ task bwcTestSuite(type: StandaloneRestIntegTestTask) { exclude '**/*Test*' exclude '**/*IT*' // TODO refactor bwc test #677 - // dependsOn tasks.named("${baseName}#rollingUpgradeClusterTask") + dependsOn tasks.named("${baseName}#rollingUpgradeClusterTask") dependsOn tasks.named("${baseName}#fullRestartClusterTask") } diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt index 90186c042..f099bb788 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/ManagedIndexMetaData.kt @@ -37,7 +37,8 @@ data class ManagedIndexMetaData( val info: Map?, val id: String = NO_ID, val seqNo: Long = SequenceNumbers.UNASSIGNED_SEQ_NO, - val primaryTerm: Long = SequenceNumbers.UNASSIGNED_PRIMARY_TERM + val primaryTerm: Long = SequenceNumbers.UNASSIGNED_PRIMARY_TERM, + val rolledOverIndexName: String? = null, ) : Writeable, ToXContentFragment { @Suppress("ComplexMethod") @@ -50,6 +51,7 @@ data class ManagedIndexMetaData( if (policyPrimaryTerm != null) resultMap[POLICY_PRIMARY_TERM] = policyPrimaryTerm.toString() if (policyCompleted != null) resultMap[POLICY_COMPLETED] = policyCompleted.toString() if (rolledOver != null) resultMap[ROLLED_OVER] = rolledOver.toString() + if (rolledOverIndexName != null) resultMap[ROLLED_OVER_INDEX_NAME] = rolledOverIndexName if (indexCreationDate != null) resultMap[INDEX_CREATION_DATE] = indexCreationDate.toString() if (transitionTo != null) resultMap[TRANSITION_TO] = transitionTo if (stateMetaData != null) resultMap[StateMetaData.STATE] = stateMetaData.getMapValueString() @@ -75,6 +77,7 @@ data class ManagedIndexMetaData( .field(POLICY_PRIMARY_TERM, policyPrimaryTerm) .field(POLICY_COMPLETED, policyCompleted) .field(ROLLED_OVER, rolledOver) + .field(ROLLED_OVER_INDEX_NAME, rolledOverIndexName) .field(INDEX_CREATION_DATE, indexCreationDate) .field(TRANSITION_TO, transitionTo) .addObject(StateMetaData.STATE, stateMetaData, params, true) @@ -109,6 +112,7 @@ data class ManagedIndexMetaData( // Only show rolled_over if we have rolled over or we are in the rollover action if (rolledOver == true || (actionMetaData != null && actionMetaData.name == "rollover")) { builder.field(ROLLED_OVER, rolledOver) + if (rolledOverIndexName != null) builder.field(ROLLED_OVER_INDEX_NAME, rolledOverIndexName) } if (indexCreationDate != null) builder.field(INDEX_CREATION_DATE, indexCreationDate) @@ -141,6 +145,7 @@ data class ManagedIndexMetaData( streamOutput.writeOptionalLong(policyPrimaryTerm) streamOutput.writeOptionalBoolean(policyCompleted) streamOutput.writeOptionalBoolean(rolledOver) + streamOutput.writeOptionalString(rolledOverIndexName) streamOutput.writeOptionalLong(indexCreationDate) streamOutput.writeOptionalString(transitionTo) @@ -171,6 +176,7 @@ data class ManagedIndexMetaData( const val POLICY_PRIMARY_TERM = "policy_primary_term" const val POLICY_COMPLETED = "policy_completed" const val ROLLED_OVER = "rolled_over" + const val ROLLED_OVER_INDEX_NAME = "rolled_over_index_name" const val INDEX_CREATION_DATE = "index_creation_date" const val TRANSITION_TO = "transition_to" const val INFO = "info" @@ -184,6 +190,7 @@ data class ManagedIndexMetaData( val policyPrimaryTerm: Long? = si.readOptionalLong() val policyCompleted: Boolean? = si.readOptionalBoolean() val rolledOver: Boolean? = si.readOptionalBoolean() + val rolledOverIndexName: String? = si.readOptionalString() val indexCreationDate: Long? = si.readOptionalLong() val transitionTo: String? = si.readOptionalString() @@ -206,6 +213,7 @@ data class ManagedIndexMetaData( policyPrimaryTerm = policyPrimaryTerm, policyCompleted = policyCompleted, rolledOver = rolledOver, + rolledOverIndexName = rolledOverIndexName, indexCreationDate = indexCreationDate, transitionTo = transitionTo, stateMetaData = state, @@ -233,6 +241,7 @@ data class ManagedIndexMetaData( var policyPrimaryTerm: Long? = null var policyCompleted: Boolean? = null var rolledOver: Boolean? = null + var rolledOverIndexName: String? = null var indexCreationDate: Long? = null var transitionTo: String? = null @@ -255,6 +264,7 @@ data class ManagedIndexMetaData( POLICY_PRIMARY_TERM -> policyPrimaryTerm = if (xcp.currentToken() == XContentParser.Token.VALUE_NULL) null else xcp.longValue() POLICY_COMPLETED -> policyCompleted = if (xcp.currentToken() == XContentParser.Token.VALUE_NULL) null else xcp.booleanValue() ROLLED_OVER -> rolledOver = if (xcp.currentToken() == XContentParser.Token.VALUE_NULL) null else xcp.booleanValue() + ROLLED_OVER_INDEX_NAME -> rolledOverIndexName = if (xcp.currentToken() == XContentParser.Token.VALUE_NULL) null else xcp.text() INDEX_CREATION_DATE -> indexCreationDate = if (xcp.currentToken() == XContentParser.Token.VALUE_NULL) null else xcp.longValue() TRANSITION_TO -> transitionTo = if (xcp.currentToken() == XContentParser.Token.VALUE_NULL) null else xcp.text() StateMetaData.STATE -> { @@ -276,23 +286,24 @@ data class ManagedIndexMetaData( } return ManagedIndexMetaData( - requireNotNull(index) { "$INDEX is null" }, - requireNotNull(indexUuid) { "$INDEX_UUID is null" }, - requireNotNull(policyID) { "$POLICY_ID is null" }, - policySeqNo, - policyPrimaryTerm, - policyCompleted, - rolledOver, - indexCreationDate, - transitionTo, - state, - action, - step, - retryInfo, - info, - id, - seqNo, - primaryTerm + index = requireNotNull(index) { "$INDEX is null" }, + indexUuid = requireNotNull(indexUuid) { "$INDEX_UUID is null" }, + policyID = requireNotNull(policyID) { "$POLICY_ID is null" }, + policySeqNo = policySeqNo, + policyPrimaryTerm = policyPrimaryTerm, + policyCompleted = policyCompleted, + rolledOver = rolledOver, + rolledOverIndexName = rolledOverIndexName, + indexCreationDate = indexCreationDate, + transitionTo = transitionTo, + stateMetaData = state, + actionMetaData = action, + stepMetaData = step, + policyRetryInfo = retryInfo, + info = info, + id = id, + seqNo = seqNo, + primaryTerm = primaryTerm, ) } @@ -322,6 +333,7 @@ data class ManagedIndexMetaData( policyPrimaryTerm = map[POLICY_PRIMARY_TERM]?.toLong(), policyCompleted = map[POLICY_COMPLETED]?.toBoolean(), rolledOver = map[ROLLED_OVER]?.toBoolean(), + rolledOverIndexName = map[ROLLED_OVER_INDEX_NAME], indexCreationDate = map[INDEX_CREATION_DATE]?.toLong(), transitionTo = map[TRANSITION_TO], stateMetaData = StateMetaData.fromManagedIndexMetaDataMap(map), diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt index 196f4d818..def34512a 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverAction.kt @@ -20,6 +20,7 @@ class RolloverAction( val minDocs: Long?, val minAge: TimeValue?, val minPrimaryShardSize: ByteSizeValue?, + val copyAlias: Boolean = false, index: Int ) : Action(name, index) { @@ -47,6 +48,7 @@ class RolloverAction( if (minDocs != null) builder.field(MIN_DOC_COUNT_FIELD, minDocs) if (minAge != null) builder.field(MIN_INDEX_AGE_FIELD, minAge.stringRep) if (minPrimaryShardSize != null) builder.field(MIN_PRIMARY_SHARD_SIZE_FIELD, minPrimaryShardSize.stringRep) + builder.field(COPY_ALIAS_FIELD, copyAlias) builder.endObject() } @@ -55,6 +57,7 @@ class RolloverAction( out.writeOptionalLong(minDocs) out.writeOptionalTimeValue(minAge) out.writeOptionalWriteable(minPrimaryShardSize) + out.writeBoolean(copyAlias) out.writeInt(actionIndex) } @@ -64,5 +67,6 @@ class RolloverAction( const val MIN_DOC_COUNT_FIELD = "min_doc_count" const val MIN_INDEX_AGE_FIELD = "min_index_age" const val MIN_PRIMARY_SHARD_SIZE_FIELD = "min_primary_shard_size" + const val COPY_ALIAS_FIELD = "copy_alias" } } diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt index 379ef54b9..5da00a714 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionParser.kt @@ -19,9 +19,10 @@ class RolloverActionParser : ActionParser() { val minDocs = sin.readOptionalLong() val minAge = sin.readOptionalTimeValue() val minPrimaryShardSize = sin.readOptionalWriteable(::ByteSizeValue) + val copyAlias = sin.readBoolean() val index = sin.readInt() - return RolloverAction(minSize, minDocs, minAge, minPrimaryShardSize, index) + return RolloverAction(minSize, minDocs, minAge, minPrimaryShardSize, copyAlias, index) } override fun fromXContent(xcp: XContentParser, index: Int): Action { @@ -29,6 +30,7 @@ class RolloverActionParser : ActionParser() { var minDocs: Long? = null var minAge: TimeValue? = null var minPrimaryShardSize: ByteSizeValue? = null + var copyAlias = false ensureExpectedToken(XContentParser.Token.START_OBJECT, xcp.currentToken(), xcp) while (xcp.nextToken() != XContentParser.Token.END_OBJECT) { @@ -44,11 +46,12 @@ class RolloverActionParser : ActionParser() { RolloverAction .MIN_PRIMARY_SHARD_SIZE_FIELD ) + RolloverAction.COPY_ALIAS_FIELD -> copyAlias = xcp.booleanValue() else -> throw IllegalArgumentException("Invalid field: [$fieldName] found in RolloverAction.") } } - return RolloverAction(minSize, minDocs, minAge, minPrimaryShardSize, index) + return RolloverAction(minSize, minDocs, minAge, minPrimaryShardSize, copyAlias, index) } override fun getActionType(): String { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt index a58dc98f6..663e1bee2 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/rollover/AttemptRolloverStep.kt @@ -7,12 +7,18 @@ package org.opensearch.indexmanagement.indexstatemanagement.step.rollover import org.apache.logging.log4j.LogManager import org.opensearch.ExceptionsHelper +import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest +import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions import org.opensearch.action.admin.indices.rollover.RolloverRequest import org.opensearch.action.admin.indices.rollover.RolloverResponse import org.opensearch.action.admin.indices.stats.IndicesStatsRequest import org.opensearch.action.admin.indices.stats.IndicesStatsResponse import org.opensearch.core.common.unit.ByteSizeValue +import org.opensearch.action.support.master.AcknowledgedResponse +import org.opensearch.client.Client +import org.opensearch.cluster.service.ClusterService import org.opensearch.common.unit.TimeValue +import org.opensearch.index.IndexNotFoundException import org.opensearch.indexmanagement.indexstatemanagement.action.RolloverAction import org.opensearch.indexmanagement.indexstatemanagement.opensearchapi.getRolloverAlias import org.opensearch.indexmanagement.indexstatemanagement.opensearchapi.getRolloverSkip @@ -33,6 +39,7 @@ class AttemptRolloverStep(private val action: RolloverAction) : Step(name) { private val logger = LogManager.getLogger(javaClass) private var stepStatus = StepStatus.STARTING private var info: Map? = null + private var newIndex: String? = null // this variable holds the new index name if rollover is successful in this run @Suppress("ComplexMethod", "LongMethod") override suspend fun execute(): Step { @@ -53,6 +60,9 @@ class AttemptRolloverStep(private val action: RolloverAction) : Step(name) { if (clusterService.state().metadata.index(indexName).rolloverInfos.containsKey(rolloverTarget)) { stepStatus = StepStatus.COMPLETED info = mapOf("message" to getAlreadyRolledOverMessage(indexName, rolloverTarget)) + + // If already rolled over, alias may not get copied over yet + copyAlias(clusterService, indexName, context.client, rolloverTarget, context.metadata) return this } @@ -114,6 +124,7 @@ class AttemptRolloverStep(private val action: RolloverAction) : Step(name) { " numDocs=$numDocs, indexSize=${indexSize.bytes}, primaryShardSize=${largestPrimaryShardSize.bytes}]" ) executeRollover(context, rolloverTarget, isDataStream, conditions) + copyAlias(clusterService, indexName, context.client, rolloverTarget, context.metadata) } else { stepStatus = StepStatus.CONDITION_NOT_MET info = mapOf("message" to getPendingMessage(indexName), "conditions" to conditions) @@ -158,14 +169,14 @@ class AttemptRolloverStep(private val action: RolloverAction) : Step(name) { val indexName = context.metadata.index val metadata = context.clusterService.state().metadata val indexAlias = metadata.index(indexName)?.aliases?.get(alias) - logger.debug("Index $indexName has aliases $indexAlias") + logger.debug("Index {} has aliases {}", indexName, indexAlias) if (indexAlias == null) { return false } val isWriteIndex = indexAlias.writeIndex() // this could be null if (isWriteIndex != true) { val aliasIndices = metadata.indicesLookup[alias]?.indices?.map { it.index } - logger.debug("Alias $alias contains indices $aliasIndices") + logger.debug("Alias {} contains indices {}", alias, aliasIndices) if (aliasIndices != null && aliasIndices.size > 1) { return false } @@ -225,6 +236,9 @@ class AttemptRolloverStep(private val action: RolloverAction) : Step(name) { else -> getSuccessMessage(indexName) } + // Save newIndex later to metadata to be reused in case of failures + newIndex = response.newIndex + stepStatus = StepStatus.COMPLETED info = listOfNotNull( "message" to message, @@ -251,21 +265,104 @@ class AttemptRolloverStep(private val action: RolloverAction) : Step(name) { } } + /** + * This method should be called ASAP after rollover succeed + * + * Rollover currently only copy the alias being rolled over on to new index + * This method copy any remaining aliases to new index + * + * TODO This method can be deprecated once this issue finished + * https://github.com/opensearch-project/index-management/issues/849 finished + */ + @Suppress("ComplexMethod") + private suspend fun copyAlias( + clusterService: ClusterService, + indexName: String, + client: Client, + rolloverTarget: String, + metadata: ManagedIndexMetaData + ) { + if (!action.copyAlias) return + + // Try to preserve the rollover conditions + val conditions = info?.get("conditions") ?: context?.metadata?.info?.get("conditions") + + val rolledOverIndexName = newIndex ?: metadata.rolledOverIndexName + if (rolledOverIndexName == null) { + // Only in rare case when the program shut down unexpectedly before rolledOverIndexName is set or metadata corrupted + // ISM cannot auto recover from this case, so the status is COMPLETED + logger.error("$indexName rolled over but cannot find the rolledOverIndexName to copy aliases to") + stepStatus = StepStatus.COMPLETED + info = listOfNotNull( + "message" to getCopyAliasRolledOverIndexNotFoundMessage(indexName), + if (conditions != null) "conditions" to conditions else null + ).toMap() + return + } + + val aliasActions = mutableListOf() + val aliases = clusterService.state().metadata().index(indexName).aliases + for (alias in aliases) { + val aliasName = alias.key + // Skip the alias that has been rolled over on, since it's already copied + if (aliasName == rolloverTarget) continue + + val aliasMetadata = alias.value + val aliasAction = AliasActions(AliasActions.Type.ADD).index(rolledOverIndexName) + .alias(aliasMetadata.alias) + .filter(aliasMetadata.filter?.toString()) + .searchRouting(aliasMetadata.searchRouting) + .indexRouting(aliasMetadata.indexRouting) + .isHidden(aliasMetadata.isHidden) + aliasActions.add(aliasAction) + } + val aliasReq = IndicesAliasesRequest() + aliasActions.forEach { aliasReq.addAliasAction(it) } + + try { + val aliasRes: AcknowledgedResponse = client.admin().indices().suspendUntil { aliases(aliasReq, it) } + if (aliasRes.isAcknowledged) { + stepStatus = StepStatus.COMPLETED + info = listOfNotNull( + "message" to getSuccessCopyAliasMessage(indexName, rolledOverIndexName), + if (conditions != null) "conditions" to conditions else null + ).toMap() + } else { + stepStatus = StepStatus.FAILED + info = listOfNotNull( + "message" to getCopyAliasNotAckMessage(indexName, rolledOverIndexName), + if (conditions != null) "conditions" to conditions else null + ).toMap() + } + } catch (e: IndexNotFoundException) { + logger.error("Index not found while copying alias from $indexName to $rolledOverIndexName", e) + stepStatus = StepStatus.FAILED + info = listOfNotNull( + "message" to getCopyAliasIndexNotFoundMessage(rolledOverIndexName), + if (conditions != null) "conditions" to conditions else null + ).toMap() + } catch (e: Exception) { + handleException(indexName, e, getFailedCopyAliasMessage(indexName, rolledOverIndexName), conditions) + } + } + override fun getUpdatedManagedIndexMetadata(currentMetadata: ManagedIndexMetaData): ManagedIndexMetaData { return currentMetadata.copy( stepMetaData = StepMetaData(name, getStepStartTime(currentMetadata).toEpochMilli(), stepStatus), rolledOver = if (currentMetadata.rolledOver == true) true else stepStatus == StepStatus.COMPLETED, + rolledOverIndexName = if (currentMetadata.rolledOverIndexName != null) currentMetadata.rolledOverIndexName else newIndex, transitionTo = null, info = info ) } - private fun handleException(indexName: String, e: Exception, message: String = getFailedMessage(indexName)) { + private fun handleException(indexName: String, e: Exception, message: String = getFailedMessage(indexName), conditions: Any? = null) { logger.error(message, e) stepStatus = StepStatus.FAILED - val mutableInfo = mutableMapOf("message" to message) + val mutableInfo: MutableMap = mutableMapOf("message" to message) val errorMessage = e.message if (errorMessage != null) mutableInfo["cause"] = errorMessage + if (conditions != null) mutableInfo["conditions"] = conditions info = mutableInfo.toMap() } @@ -288,5 +385,15 @@ class AttemptRolloverStep(private val action: RolloverAction) : Step(name) { fun getSkipRolloverMessage(index: String) = "Skipped rollover action for [index=$index]" fun getAlreadyRolledOverMessage(index: String, alias: String) = "This index has already been rolled over using this alias, treating as a success [index=$index, alias=$alias]" + fun getSuccessCopyAliasMessage(index: String, newIndex: String) = + "Successfully rolled over and copied alias from [index=$index] to [index=$newIndex]" + fun getFailedCopyAliasMessage(index: String, newIndex: String) = + "Successfully rolled over but failed to copied alias from [index=$index] to [index=$newIndex]" + fun getCopyAliasNotAckMessage(index: String, newIndex: String) = + "Successfully rolled over but copy alias from [index=$index] to [index=$newIndex] is not acknowledged" + fun getCopyAliasIndexNotFoundMessage(newIndex: String?) = + "Successfully rolled over but new index [index=$newIndex] not found during copy alias" + fun getCopyAliasRolledOverIndexNotFoundMessage(index: String?) = + "Successfully rolled over [index=$index] but ISM cannot find rolled over index from metadata to copy aliases to, please manually copy" } } diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt index c4f31bc87..25edb2039 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt @@ -367,6 +367,7 @@ fun ManagedIndexMetaData.getCompletedManagedIndexMetaData( return this.copy( policyCompleted = updatedStepMetaData.policyCompleted, rolledOver = updatedStepMetaData.rolledOver, + rolledOverIndexName = updatedStepMetaData.rolledOverIndexName, actionMetaData = updatedActionMetaData, stepMetaData = updatedStepMetaData.stepMetaData, transitionTo = updatedStepMetaData.transitionTo, diff --git a/src/main/resources/mappings/opendistro-ism-config.json b/src/main/resources/mappings/opendistro-ism-config.json index b4dd9ceb9..49e515885 100644 --- a/src/main/resources/mappings/opendistro-ism-config.json +++ b/src/main/resources/mappings/opendistro-ism-config.json @@ -1,6 +1,6 @@ { "_meta" : { - "schema_version": 18 + "schema_version": 19 }, "dynamic": "strict", "properties": { @@ -229,6 +229,9 @@ }, "min_primary_shard_size": { "type": "keyword" + }, + "copy_alias": { + "type": "boolean" } } }, @@ -785,6 +788,9 @@ "rolled_over": { "type": "boolean" }, + "rolled_over_index_name": { + "type": "keyword" + }, "index_creation_date": { "type": "date", "format": "strict_date_time||epoch_millis" diff --git a/src/main/resources/mappings/opendistro-ism-history.json b/src/main/resources/mappings/opendistro-ism-history.json index 1065b1ae3..dcf8a2fe8 100644 --- a/src/main/resources/mappings/opendistro-ism-history.json +++ b/src/main/resources/mappings/opendistro-ism-history.json @@ -37,6 +37,9 @@ "rolled_over": { "type": "boolean" }, + "rolled_over_index_name": { + "type": "keyword" + }, "index_creation_date": { "type": "date", "format": "strict_date_time||epoch_millis" diff --git a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt index fd823a15f..cc8c60b0e 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt @@ -7,22 +7,23 @@ package org.opensearch.indexmanagement import org.apache.hc.core5.http.ContentType import org.apache.hc.core5.http.io.entity.StringEntity +import org.apache.logging.log4j.LogManager import org.junit.AfterClass import org.junit.Before import org.junit.rules.DisableOnDebug import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksAction import org.opensearch.client.Request -import org.opensearch.client.Response -import org.opensearch.client.RestClient import org.opensearch.client.RequestOptions -import org.opensearch.client.WarningsHandler +import org.opensearch.client.Response import org.opensearch.client.ResponseException import org.opensearch.core.common.Strings +import org.opensearch.client.RestClient +import org.opensearch.client.WarningsHandler import org.opensearch.common.io.PathUtils import org.opensearch.common.settings.Settings +import org.opensearch.common.xcontent.XContentType import org.opensearch.core.xcontent.DeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.common.xcontent.XContentType import org.opensearch.indexmanagement.indexstatemanagement.util.INDEX_HIDDEN import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.MediaType @@ -33,8 +34,6 @@ import javax.management.MBeanServerInvocationHandler import javax.management.ObjectName import javax.management.remote.JMXConnectorFactory import javax.management.remote.JMXServiceURL -import kotlin.collections.ArrayList -import kotlin.collections.HashSet abstract class IndexManagementRestTestCase : ODFERestTestCase() { @@ -175,14 +174,19 @@ abstract class IndexManagementRestTestCase : ODFERestTestCase() { override fun preserveIndicesUponCompletion(): Boolean = true companion object { - @JvmStatic val isMultiNode = System.getProperty("cluster.number_of_nodes", "1").toInt() > 1 + val isBWCTest = System.getProperty("tests.plugin_bwc_version", "0") != "0" protected val defaultKeepIndexSet = setOf(".opendistro_security") /** * We override preserveIndicesUponCompletion to true and use this function to clean up indices * Meant to be used in @After or @AfterClass of your feature test suite */ - fun wipeAllIndices(client: RestClient = adminClient(), keepIndex: kotlin.collections.Set = defaultKeepIndexSet) { + fun wipeAllIndices(client: RestClient = adminClient(), keepIndex: Set = defaultKeepIndexSet, skip: Boolean = false) { + val logger = LogManager.getLogger(IndexManagementRestTestCase::class.java) + if (skip) { + logger.info("Skipping wipeAllIndices...") + return + } try { client.performRequest(Request("DELETE", "_data_stream/*")) } catch (e: ResponseException) { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/bwc/ISMBackwardsCompatibilityIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/bwc/ISMBackwardsCompatibilityIT.kt new file mode 100644 index 000000000..d2e5fbedc --- /dev/null +++ b/src/test/kotlin/org/opensearch/indexmanagement/bwc/ISMBackwardsCompatibilityIT.kt @@ -0,0 +1,217 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.bwc + +import org.junit.Assert +import org.opensearch.common.settings.Settings +import org.opensearch.indexmanagement.IndexManagementIndices.Companion.HISTORY_WRITE_INDEX_ALIAS +import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX +import org.opensearch.indexmanagement.indexstatemanagement.IndexStateManagementRestTestCase +import org.opensearch.indexmanagement.indexstatemanagement.action.RolloverAction +import org.opensearch.indexmanagement.indexstatemanagement.step.rollover.AttemptRolloverStep +import org.opensearch.indexmanagement.waitFor +import java.util.Locale + +class ISMBackwardsCompatibilityIT : IndexStateManagementRestTestCase() { + + private val testIndexName = javaClass.simpleName.lowercase(Locale.ROOT) + + private enum class ClusterType { + OLD, + MIXED, + UPGRADED; + + companion object { + fun parse(value: String): ClusterType { + return when (value) { + "old_cluster" -> OLD + "mixed_cluster" -> MIXED + "upgraded_cluster" -> UPGRADED + else -> throw AssertionError("Unknown cluster type: $value") + } + } + } + } + + private fun getPluginUri(): String { + return when (CLUSTER_TYPE) { + ClusterType.OLD -> "_nodes/$CLUSTER_NAME-0/plugins" + ClusterType.MIXED -> { + when (System.getProperty("tests.rest.bwcsuite_round")) { + "second" -> "_nodes/$CLUSTER_NAME-1/plugins" + "third" -> "_nodes/$CLUSTER_NAME-2/plugins" + else -> "_nodes/$CLUSTER_NAME-0/plugins" + } + } + ClusterType.UPGRADED -> "_nodes/plugins" + } + } + + companion object { + private val CLUSTER_TYPE = ClusterType.parse(System.getProperty("tests.rest.bwcsuite")) + private val CLUSTER_NAME = System.getProperty("tests.clustername") + } + + override fun preserveIndicesUponCompletion(): Boolean = true + + override fun preserveReposUponCompletion(): Boolean = true + + override fun preserveTemplatesUponCompletion(): Boolean = true + + override fun restClientSettings(): Settings { + return Settings.builder() + .put(super.restClientSettings()) + // increase the timeout here to 90 seconds to handle long waits for a green + // cluster health. the waits for green need to be longer than a minute to + // account for delayed shards + .put(CLIENT_SOCKET_TIMEOUT, "90s") + .build() + } + + @Throws(Exception::class) + @Suppress("UNCHECKED_CAST") + fun `test rollover policy backwards compatibility`() { + val indexNameBase = "${testIndexName}_index" + val index1 = "$indexNameBase-1" + val newIndex1 = "$indexNameBase-000002" + val aliasName1 = "${testIndexName}_alias" + + val index2 = "$indexNameBase-2-1" + val newIndex2 = "$indexNameBase-2-000002" + val aliasName2 = "${testIndexName}_alias2" + + val policyID = "${testIndexName}_testPolicyName_doc_1" + + val uri = getPluginUri() + val responseMap = getAsMap(uri)["nodes"] as Map> + for (response in responseMap.values) { + val plugins = response["plugins"] as List> + val pluginNames = plugins.map { plugin -> plugin ["name"] }.toSet() + when (CLUSTER_TYPE) { + ClusterType.OLD -> { + assertTrue(pluginNames.contains("opendistro-index-management") || pluginNames.contains("opensearch-index-management")) + + createRolloverPolicy(policyID) + + createIndex(index1, policyID, aliasName1) + createIndex(index2, policyID, aliasName2) + + // Change the start time so the job will trigger in 2 seconds, this will trigger the first initialization of the policy + updateManagedIndexConfigStartTime(getExistingManagedIndexConfig(index1)) + waitFor { assertEquals(policyID, getExplainManagedIndexMetaData(index1).policyID) } + + // Change the start time so the job will trigger in 2 seconds, this will trigger the first initialization of the policy + updateManagedIndexConfigStartTime(getExistingManagedIndexConfig(index2)) + waitFor { assertEquals(policyID, getExplainManagedIndexMetaData(index2).policyID) } + + verifyPendingRollover(index1) + verifyPendingRollover(index2) + } + ClusterType.MIXED -> { + assertTrue(pluginNames.contains("opensearch-index-management")) + + verifyPendingRollover(index1) + verifyPendingRollover(index2) + } + ClusterType.UPGRADED -> { + assertTrue(pluginNames.contains("opensearch-index-management")) + + verifyPendingRollover(index1) + insertSampleData(index = index1, docCount = 5, delay = 0) + verifySuccessfulRollover(index1, newIndex1) + + verifyIndexSchemaVersion(INDEX_MANAGEMENT_INDEX, configSchemaVersion) + verifyIndexSchemaVersion(HISTORY_WRITE_INDEX_ALIAS, historySchemaVersion) + + insertSampleData(index = index2, docCount = 5, delay = 0) + verifySuccessfulRollover(index2, newIndex2) + + deleteIndex("$indexNameBase*") + } + } + break + } + } + + private fun createRolloverPolicy(policyID: String) { + val policy = """ + { + "policy": { + "policy_id": "$policyID", + "description": "description", + "default_state": "RolloverAction", + "states": [ + { + "name": "RolloverAction", + "actions": [ + { + "rollover": { + "min_doc_count": 3, + "min_index_age": "2d" + } + } + ], + "transitions": [ + + ] + } + ] + } + } + """.trimIndent() + createPolicyJson(policy, policyID) + } + + @Suppress("UNCHECKED_CAST") + private fun verifyPendingRollover(index: String) { + val managedIndexConfig = getExistingManagedIndexConfig(index) + // Need to speed up to second execution where it will trigger the first execution of the action + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { + val info = getExplainManagedIndexMetaData(index).info as Map + assertEquals( + "Index rollover before it met the condition.", + AttemptRolloverStep.getPendingMessage(index), info["message"] + ) + val conditions = info["conditions"] as Map + assertEquals( + "Did not have exclusively min age and min doc count conditions", + setOf(RolloverAction.MIN_INDEX_AGE_FIELD, RolloverAction.MIN_DOC_COUNT_FIELD), conditions.keys + ) + val minAge = conditions[RolloverAction.MIN_INDEX_AGE_FIELD] as Map + val minDocCount = conditions[RolloverAction.MIN_DOC_COUNT_FIELD] as Map + assertEquals("Did not have min age condition", "2d", minAge["condition"]) + assertTrue("Did not have min age current", minAge["current"] is String) + assertEquals("Did not have min doc count condition", 3, minDocCount["condition"]) + assertEquals("Did not have min doc count current", 0, minDocCount["current"]) + } + } + + @Suppress("UNCHECKED_CAST") + private fun verifySuccessfulRollover(index: String, newIndex: String) { + val managedIndexConfig = getExistingManagedIndexConfig(index) + // Need to speed up to second execution where it will trigger the first execution of the action + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { + val metadata = getExplainManagedIndexMetaData(index) + val info = metadata.info as Map + assertEquals("Index did not rollover", AttemptRolloverStep.getSuccessMessage(index), info["message"]) + val conditions = info["conditions"] as Map + assertEquals( + "Did not have exclusively min age and min doc count conditions", + setOf(RolloverAction.MIN_INDEX_AGE_FIELD, RolloverAction.MIN_DOC_COUNT_FIELD), conditions.keys + ) + val minAge = conditions[RolloverAction.MIN_INDEX_AGE_FIELD] as Map + val minDocCount = conditions[RolloverAction.MIN_DOC_COUNT_FIELD] as Map + assertEquals("Did not have min age condition", "2d", minAge["condition"]) + assertTrue("Did not have min age current", minAge["current"] is String) + assertEquals("Did not have min doc count condition", 3, minDocCount["condition"]) + assertEquals("Did not have min doc count current", 5, minDocCount["current"]) + assertEquals("Did not have rolled over index name", metadata.rolledOverIndexName, newIndex) + } + Assert.assertTrue("New rollover index does not exist.", indexExists(newIndex)) + } +} diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt index dcfbe5aa1..a29cf7024 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt @@ -71,6 +71,7 @@ import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule import org.opensearch.rest.RestRequest import org.opensearch.search.SearchModule import org.opensearch.core.rest.RestStatus +import org.opensearch.indexmanagement.rollup.randomTermQuery import org.opensearch.test.OpenSearchTestCase import java.io.IOException import java.time.Duration @@ -81,7 +82,7 @@ abstract class IndexStateManagementRestTestCase : IndexManagementRestTestCase() @After fun clearIndicesAfterEachTest() { - wipeAllIndices() + wipeAllIndices(skip = isBWCTest) } val explainResponseOpendistroPolicyIdSetting = "index.opendistro.index_state_management.policy_id" @@ -93,13 +94,11 @@ abstract class IndexStateManagementRestTestCase : IndexManagementRestTestCase() updateIndexStateManagementJitterSetting(0.0) } - @Before - protected fun disableValidationService() { + protected open fun disableValidationService() { updateValidationServiceSetting(false) } - @Before - protected fun enableValidationService() { + protected open fun enableValidationService() { updateValidationServiceSetting(true) } @@ -242,16 +241,28 @@ abstract class IndexStateManagementRestTestCase : IndexManagementRestTestCase() index: String, alias: String, action: String = "remove", - isWriteIndex: Boolean = false + isWriteIndex: Boolean = false, + routing: Int? = null, + searchRouting: Int = randomInt(), + indexRouting: Int = randomInt(), + filter: String = randomTermQuery().toString(), + isHidden: Boolean = randomBoolean() ) { val isWriteIndexField = if (isWriteIndex) "\",\"is_write_index\": \"$isWriteIndex" else "" + val params = if (action == "add" && routing != null) """ + ,"routing": $routing, + "search_routing": $searchRouting, + "index_routing": $indexRouting, + "filter": $filter, + "is_hidden": $isHidden + """.trimIndent() else "" val body = """ { "actions": [ { "$action": { "index": "$index", - "alias": "$alias$isWriteIndexField" + "alias": "$alias$isWriteIndexField"$params } } ] diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt index dfe91f2d1..d96b3731f 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/RolloverActionIT.kt @@ -36,13 +36,12 @@ class RolloverActionIT : IndexStateManagementRestTestCase() { private val testIndexName = javaClass.simpleName.lowercase(Locale.ROOT) - @Suppress("UNCHECKED_CAST") fun `test rollover no condition`() { val aliasName = "${testIndexName}_alias" val indexNameBase = "${testIndexName}_index" val firstIndex = "$indexNameBase-1" val policyID = "${testIndexName}_testPolicyName_1" - val actionConfig = RolloverAction(null, null, null, null, 0) + val actionConfig = RolloverAction(null, null, null, null, false, 0) val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) val policy = Policy( id = policyID, @@ -96,7 +95,7 @@ class RolloverActionIT : IndexStateManagementRestTestCase() { ) val policyID = "${testIndexName}_bwc" - val actionConfig = RolloverAction(null, null, null, null, 0) + val actionConfig = RolloverAction(null, null, null, null, false, 0) val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) val policy = Policy( id = policyID, @@ -133,7 +132,7 @@ class RolloverActionIT : IndexStateManagementRestTestCase() { val indexNameBase = "${testIndexName}_index_byte" val firstIndex = "$indexNameBase-1" val policyID = "${testIndexName}_testPolicyName_byte_1" - val actionConfig = RolloverAction(ByteSizeValue(10, ByteSizeUnit.BYTES), 1000000, null, null, 0) + val actionConfig = RolloverAction(ByteSizeValue(10, ByteSizeUnit.BYTES), 1000000, null, null, false, 0) val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) val policy = Policy( id = policyID, @@ -205,7 +204,7 @@ class RolloverActionIT : IndexStateManagementRestTestCase() { val indexNameBase = "${testIndexName}_index_primary_shard" val firstIndex = "$indexNameBase-1" val policyID = "${testIndexName}_primary_shard_1" - val actionConfig = RolloverAction(null, null, null, ByteSizeValue(100, ByteSizeUnit.KB), 0) + val actionConfig = RolloverAction(null, null, null, ByteSizeValue(100, ByteSizeUnit.KB), false, 0) val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) val policy = Policy( id = policyID, @@ -315,7 +314,7 @@ class RolloverActionIT : IndexStateManagementRestTestCase() { val indexNameBase = "${testIndexName}_index_doc" val firstIndex = "$indexNameBase-1" val policyID = "${testIndexName}_testPolicyName_doc_1" - val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, 0) + val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, false, 0) val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) val policy = Policy( id = policyID, @@ -389,7 +388,7 @@ class RolloverActionIT : IndexStateManagementRestTestCase() { val index2 = "index-2" val alias1 = "x" val policyID = "${testIndexName}_precheck" - val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, 0) + val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, false, 0) actionConfig.configRetry = ActionRetry(0) val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) val policy = Policy( @@ -448,7 +447,7 @@ class RolloverActionIT : IndexStateManagementRestTestCase() { val policyID = "${testIndexName}_rollover_policy" // Create the rollover policy - val rolloverAction = RolloverAction(null, null, null, null, 0) + val rolloverAction = RolloverAction(null, null, null, null, false, 0) val states = listOf(State(name = "default", actions = listOf(rolloverAction), transitions = listOf())) val policy = Policy( id = policyID, @@ -496,6 +495,9 @@ class RolloverActionIT : IndexStateManagementRestTestCase() { managedIndexConfig = getExistingManagedIndexConfig(secondIndexName) updateManagedIndexConfigStartTime(managedIndexConfig) waitFor { assertEquals(policyID, getExplainManagedIndexMetaData(secondIndexName).policyID) } + + val metadata = getExplainManagedIndexMetaData(firstIndexName) + assertEquals(metadata.rolledOverIndexName, secondIndexName) } @Suppress("UNCHECKED_CAST") @@ -504,7 +506,7 @@ class RolloverActionIT : IndexStateManagementRestTestCase() { val policyID = "${testIndexName}_rollover_policy_multi" // Create the rollover policy - val rolloverAction = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, 0) + val rolloverAction = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, false, 0) val states = listOf(State(name = "default", actions = listOf(rolloverAction), transitions = listOf())) val policy = Policy( id = policyID, @@ -589,15 +591,17 @@ class RolloverActionIT : IndexStateManagementRestTestCase() { val secondIndexName = DataStream.getDefaultBackingIndexName(dataStreamName, 2L) Assert.assertTrue("New rollover index does not exist.", indexExists(secondIndexName)) + + val metadata = getExplainManagedIndexMetaData(firstIndexName) + assertEquals(metadata.rolledOverIndexName, secondIndexName) } - @Suppress("UNCHECKED_CAST") fun `test rollover from outside ISM doesn't fail ISM job`() { val aliasName = "${testIndexName}_alias" val indexNameBase = "${testIndexName}_index" val firstIndex = "$indexNameBase-1" val policyID = "${testIndexName}_testPolicyName_1" - val actionConfig = RolloverAction(null, null, null, null, 0) + val actionConfig = RolloverAction(null, null, null, null, false, 0) val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) val policy = Policy( id = policyID, @@ -632,4 +636,102 @@ class RolloverActionIT : IndexStateManagementRestTestCase() { } assertTrue("New rollover index does not exist.", indexExists("$indexNameBase-000002")) } + + @Suppress("UNCHECKED_CAST") + fun `test rollover with copy alias`() { + val aliasName = "${testIndexName}_doc_alias" + val indexNameBase = "${testIndexName}_index_doc" + val firstIndex = "$indexNameBase-1" + val policyID = "${testIndexName}_testPolicyName_doc_1" + val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, true, 0) + val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) + val policy = Policy( + id = policyID, + description = "$testIndexName description", + schemaVersion = 1L, + lastUpdatedTime = Instant.now().truncatedTo(ChronoUnit.MILLIS), + errorNotification = randomErrorNotification(), + defaultState = states[0].name, + states = states + ) + + createPolicy(policy, policyID) + // create index defaults + createIndex(firstIndex, policyID, aliasName) + + // Add a bunch of aliases + changeAlias( + firstIndex, "test_alias1", "add", routing = 0, searchRouting = 1, indexRouting = 2, + filter = """ + { "term": { "user.id": "kimchy" } } + """.trimIndent(), + isHidden = false + ) + changeAlias(firstIndex, "test_alias2", "add") + changeAlias(firstIndex, "test_alias3", "add") + + val managedIndexConfig = getExistingManagedIndexConfig(firstIndex) + + // Change the start time so the job will trigger in 2 seconds, this will trigger the first initialization of the policy + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { assertEquals(policyID, getExplainManagedIndexMetaData(firstIndex).policyID) } + + // Need to speed up to second execution where it will trigger the first execution of the action + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { + val info = getExplainManagedIndexMetaData(firstIndex).info as Map + assertEquals( + "Index rollover before it met the condition.", + AttemptRolloverStep.getPendingMessage(firstIndex), info["message"] + ) + val conditions = info["conditions"] as Map + assertEquals( + "Did not have exclusively min age and min doc count conditions", + setOf(RolloverAction.MIN_INDEX_AGE_FIELD, RolloverAction.MIN_DOC_COUNT_FIELD), conditions.keys + ) + val minAge = conditions[RolloverAction.MIN_INDEX_AGE_FIELD] as Map + val minDocCount = conditions[RolloverAction.MIN_DOC_COUNT_FIELD] as Map + assertEquals("Did not have min age condition", "2d", minAge["condition"]) + assertTrue("Did not have min age current", minAge["current"] is String) + assertEquals("Did not have min doc count condition", 3, minDocCount["condition"]) + assertEquals("Did not have min doc count current", 0, minDocCount["current"]) + } + + insertSampleData(index = firstIndex, docCount = 5, delay = 0) + + // Need to speed up to second execution where it will trigger the first execution of the action + updateManagedIndexConfigStartTime(managedIndexConfig) + val newIndex = "$indexNameBase-000002" + waitFor { + val metadata = getExplainManagedIndexMetaData(firstIndex) + val info = metadata.info as Map + assertEquals("Index did not rollover", AttemptRolloverStep.getSuccessCopyAliasMessage(firstIndex, newIndex), info["message"]) + val conditions = info["conditions"] as Map + assertEquals( + "Did not have exclusively min age and min doc count conditions", + setOf(RolloverAction.MIN_INDEX_AGE_FIELD, RolloverAction.MIN_DOC_COUNT_FIELD), conditions.keys + ) + val minAge = conditions[RolloverAction.MIN_INDEX_AGE_FIELD] as Map + val minDocCount = conditions[RolloverAction.MIN_DOC_COUNT_FIELD] as Map + assertEquals("Did not have min age condition", "2d", minAge["condition"]) + assertTrue("Did not have min age current", minAge["current"] is String) + assertEquals("Did not have min doc count condition", 3, minDocCount["condition"]) + assertEquals("Did not have min doc count current", 5, minDocCount["current"]) + assertEquals("Did not have rolled over index name", metadata.rolledOverIndexName, newIndex) + } + Assert.assertTrue("New rollover index does not exist.", indexExists(newIndex)) + + // Check if new index has the aliases + val alias = getAlias(newIndex, "") + Assert.assertEquals(alias.containsKey("test_alias1"), true) + alias["test_alias1"]!!.let { + it as Map + assertEquals(it["is_hidden"], false) + assertEquals(it["search_routing"], "1") + assertEquals(it["index_routing"], "2") + assertEquals(it["filter"]!!.toString(), "{term={user.id=kimchy}}") + } + Assert.assertEquals(alias.containsKey("test_alias2"), true) + Assert.assertEquals(alias.containsKey("test_alias3"), true) + } } diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptRolloverStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptRolloverStepTests.kt new file mode 100644 index 000000000..5c4beea89 --- /dev/null +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptRolloverStepTests.kt @@ -0,0 +1,194 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.opensearch.indexmanagement.indexstatemanagement.step + +import com.nhaarman.mockitokotlin2.any +import com.nhaarman.mockitokotlin2.doAnswer +import com.nhaarman.mockitokotlin2.doReturn +import com.nhaarman.mockitokotlin2.mock +import com.nhaarman.mockitokotlin2.whenever +import kotlinx.coroutines.runBlocking +import org.junit.Before +import org.opensearch.core.action.ActionListener +import org.opensearch.action.admin.indices.rollover.RolloverResponse +import org.opensearch.action.support.master.AcknowledgedResponse +import org.opensearch.client.AdminClient +import org.opensearch.client.Client +import org.opensearch.client.IndicesAdminClient +import org.opensearch.cluster.ClusterState +import org.opensearch.cluster.metadata.IndexMetadata +import org.opensearch.cluster.service.ClusterService +import org.opensearch.common.settings.Settings +import org.opensearch.indexmanagement.indexstatemanagement.action.RolloverAction +import org.opensearch.indexmanagement.indexstatemanagement.step.rollover.AttemptRolloverStep +import org.opensearch.indexmanagement.spi.indexstatemanagement.Step +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepContext +import org.opensearch.jobscheduler.spi.utils.LockService +import org.opensearch.script.ScriptService +import org.opensearch.test.OpenSearchTestCase +import org.opensearch.cluster.metadata.Metadata +import org.opensearch.index.IndexNotFoundException +import org.opensearch.indexmanagement.indexstatemanagement.settings.ManagedIndexSettings + +class AttemptRolloverStepTests : OpenSearchTestCase() { + + private val clusterService: ClusterService = mock() + private val scriptService: ScriptService = mock() + private val settings: Settings = Settings.EMPTY + private val lockService: LockService = LockService(mock(), clusterService) + private val oldIndexName = "old_index" + private val newIndexName = "new_index" + val alias = "alias" + + @Before + fun setup() { + // mock rollover target + val clusterState: ClusterState = mock() + val metadata: Metadata = mock() + val indexMetadata: IndexMetadata = mock() + val settings = Settings.builder() + .put(ManagedIndexSettings.ROLLOVER_ALIAS.key, alias) + .put(ManagedIndexSettings.ROLLOVER_SKIP.key, false) + .build() + whenever(clusterService.state()).thenReturn(clusterState) + whenever(clusterState.metadata()).thenReturn(metadata) + whenever(clusterState.metadata).thenReturn(metadata) + whenever(metadata.index(oldIndexName)).thenReturn(indexMetadata) + whenever(metadata.indicesLookup).thenReturn(sortedMapOf()) + whenever(indexMetadata.settings).thenReturn(settings) + + // mock rolloverInfos + whenever(metadata.index(oldIndexName).rolloverInfos).thenReturn(mapOf(alias to mock())) + } + + fun `test copy alias in rollover step is not acknowledged`() { + val rolloverResponse = RolloverResponse(oldIndexName, newIndexName, mapOf(), false, true, true, true) + val aliasResponse = AcknowledgedResponse(false) + // val exception = Exception("test exception") + val client = getClient(getAdminClient(getIndicesAdminClient(rolloverResponse, aliasResponse, null, null))) + + runBlocking { + val rolloverAction = RolloverAction(null, null, null, null, true, 0) + val managedIndexMetaData = ManagedIndexMetaData( + oldIndexName, "indexUuid", "policy_id", + null, null, null, + null, null, null, + null, null, null, + null, null, rolledOverIndexName = newIndexName + ) + val attemptRolloverStep = AttemptRolloverStep(rolloverAction) + val context = StepContext(managedIndexMetaData, clusterService, client, null, null, scriptService, settings, lockService) + attemptRolloverStep.preExecute(logger, context).execute() + val updatedManagedIndexMetaData = attemptRolloverStep.getUpdatedManagedIndexMetadata(managedIndexMetaData) + assertEquals("Step status is not FAILED", Step.StepStatus.FAILED, updatedManagedIndexMetaData.stepMetaData?.stepStatus) + assertEquals("message info is not matched", AttemptRolloverStep.getCopyAliasNotAckMessage(oldIndexName, newIndexName), updatedManagedIndexMetaData.info?.get("message")) + } + } + + fun `test copy alias in rollover step failed`() { + val rolloverResponse = RolloverResponse(oldIndexName, newIndexName, mapOf(), false, true, true, true) + // val aliasResponse = AcknowledgedResponse(true) + val exception = Exception("test exception") + val client = getClient(getAdminClient(getIndicesAdminClient(rolloverResponse, null, null, exception))) + + runBlocking { + val rolloverAction = RolloverAction(null, null, null, null, true, 0) + val managedIndexMetaData = ManagedIndexMetaData( + oldIndexName, "indexUuid", "policy_id", + null, null, null, + null, null, null, + null, null, null, + null, null, rolledOverIndexName = newIndexName + ) + val attemptRolloverStep = AttemptRolloverStep(rolloverAction) + val context = StepContext(managedIndexMetaData, clusterService, client, null, null, scriptService, settings, lockService) + attemptRolloverStep.preExecute(logger, context).execute() + val updatedManagedIndexMetaData = attemptRolloverStep.getUpdatedManagedIndexMetadata(managedIndexMetaData) + assertEquals("Step status is not FAILED", Step.StepStatus.FAILED, updatedManagedIndexMetaData.stepMetaData?.stepStatus) + assertEquals("message info is not matched", AttemptRolloverStep.getFailedCopyAliasMessage(oldIndexName, newIndexName), updatedManagedIndexMetaData.info?.get("message")) + } + } + + fun `test copy alias in rollover step failed with index not found exception`() { + val rolloverResponse = RolloverResponse(oldIndexName, newIndexName, mapOf(), false, true, true, true) + // val aliasResponse = AcknowledgedResponse(true) + val exception = IndexNotFoundException("test exception") + val client = getClient(getAdminClient(getIndicesAdminClient(rolloverResponse, null, null, exception))) + + runBlocking { + val rolloverAction = RolloverAction(null, null, null, null, true, 0) + val managedIndexMetaData = ManagedIndexMetaData( + oldIndexName, "indexUuid", "policy_id", + null, null, null, + null, null, null, + null, null, null, + null, null, rolledOverIndexName = newIndexName + ) + val attemptRolloverStep = AttemptRolloverStep(rolloverAction) + val context = StepContext(managedIndexMetaData, clusterService, client, null, null, scriptService, settings, lockService) + attemptRolloverStep.preExecute(logger, context).execute() + val updatedManagedIndexMetaData = attemptRolloverStep.getUpdatedManagedIndexMetadata(managedIndexMetaData) + assertEquals("Step status is not FAILED", Step.StepStatus.FAILED, updatedManagedIndexMetaData.stepMetaData?.stepStatus) + assertEquals("message info is not matched", AttemptRolloverStep.getCopyAliasIndexNotFoundMessage(newIndexName), updatedManagedIndexMetaData.info?.get("message")) + } + } + + fun `test copy alias in rollover step but no rollodOverIndexName`() { + val rolloverResponse = RolloverResponse(oldIndexName, newIndexName, mapOf(), false, true, true, true) + val aliasResponse = AcknowledgedResponse(true) + // val exception = IndexNotFoundException("test exception") + val client = getClient(getAdminClient(getIndicesAdminClient(rolloverResponse, aliasResponse, null, null))) + + runBlocking { + val rolloverAction = RolloverAction(null, null, null, null, true, 0) + val managedIndexMetaData = ManagedIndexMetaData( + oldIndexName, "indexUuid", "policy_id", + null, null, null, + null, null, null, + null, null, null, + null, null, rolledOverIndexName = null + ) + val attemptRolloverStep = AttemptRolloverStep(rolloverAction) + val context = StepContext(managedIndexMetaData, clusterService, client, null, null, scriptService, settings, lockService) + attemptRolloverStep.preExecute(logger, context).execute() + val updatedManagedIndexMetaData = attemptRolloverStep.getUpdatedManagedIndexMetadata(managedIndexMetaData) + assertEquals("Step status is not COMPLETED", Step.StepStatus.COMPLETED, updatedManagedIndexMetaData.stepMetaData?.stepStatus) + assertEquals("message info is not matched", AttemptRolloverStep.getCopyAliasRolledOverIndexNotFoundMessage(oldIndexName), updatedManagedIndexMetaData.info?.get("message")) + } + } + + private fun getClient(adminClient: AdminClient): Client = mock { on { admin() } doReturn adminClient } + private fun getAdminClient(indicesAdminClient: IndicesAdminClient): AdminClient = mock { on { indices() } doReturn indicesAdminClient } + private fun getIndicesAdminClient( + rolloverResponse: RolloverResponse?, + aliasResponse: AcknowledgedResponse?, + rolloverException: Exception?, + aliasException: Exception?, + ): IndicesAdminClient { + assertTrue( + "Must provide one and only one response or exception", + (rolloverResponse != null).xor(rolloverException != null) + ) + assertTrue( + "Must provide one and only one response or exception", + (aliasResponse != null).xor(aliasException != null) + ) + return mock { + doAnswer { invocationOnMock -> + val listener = invocationOnMock.getArgument>(1) + if (rolloverResponse != null) listener.onResponse(rolloverResponse) + else listener.onFailure(rolloverException) + }.whenever(this.mock).rolloverIndex(any(), any()) + + doAnswer { invocationOnMock -> + val listener = invocationOnMock.getArgument>(1) + if (aliasResponse != null) listener.onResponse(aliasResponse) + else listener.onFailure(aliasException) + }.whenever(this.mock).aliases(any(), any()) + } + } +} diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverIT.kt index 98c71ee52..e6db88428 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverIT.kt @@ -32,7 +32,7 @@ class ValidateRolloverIT : IndexStateManagementRestTestCase() { val index1 = "index-1" val alias1 = "x" val policyID = "${testIndexName}_precheck" - val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, 0) + val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, false, 0) actionConfig.configRetry = ActionRetry(0) val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) val policy = Policy( @@ -84,7 +84,7 @@ class ValidateRolloverIT : IndexStateManagementRestTestCase() { val indexNameBase = "${testIndexName}_index" val index1 = "$indexNameBase-1" val policyID = "${testIndexName}_testPolicyName_1" - val actionConfig = RolloverAction(null, null, null, null, 0) + val actionConfig = RolloverAction(null, null, null, null, false, 0) val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) val policy = Policy( id = policyID, @@ -131,7 +131,7 @@ class ValidateRolloverIT : IndexStateManagementRestTestCase() { val index1 = "index-1" val index2 = "index-2" val policyID = "${testIndexName}_precheck" - val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, 0) + val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, false, 0) actionConfig.configRetry = ActionRetry(0) val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) val policy = Policy( @@ -175,7 +175,7 @@ class ValidateRolloverIT : IndexStateManagementRestTestCase() { val index2 = "index-2" val alias1 = "x" val policyID = "${testIndexName}_precheck" - val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, 0) + val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, false, 0) actionConfig.configRetry = ActionRetry(0) val states = listOf(State(name = "RolloverAction", actions = listOf(actionConfig), transitions = listOf())) val policy = Policy( diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverTests.kt index 805d3b045..367a38e05 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/validation/ValidateRolloverTests.kt @@ -40,7 +40,7 @@ class ValidateRolloverTests : OpenSearchTestCase() { ("rollover", 1, 0, false, 0, null, null), null, null, null ) - val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, 0) + val actionConfig = RolloverAction(null, 3, TimeValue.timeValueDays(2), null, false, 0) private val client: Client = mock() private val lockService: LockService = LockService(mock(), clusterService) private val validate = ValidateRollover(settings, clusterService, jvmService) diff --git a/src/test/resources/mappings/cached-opendistro-ism-config.json b/src/test/resources/mappings/cached-opendistro-ism-config.json index 1e170ebf3..49e515885 100644 --- a/src/test/resources/mappings/cached-opendistro-ism-config.json +++ b/src/test/resources/mappings/cached-opendistro-ism-config.json @@ -229,6 +229,9 @@ }, "min_primary_shard_size": { "type": "keyword" + }, + "copy_alias": { + "type": "boolean" } } }, @@ -785,6 +788,9 @@ "rolled_over": { "type": "boolean" }, + "rolled_over_index_name": { + "type": "keyword" + }, "index_creation_date": { "type": "date", "format": "strict_date_time||epoch_millis" diff --git a/src/test/resources/mappings/cached-opendistro-ism-history.json b/src/test/resources/mappings/cached-opendistro-ism-history.json index 1065b1ae3..dcf8a2fe8 100644 --- a/src/test/resources/mappings/cached-opendistro-ism-history.json +++ b/src/test/resources/mappings/cached-opendistro-ism-history.json @@ -37,6 +37,9 @@ "rolled_over": { "type": "boolean" }, + "rolled_over_index_name": { + "type": "keyword" + }, "index_creation_date": { "type": "date", "format": "strict_date_time||epoch_millis" From 716ca8918f7aadcd14e77c63561eef41a1d855da Mon Sep 17 00:00:00 2001 From: gaobinlong Date: Fri, 1 Sep 2023 11:37:01 +0800 Subject: [PATCH 17/29] Set preference to _primary when searching control-center index (#911) * Set preference to _primary when searching control-center index Signed-off-by: gaobinlong * Use _primary_first instead Signed-off-by: gaobinlong --------- Signed-off-by: gaobinlong Signed-off-by: Tanqiu Liu --- .../notification/action/get/TransportGetLRONConfigAction.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt index 6c43d93a6..25c2a42a8 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt @@ -13,6 +13,7 @@ import org.opensearch.action.search.SearchResponse import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction import org.opensearch.client.node.NodeClient +import org.opensearch.cluster.routing.Preference import org.opensearch.common.inject.Inject import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper @@ -93,6 +94,7 @@ class TransportGetLRONConfigAction @Inject constructor( val searchRequest = SearchRequest() .source(searchSourceBuilder) .indices(IndexManagementPlugin.CONTROL_CENTER_INDEX) + .preference(Preference.PRIMARY_FIRST.type()) client.search( searchRequest, From 96ef16e8a6e97767b6a6cca313f66191d6bb849e Mon Sep 17 00:00:00 2001 From: bowenlan-amzn Date: Fri, 1 Sep 2023 12:52:01 -0700 Subject: [PATCH 18/29] Add primary first preference to all search requests (#912) Signed-off-by: Tanqiu Liu --- .../indexstatemanagement/ManagedIndexCoordinator.kt | 2 ++ .../transport/action/explain/TransportExplainAction.kt | 2 ++ .../transport/action/getpolicy/TransportGetPoliciesAction.kt | 2 ++ .../transport/action/indexpolicy/TransportIndexPolicyAction.kt | 2 ++ .../indexstatemanagement/util/ManagedIndexUtils.kt | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt index 4b9a7fa80..51a877768 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexCoordinator.kt @@ -35,6 +35,7 @@ import org.opensearch.cluster.ClusterState import org.opensearch.cluster.ClusterStateListener import org.opensearch.cluster.block.ClusterBlockException import org.opensearch.cluster.metadata.IndexMetadata +import org.opensearch.cluster.routing.Preference import org.opensearch.cluster.service.ClusterService import org.opensearch.common.lifecycle.LifecycleListener import org.opensearch.common.regex.Regex @@ -429,6 +430,7 @@ class ManagedIndexCoordinator( ).size(MAX_HITS) ) .indices(INDEX_MANAGEMENT_INDEX) + .preference(Preference.PRIMARY_FIRST.type()) return try { val response: SearchResponse = client.suspendUntil { search(searchRequest, it) } diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/TransportExplainAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/TransportExplainAction.kt index f31d8e3d1..9e67742b3 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/TransportExplainAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/explain/TransportExplainAction.kt @@ -24,6 +24,7 @@ import org.opensearch.action.support.HandledTransportAction import org.opensearch.action.support.master.AcknowledgedResponse import org.opensearch.client.node.NodeClient import org.opensearch.cluster.metadata.IndexMetadata +import org.opensearch.cluster.routing.Preference import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.util.concurrent.ThreadContext @@ -177,6 +178,7 @@ class TransportExplainAction @Inject constructor( return SearchRequest() .indices(INDEX_MANAGEMENT_INDEX) .source(searchSourceBuilder) + .preference(Preference.PRIMARY_FIRST.type()) } private fun searchForMetadata(searchRequest: SearchRequest) { diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPoliciesAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPoliciesAction.kt index 607f13a49..9aaa9c91c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPoliciesAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/getpolicy/TransportGetPoliciesAction.kt @@ -13,6 +13,7 @@ import org.opensearch.action.search.SearchResponse import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction import org.opensearch.client.Client +import org.opensearch.cluster.routing.Preference import org.opensearch.cluster.service.ClusterService import org.opensearch.common.inject.Inject import org.opensearch.common.settings.Settings @@ -90,6 +91,7 @@ class TransportGetPoliciesAction @Inject constructor( val searchRequest = SearchRequest() .source(searchSourceBuilder) .indices(INDEX_MANAGEMENT_INDEX) + .preference(Preference.PRIMARY_FIRST.type()) client.threadPool().threadContext.stashContext().use { client.search( diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt index 7240c4f77..a2f483cbb 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/transport/action/indexpolicy/TransportIndexPolicyAction.kt @@ -20,6 +20,7 @@ import org.opensearch.action.support.HandledTransportAction import org.opensearch.action.support.master.AcknowledgedResponse import org.opensearch.client.node.NodeClient import org.opensearch.cluster.metadata.AutoExpandReplicas +import org.opensearch.cluster.routing.Preference import org.opensearch.cluster.routing.allocation.AwarenessReplicaBalance import org.opensearch.cluster.service.ClusterService import org.opensearch.common.ValidationException @@ -180,6 +181,7 @@ class TransportIndexPolicyAction @Inject constructor( ).size(MAX_HITS) ) .indices(IndexManagementPlugin.INDEX_MANAGEMENT_INDEX) + .preference(Preference.PRIMARY_FIRST.type()) client.search( searchRequest, diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt index 25edb2039..309ce9931 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/util/ManagedIndexUtils.kt @@ -21,6 +21,7 @@ import org.opensearch.action.support.WriteRequest import org.opensearch.action.update.UpdateRequest // import org.opensearch.alerting.destination.message.BaseMessage import org.opensearch.client.Client +import org.opensearch.cluster.routing.Preference import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.common.xcontent.LoggingDeprecationHandler @@ -199,6 +200,7 @@ fun getSweptManagedIndexSearchRequest(scroll: Boolean = false, size: Int = Manag .fetchSource(emptyArray(), emptyArray()) .query(boolQueryBuilder) ) + .preference(Preference.PRIMARY_FIRST.type()) if (scroll) req.scroll(TimeValue.timeValueMinutes(1)) return req } From 1ba75b0a0ddc3fd61cc8648472137ec52a837b11 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Wed, 6 Sep 2023 00:04:08 +0800 Subject: [PATCH 19/29] fix intelliJ IDEA gradle sync error (#916) Signed-off-by: Hailong Cui Signed-off-by: Tanqiu Liu --- build-tools/pkgbuild.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build-tools/pkgbuild.gradle b/build-tools/pkgbuild.gradle index 71cea1a7a..0e5d9230d 100644 --- a/build-tools/pkgbuild.gradle +++ b/build-tools/pkgbuild.gradle @@ -44,8 +44,8 @@ afterEvaluate { tasks.register("renameRpm", Copy) { from("$buildDir/distributions") into("$buildDir/distributions") - include archiveFileName - rename archiveFileName, "${packageName}-${version}.rpm" + include archiveFileName.get() + rename archiveFileName.get(), "${packageName}-${version}.rpm" doLast { delete file("$buildDir/distributions/$archiveFileName") } } } @@ -56,8 +56,8 @@ afterEvaluate { tasks.register("renameDeb", Copy) { from("$buildDir/distributions") into("$buildDir/distributions") - include archiveFileName - rename archiveFileName, "${packageName}-${version}.deb" + include archiveFileName.get() + rename archiveFileName.get(), "${packageName}-${version}.deb" doLast { delete file("$buildDir/distributions/$archiveFileName") } } } From 9a7212d043f6c6ebb29257a1216d08ff60a5f3f8 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Wed, 6 Sep 2023 14:29:44 +0800 Subject: [PATCH 20/29] make control center index as system index (#919) Signed-off-by: Hailong Cui Signed-off-by: Tanqiu Liu --- .../indexmanagement/IndexManagementPlugin.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt index 8f0d3ad93..173396458 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/IndexManagementPlugin.kt @@ -615,7 +615,17 @@ class IndexManagementPlugin : JobSchedulerExtension, NetworkPlugin, ActionPlugin } override fun getSystemIndexDescriptors(settings: Settings): Collection { - return listOf(SystemIndexDescriptor(INDEX_MANAGEMENT_INDEX, "Index for storing index management configuration and metadata.")) + return listOf( + SystemIndexDescriptor( + INDEX_MANAGEMENT_INDEX, + "Index for storing index management configuration and metadata." + ), + SystemIndexDescriptor( + CONTROL_CENTER_INDEX, + "Index for storing notification policy of long running index operations." + ), + + ) } } From a6ea2f76a45d8b170a55a5f65a808b3f864d6e6f Mon Sep 17 00:00:00 2001 From: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com> Date: Thu, 7 Sep 2023 13:21:48 -0400 Subject: [PATCH 21/29] Updates demo certs used in integ tests (#921) Signed-off-by: Darshit Chanpura Signed-off-by: Tanqiu Liu --- src/test/resources/security/esnode-key.pem | 52 ++++++++++----------- src/test/resources/security/esnode.pem | 49 +++++++++---------- src/test/resources/security/kirk-key.pem | 52 ++++++++++----------- src/test/resources/security/kirk.pem | 49 +++++++++---------- src/test/resources/security/root-ca.pem | 48 ++++++++++--------- src/test/resources/security/sample.pem | 51 ++++++++++---------- src/test/resources/security/test-kirk.jks | Bin 3874 -> 4504 bytes 7 files changed, 150 insertions(+), 151 deletions(-) diff --git a/src/test/resources/security/esnode-key.pem b/src/test/resources/security/esnode-key.pem index 4ac2cb57a..567f85c93 100644 --- a/src/test/resources/security/esnode-key.pem +++ b/src/test/resources/security/esnode-key.pem @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCWvn+O+rywfgMC -ud24mAclMDfuNA/IzCKLxl5usIE/PvUm7PPfXQ14LfQhNQXqOuaD9fiVM+HO1BzK -wmN3j4g7eHInR1cxENoNGKFa0Fr9EXnUv8sfwyobPD8NTu9eaH7T+d6f9oow+Q4n -xb9Xin5IRR/pcJ8v7zEjcXpZaZejcSU4iVZ0PR2Di4H9rfe9SEyR5wLrsVBePB3L -jaL1uK4bZF3n/JGgDe3BNy1PgPU+O+FCzQipBBTyJWQCjd4iTRXVbMa01PglAR85 -O9w6NXApBLyWdGRY6dGd8vMC2P4KlhnxlcgPZdglKniGTX+eTzT7Rszq77zjYrou -PLwSh9S7AgMBAAECggEABwiohxFoEIwws8XcdKqTWsbfNTw0qFfuHLuK2Htf7IWR -htlzn66F3F+4jnwc5IsPCoVFriCXnsEC/usHHSMTZkL+gJqxlNaGdin6DXS/aiOQ -nb69SaQfqNmsz4ApZyxVDqsQGkK0vAhDAtQVU45gyhp/nLLmmqP8lPzMirOEodmp -U9bA8t/ttrzng7SVAER42f6IVpW0iTKTLyFii0WZbq+ObViyqib9hVFrI6NJuQS+ -IelcZB0KsSi6rqIjXg1XXyMiIUcSlhq+GfEa18AYgmsbPwMbExate7/8Ci7ZtCbh -lx9bves2+eeqq5EMm3sMHyhdcg61yzd5UYXeZhwJkQKBgQDS9YqrAtztvLY2gMgv -d+wOjb9awWxYbQTBjx33kf66W+pJ+2j8bI/XX2CpZ98w/oq8VhMqbr9j5b8MfsrF -EoQvedA4joUo8sXd4j1mR2qKF4/KLmkgy6YYusNP2UrVSw7sh77bzce+YaVVoO/e -0wIVTHuD/QZ6fG6MasOqcbl6hwKBgQC27cQruaHFEXR/16LrMVAX+HyEEv44KOCZ -ij5OE4P7F0twb+okngG26+OJV3BtqXf0ULlXJ+YGwXCRf6zUZkld3NMy3bbKPgH6 -H/nf3BxqS2tudj7+DV52jKtisBghdvtlKs56oc9AAuwOs37DvhptBKUPdzDDqfys -Qchv5JQdLQKBgERev+pcqy2Bk6xmYHrB6wdseS/4sByYeIoi0BuEfYH4eB4yFPx6 -UsQCbVl6CKPgWyZe3ydJbU37D8gE78KfFagtWoZ56j4zMF2RDUUwsB7BNCDamce/ -OL2bCeG/Erm98cBG3lxufOX+z47I8fTNfkdY2k8UmhzoZwurLm73HJ3RAoGBAKsp -6yamuXF2FbYRhUXgjHsBbTD/vJO72/yO2CGiLRpi/5mjfkjo99269trp0C8sJSub -5PBiSuADXFsoRgUv+HI1UAEGaCTwxFTQWrRWdtgW3d0sE2EQDVWL5kmfT9TwSeat -mSoyAYR5t3tCBNkPJhbgA7pm4mASzHQ50VyxWs25AoGBAKPFx9X2oKhYQa+mW541 -bbqRuGFMoXIIcr/aeM3LayfLETi48o5NDr2NDP11j4yYuz26YLH0Dj8aKpWuehuH -uB27n6j6qu0SVhQi6mMJBe1JrKbzhqMKQjYOoy8VsC2gdj5pCUP/kLQPW7zm9diX -CiKTtKgPIeYdigor7V3AHcVT +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCm93kXteDQHMAv +bUPNPW5pyRHKDD42XGWSgq0k1D29C/UdyL21HLzTJa49ZU2ldIkSKs9JqbkHdyK0 +o8MO6L8dotLoYbxDWbJFW8bp1w6tDTU0HGkn47XVu3EwbfrTENg3jFu+Oem6a/50 +1SzITzJWtS0cn2dIFOBimTVpT/4Zv5qrXA6Cp4biOmoTYWhi/qQl8d0IaADiqoZ1 +MvZbZ6x76qTrRAbg+UWkpTEXoH1xTc8ndibR7+HP6OTqCKvo1NhE8uP4pY+fWd6b +6l+KLo3IKpfTbAIJXIO+M67FLtWKtttDao94B069skzKk6FPgW/OZh6PRCD0oxOa +vV+ld2SjAgMBAAECggEAQK1+uAOZeaSZggW2jQut+MaN4JHLi61RH2cFgU3COLgo +FIiNjFn8f2KKU3gpkt1It8PjlmprpYut4wHI7r6UQfuv7ZrmncRiPWHm9PB82+ZQ +5MXYqj4YUxoQJ62Cyz4sM6BobZDrjG6HHGTzuwiKvHHkbsEE9jQ4E5m7yfbVvM0O +zvwrSOM1tkZihKSTpR0j2+taji914tjBssbn12TMZQL5ItGnhR3luY8mEwT9MNkZ +xg0VcREoAH+pu9FE0vPUgLVzhJ3be7qZTTSRqv08bmW+y1plu80GbppePcgYhEow +dlW4l6XPJaHVSn1lSFHE6QAx6sqiAnBz0NoTPIaLyQKBgQDZqDOlhCRciMRicSXn +7yid9rhEmdMkySJHTVFOidFWwlBcp0fGxxn8UNSBcXdSy7GLlUtH41W9PWl8tp9U +hQiiXORxOJ7ZcB80uNKXF01hpPj2DpFPWyHFxpDkWiTAYpZl68rOlYujxZUjJIej +VvcykBC2BlEOG9uZv2kxcqLyJwKBgQDEYULTxaTuLIa17wU3nAhaainKB3vHxw9B +Ksy5p3ND43UNEKkQm7K/WENx0q47TA1mKD9i+BhaLod98mu0YZ+BCUNgWKcBHK8c +uXpauvM/pLhFLXZ2jvEJVpFY3J79FSRK8bwE9RgKfVKMMgEk4zOyZowS8WScOqiy +hnQn1vKTJQKBgElhYuAnl9a2qXcC7KOwRsJS3rcKIVxijzL4xzOyVShp5IwIPbOv +hnxBiBOH/JGmaNpFYBcBdvORE9JfA4KMQ2fx53agfzWRjoPI1/7mdUk5RFI4gRb/ +A3jZRBoopgFSe6ArCbnyQxzYzToG48/Wzwp19ZxYrtUR4UyJct6f5n27AoGBAJDh +KIpQQDOvCdtjcbfrF4aM2DPCfaGPzENJriwxy6oEPzDaX8Bu/dqI5Ykt43i/zQrX +GpyLaHvv4+oZVTiI5UIvcVO9U8hQPyiz9f7F+fu0LHZs6f7hyhYXlbe3XFxeop3f +5dTKdWgXuTTRF2L9dABkA2deS9mutRKwezWBMQk5AoGBALPtX0FrT1zIosibmlud +tu49A/0KZu4PBjrFMYTSEWGNJez3Fb2VsJwylVl6HivwbP61FhlYfyksCzQQFU71 ++x7Nmybp7PmpEBECr3deoZKQ/acNHn0iwb0It+YqV5+TquQebqgwK6WCLsMuiYKT +bg/ch9Rhxbq22yrVgWHh6epp -----END PRIVATE KEY----- diff --git a/src/test/resources/security/esnode.pem b/src/test/resources/security/esnode.pem index 7ba92534e..a1fc20a77 100644 --- a/src/test/resources/security/esnode.pem +++ b/src/test/resources/security/esnode.pem @@ -1,28 +1,25 @@ -----BEGIN CERTIFICATE----- -MIIEyTCCA7GgAwIBAgIGAWLrc1O2MA0GCSqGSIb3DQEBCwUAMIGPMRMwEQYKCZIm -iZPyLGQBGRYDY29tMRcwFQYKCZImiZPyLGQBGRYHZXhhbXBsZTEZMBcGA1UECgwQ -RXhhbXBsZSBDb20gSW5jLjEhMB8GA1UECwwYRXhhbXBsZSBDb20gSW5jLiBSb290 -IENBMSEwHwYDVQQDDBhFeGFtcGxlIENvbSBJbmMuIFJvb3QgQ0EwHhcNMTgwNDIy -MDM0MzQ3WhcNMjgwNDE5MDM0MzQ3WjBeMRIwEAYKCZImiZPyLGQBGRYCZGUxDTAL -BgNVBAcMBHRlc3QxDTALBgNVBAoMBG5vZGUxDTALBgNVBAsMBG5vZGUxGzAZBgNV -BAMMEm5vZGUtMC5leGFtcGxlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAJa+f476vLB+AwK53biYByUwN+40D8jMIovGXm6wgT8+9Sbs899dDXgt -9CE1Beo65oP1+JUz4c7UHMrCY3ePiDt4cidHVzEQ2g0YoVrQWv0RedS/yx/DKhs8 -Pw1O715oftP53p/2ijD5DifFv1eKfkhFH+lwny/vMSNxellpl6NxJTiJVnQ9HYOL -gf2t971ITJHnAuuxUF48HcuNovW4rhtkXef8kaAN7cE3LU+A9T474ULNCKkEFPIl -ZAKN3iJNFdVsxrTU+CUBHzk73Do1cCkEvJZ0ZFjp0Z3y8wLY/gqWGfGVyA9l2CUq -eIZNf55PNPtGzOrvvONiui48vBKH1LsCAwEAAaOCAVkwggFVMIG8BgNVHSMEgbQw -gbGAFJI1DOAPHitF9k0583tfouYSl0BzoYGVpIGSMIGPMRMwEQYKCZImiZPyLGQB -GRYDY29tMRcwFQYKCZImiZPyLGQBGRYHZXhhbXBsZTEZMBcGA1UECgwQRXhhbXBs -ZSBDb20gSW5jLjEhMB8GA1UECwwYRXhhbXBsZSBDb20gSW5jLiBSb290IENBMSEw -HwYDVQQDDBhFeGFtcGxlIENvbSBJbmMuIFJvb3QgQ0GCAQEwHQYDVR0OBBYEFKyv -78ZmFjVKM9g7pMConYH7FVBHMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgXg -MCAGA1UdJQEB/wQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjA1BgNVHREELjAsiAUq -AwQFBYISbm9kZS0wLmV4YW1wbGUuY29tgglsb2NhbGhvc3SHBH8AAAEwDQYJKoZI -hvcNAQELBQADggEBAIOKuyXsFfGv1hI/Lkpd/73QNqjqJdxQclX57GOMWNbOM5H0 -5/9AOIZ5JQsWULNKN77aHjLRr4owq2jGbpc/Z6kAd+eiatkcpnbtbGrhKpOtoEZy -8KuslwkeixpzLDNISSbkeLpXz4xJI1ETMN/VG8ZZP1bjzlHziHHDu0JNZ6TnNzKr -XzCGMCohFfem8vnKNnKUneMQMvXd3rzUaAgvtf7Hc2LTBlf4fZzZF1EkwdSXhaMA -1lkfHiqOBxtgeDLxCHESZ2fqgVqsWX+t3qHQfivcPW6txtDyrFPRdJOGhiMGzT/t -e/9kkAtQRgpTb3skYdIOOUOV0WGQ60kJlFhAzIs= +MIIEPDCCAySgAwIBAgIUZjrlDPP8azRDPZchA/XEsx0X2iIwDQYJKoZIhvcNAQEL +BQAwgY8xEzARBgoJkiaJk/IsZAEZFgNjb20xFzAVBgoJkiaJk/IsZAEZFgdleGFt +cGxlMRkwFwYDVQQKDBBFeGFtcGxlIENvbSBJbmMuMSEwHwYDVQQLDBhFeGFtcGxl +IENvbSBJbmMuIFJvb3QgQ0ExITAfBgNVBAMMGEV4YW1wbGUgQ29tIEluYy4gUm9v +dCBDQTAeFw0yMzA4MjkwNDIzMTJaFw0zMzA4MjYwNDIzMTJaMFcxCzAJBgNVBAYT +AmRlMQ0wCwYDVQQHDAR0ZXN0MQ0wCwYDVQQKDARub2RlMQ0wCwYDVQQLDARub2Rl +MRswGQYDVQQDDBJub2RlLTAuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQCm93kXteDQHMAvbUPNPW5pyRHKDD42XGWSgq0k1D29C/Ud +yL21HLzTJa49ZU2ldIkSKs9JqbkHdyK0o8MO6L8dotLoYbxDWbJFW8bp1w6tDTU0 +HGkn47XVu3EwbfrTENg3jFu+Oem6a/501SzITzJWtS0cn2dIFOBimTVpT/4Zv5qr +XA6Cp4biOmoTYWhi/qQl8d0IaADiqoZ1MvZbZ6x76qTrRAbg+UWkpTEXoH1xTc8n +dibR7+HP6OTqCKvo1NhE8uP4pY+fWd6b6l+KLo3IKpfTbAIJXIO+M67FLtWKtttD +ao94B069skzKk6FPgW/OZh6PRCD0oxOavV+ld2SjAgMBAAGjgcYwgcMwRwYDVR0R +BEAwPogFKgMEBQWCEm5vZGUtMC5leGFtcGxlLmNvbYIJbG9jYWxob3N0hxAAAAAA +AAAAAAAAAAAAAAABhwR/AAABMAsGA1UdDwQEAwIF4DAdBgNVHSUEFjAUBggrBgEF +BQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQU0/qDQaY10jIo +wCjLUpz/HfQXyt8wHwYDVR0jBBgwFoAUF4ffoFrrZhKn1dD4uhJFPLcrAJwwDQYJ +KoZIhvcNAQELBQADggEBAD2hkndVih6TWxoe/oOW0i2Bq7ScNO/n7/yHWL04HJmR +MaHv/Xjc8zLFLgHuHaRvC02ikWIJyQf5xJt0Oqu2GVbqXH9PBGKuEP2kCsRRyU27 +zTclAzfQhqmKBTYQ/3lJ3GhRQvXIdYTe+t4aq78TCawp1nSN+vdH/1geG6QjMn5N +1FU8tovDd4x8Ib/0dv8RJx+n9gytI8n/giIaDCEbfLLpe4EkV5e5UNpOnRgJjjuy +vtZutc81TQnzBtkS9XuulovDE0qI+jQrKkKu8xgGLhgH0zxnPkKtUg2I3Aq6zl1L +zYkEOUF8Y25J6WeY88Yfnc0iigI+Pnz5NK8R9GL7TYo= -----END CERTIFICATE----- diff --git a/src/test/resources/security/kirk-key.pem b/src/test/resources/security/kirk-key.pem index bacb22c21..fd1728cda 100644 --- a/src/test/resources/security/kirk-key.pem +++ b/src/test/resources/security/kirk-key.pem @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDCwgBOoO88uMM8 -dREJsk58Yt4Jn0zwQ2wUThbvy3ICDiEWhiAhUbg6dTggpS5vWWJto9bvaaqgMVoh -ElfYHdTDncX3UQNBEP8tqzHON6BFEFSGgJRGLd6f5dri6rK32nCotYS61CFXBFxf -WumXjSukjyrcTsdkR3C5QDo2oN7F883MOQqRENPzAtZi9s3jNX48u+/e3yvJzXsB -GS9Qmsye6C71enbIujM4CVwDT/7a5jHuaUp6OuNCFbdRPnu/wLYwOS2/yOtzAqk7 -/PFnPCe7YOa10ShnV/jx2sAHhp7ZQBJgFkkgnIERz9Ws74Au+EbptWnsWuB+LqRL -x5G02IzpAgMBAAECggEAEzwnMkeBbqqDgyRqFbO/PgMNvD7i0b/28V0dCtCPEVY6 -klzrg3RCERP5V9AN8VVkppYjPkCzZ2A4b0JpMUu7ncOmr7HCnoSCj2IfEyePSVg+ -4OHbbcBOAoDTHiI2myM/M9++8izNS34qGV4t6pfjaDyeQQ/5cBVWNBWnKjS34S5H -rJWpAcDgxYk5/ah2Xs2aULZlXDMxbSikjrv+n4JIYTKFQo8ydzL8HQDBRmXAFLjC -gNOSHf+5u1JdpY3uPIxK1ugVf8zPZ4/OEB23j56uu7c8+sZ+kZwfRWAQmMhFVG/y -OXxoT5mOruBsAw29m2Ijtxg252/YzSTxiDqFziB/eQKBgQDjeVAdi55GW/bvhuqn -xME/An8E3hI/FyaaITrMQJUBjiCUaStTEqUgQ6A7ZfY/VX6qafOX7sli1svihrXC -uelmKrdve/CFEEqzX9JWWRiPiQ0VZD+EQRsJvX85Tw2UGvVUh6dO3UGPS0BhplMD -jeVpyXgZ7Gy5we+DWjfwhYrCmwKBgQDbLmQhRy+IdVljObZmv3QtJ0cyxxZETWzU -MKmgBFvcRw+KvNwO+Iy0CHEbDu06Uj63kzI2bK3QdINaSrjgr8iftXIQpBmcgMF+ -a1l5HtHlCp6RWd55nWQOEvn36IGN3cAaQkXuh4UYM7QfEJaAbzJhyJ+wXA3jWqUd -8bDTIAZ0ywKBgFuZ44gyTAc7S2JDa0Up90O/ZpT4NFLRqMrSbNIJg7d/m2EIRNkM -HhCzCthAg/wXGo3XYq+hCdnSc4ICCzmiEfoBY6LyPvXmjJ5VDOeWs0xBvVIK74T7 -jr7KX2wdiHNGs9pZUidw89CXVhK8nptEzcheyA1wZowbK68yamph7HHXAoGBAK3x -7D9Iyl1mnDEWPT7f1Gh9UpDm1TIRrDvd/tBihTCVKK13YsFy2d+LD5Bk0TpGyUVR -STlOGMdloFUJFh4jA3pUOpkgUr8Uo/sbYN+x6Ov3+I3sH5aupRhSURVA7YhUIz/z -tqIt5R+m8Nzygi6dkQNvf+Qruk3jw0S3ahizwsvvAoGAL7do6dTLp832wFVxkEf4 -gg1M6DswfkgML5V/7GQ3MkIX/Hrmiu+qSuHhDGrp9inZdCDDYg5+uy1+2+RBMRZ3 -vDUUacvc4Fep05zp7NcjgU5y+/HWpuKVvLIlZAO1MBY4Xinqqii6RdxukIhxw7eT -C6TPL5KAcV1R/XAihDhI18Y= +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCVXDgEJQorgfXp +gpY0TgF55bD2xuzxN5Dc9rDfgWxrsOvOloMpd7k6FR71bKWjJi1KptSmM/cDElky +AWYKSfYWGiGxsQ+EQW+6kwCfEOHXQldn+0+JcWqP+osSPjtJfwRvRN5kRqP69MPo +7U0N2kdqenqMWjmG1chDGLRSOEGU5HIBiDxsZtOcvMaJ8b1eaW0lvS+6gFQ80AvB +GBkDDCOHHLtDXBylrZk2CQP8AzxNicIZ4B8G3CG3OHA8+nBtEtxZoIihrrkqlMt+ +b/5N8u8zB0Encew0kdrc4R/2wS//ahr6U+9Siq8T7WsUtGwKj3BJClg6OyDJRhlu +y2gFnxoPAgMBAAECggEAP5TOycDkx+megAWVoHV2fmgvgZXkBrlzQwUG/VZQi7V4 +ZGzBMBVltdqI38wc5MtbK3TCgHANnnKgor9iq02Z4wXDwytPIiti/ycV9CDRKvv0 +TnD2hllQFjN/IUh5n4thHWbRTxmdM7cfcNgX3aZGkYbLBVVhOMtn4VwyYu/Mxy8j +xClZT2xKOHkxqwmWPmdDTbAeZIbSv7RkIGfrKuQyUGUaWhrPslvYzFkYZ0umaDgQ +OAthZew5Bz3OfUGOMPLH61SVPuJZh9zN1hTWOvT65WFWfsPd2yStI+WD/5PU1Doo +1RyeHJO7s3ug8JPbtNJmaJwHe9nXBb/HXFdqb976yQKBgQDNYhpu+MYSYupaYqjs +9YFmHQNKpNZqgZ4ceRFZ6cMJoqpI5dpEMqToFH7tpor72Lturct2U9nc2WR0HeEs +/6tiptyMPTFEiMFb1opQlXF2ae7LeJllntDGN0Q6vxKnQV+7VMcXA0Y8F7tvGDy3 +qJu5lfvB1mNM2I6y/eMxjBuQhwKBgQC6K41DXMFro0UnoO879pOQYMydCErJRmjG +/tZSy3Wj4KA/QJsDSViwGfvdPuHZRaG9WtxdL6kn0w1exM9Rb0bBKl36lvi7o7xv +M+Lw9eyXMkww8/F5d7YYH77gIhGo+RITkKI3+5BxeBaUnrGvmHrpmpgRXWmINqr0 +0jsnN3u0OQKBgCf45vIgItSjQb8zonLz2SpZjTFy4XQ7I92gxnq8X0Q5z3B+o7tQ +K/4rNwTju/sGFHyXAJlX+nfcK4vZ4OBUJjP+C8CTjEotX4yTNbo3S6zjMyGQqDI5 +9aIOUY4pb+TzeUFJX7If5gR+DfGyQubvvtcg1K3GHu9u2l8FwLj87sRzAoGAflQF +RHuRiG+/AngTPnZAhc0Zq0kwLkpH2Rid6IrFZhGLy8AUL/O6aa0IGoaMDLpSWUJp +nBY2S57MSM11/MVslrEgGmYNnI4r1K25xlaqV6K6ztEJv6n69327MS4NG8L/gCU5 +3pEm38hkUi8pVYU7in7rx4TCkrq94OkzWJYurAkCgYATQCL/rJLQAlJIGulp8s6h +mQGwy8vIqMjAdHGLrCS35sVYBXG13knS52LJHvbVee39AbD5/LlWvjJGlQMzCLrw +F7oILW5kXxhb8S73GWcuMbuQMFVHFONbZAZgn+C9FW4l7XyRdkrbR1MRZ2km8YMs +/AHmo368d4PSNRMMzLHw8Q== -----END PRIVATE KEY----- diff --git a/src/test/resources/security/kirk.pem b/src/test/resources/security/kirk.pem index c32b21cd8..716b4ec4d 100644 --- a/src/test/resources/security/kirk.pem +++ b/src/test/resources/security/kirk.pem @@ -1,26 +1,27 @@ -----BEGIN CERTIFICATE----- -MIIEdzCCA1+gAwIBAgIGAWLrc1O4MA0GCSqGSIb3DQEBCwUAMIGPMRMwEQYKCZIm -iZPyLGQBGRYDY29tMRcwFQYKCZImiZPyLGQBGRYHZXhhbXBsZTEZMBcGA1UECgwQ -RXhhbXBsZSBDb20gSW5jLjEhMB8GA1UECwwYRXhhbXBsZSBDb20gSW5jLiBSb290 -IENBMSEwHwYDVQQDDBhFeGFtcGxlIENvbSBJbmMuIFJvb3QgQ0EwHhcNMTgwNDIy -MDM0MzQ3WhcNMjgwNDE5MDM0MzQ3WjBNMQswCQYDVQQGEwJkZTENMAsGA1UEBwwE -dGVzdDEPMA0GA1UECgwGY2xpZW50MQ8wDQYDVQQLDAZjbGllbnQxDTALBgNVBAMM -BGtpcmswggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDCwgBOoO88uMM8 -dREJsk58Yt4Jn0zwQ2wUThbvy3ICDiEWhiAhUbg6dTggpS5vWWJto9bvaaqgMVoh -ElfYHdTDncX3UQNBEP8tqzHON6BFEFSGgJRGLd6f5dri6rK32nCotYS61CFXBFxf -WumXjSukjyrcTsdkR3C5QDo2oN7F883MOQqRENPzAtZi9s3jNX48u+/e3yvJzXsB -GS9Qmsye6C71enbIujM4CVwDT/7a5jHuaUp6OuNCFbdRPnu/wLYwOS2/yOtzAqk7 -/PFnPCe7YOa10ShnV/jx2sAHhp7ZQBJgFkkgnIERz9Ws74Au+EbptWnsWuB+LqRL -x5G02IzpAgMBAAGjggEYMIIBFDCBvAYDVR0jBIG0MIGxgBSSNQzgDx4rRfZNOfN7 -X6LmEpdAc6GBlaSBkjCBjzETMBEGCgmSJomT8ixkARkWA2NvbTEXMBUGCgmSJomT -8ixkARkWB2V4YW1wbGUxGTAXBgNVBAoMEEV4YW1wbGUgQ29tIEluYy4xITAfBgNV -BAsMGEV4YW1wbGUgQ29tIEluYy4gUm9vdCBDQTEhMB8GA1UEAwwYRXhhbXBsZSBD -b20gSW5jLiBSb290IENBggEBMB0GA1UdDgQWBBRsdhuHn3MGDvZxOe22+1wliCJB -mDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIF4DAWBgNVHSUBAf8EDDAKBggr -BgEFBQcDAjANBgkqhkiG9w0BAQsFAAOCAQEAkPrUTKKn+/6g0CjhTPBFeX8mKXhG -zw5z9Oq+xnwefZwxV82E/tgFsPcwXcJIBg0f43BaVSygPiV7bXqWhxASwn73i24z -lveIR4+z56bKIhP6c3twb8WWR9yDcLu2Iroin7dYEm3dfVUrhz/A90WHr6ddwmLL -3gcFF2kBu3S3xqM5OmN/tqRXFmo+EvwrdJRiTh4Fsf0tX1ZT07rrGvBFYktK7Kma -lqDl4UDCF1UWkiiFubc0Xw+DR6vNAa99E0oaphzvCmITU1wITNnYZTKzVzQ7vUCq -kLmXOFLTcxTQpptxSo5xDD3aTpzWGCvjExCKpXQtsITUOYtZc02AGjjPOQ== +MIIEmDCCA4CgAwIBAgIUZjrlDPP8azRDPZchA/XEsx0X2iYwDQYJKoZIhvcNAQEL +BQAwgY8xEzARBgoJkiaJk/IsZAEZFgNjb20xFzAVBgoJkiaJk/IsZAEZFgdleGFt +cGxlMRkwFwYDVQQKDBBFeGFtcGxlIENvbSBJbmMuMSEwHwYDVQQLDBhFeGFtcGxl +IENvbSBJbmMuIFJvb3QgQ0ExITAfBgNVBAMMGEV4YW1wbGUgQ29tIEluYy4gUm9v +dCBDQTAeFw0yMzA4MjkyMDA2MzdaFw0zMzA4MjYyMDA2MzdaME0xCzAJBgNVBAYT +AmRlMQ0wCwYDVQQHDAR0ZXN0MQ8wDQYDVQQKDAZjbGllbnQxDzANBgNVBAsMBmNs +aWVudDENMAsGA1UEAwwEa2lyazCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAJVcOAQlCiuB9emCljROAXnlsPbG7PE3kNz2sN+BbGuw686Wgyl3uToVHvVs +paMmLUqm1KYz9wMSWTIBZgpJ9hYaIbGxD4RBb7qTAJ8Q4ddCV2f7T4lxao/6ixI+ +O0l/BG9E3mRGo/r0w+jtTQ3aR2p6eoxaOYbVyEMYtFI4QZTkcgGIPGxm05y8xonx +vV5pbSW9L7qAVDzQC8EYGQMMI4ccu0NcHKWtmTYJA/wDPE2JwhngHwbcIbc4cDz6 +cG0S3FmgiKGuuSqUy35v/k3y7zMHQSdx7DSR2tzhH/bBL/9qGvpT71KKrxPtaxS0 +bAqPcEkKWDo7IMlGGW7LaAWfGg8CAwEAAaOCASswggEnMAwGA1UdEwEB/wQCMAAw +DgYDVR0PAQH/BAQDAgXgMBYGA1UdJQEB/wQMMAoGCCsGAQUFBwMCMIHPBgNVHSME +gccwgcSAFBeH36Ba62YSp9XQ+LoSRTy3KwCcoYGVpIGSMIGPMRMwEQYKCZImiZPy +LGQBGRYDY29tMRcwFQYKCZImiZPyLGQBGRYHZXhhbXBsZTEZMBcGA1UECgwQRXhh +bXBsZSBDb20gSW5jLjEhMB8GA1UECwwYRXhhbXBsZSBDb20gSW5jLiBSb290IENB +MSEwHwYDVQQDDBhFeGFtcGxlIENvbSBJbmMuIFJvb3QgQ0GCFHfkrz782p+T9k0G +xGeM4+BrehWKMB0GA1UdDgQWBBSjMS8tgguX/V7KSGLoGg7K6XMzIDANBgkqhkiG +9w0BAQsFAAOCAQEANMwD1JYlwAh82yG1gU3WSdh/tb6gqaSzZK7R6I0L7slaXN9m +y2ErUljpTyaHrdiBFmPhU/2Kj2r+fIUXtXdDXzizx/JdmueT0nG9hOixLqzfoC9p +fAhZxM62RgtyZoaczQN82k1/geMSwRpEndFe3OH7arkS/HSbIFxQhAIy229eWe5d +1bUzP59iu7f3r567I4ob8Vy7PP+Ov35p7Vv4oDHHwgsdRzX6pvL6mmwVrQ3BfVec +h9Dqprr+ukYmjho76g6k5cQuRaB6MxqldzUg+2E7IHQP8MCF+co51uZq2nl33mtp +RGr6JbdHXc96zsLTL3saJQ8AWEfu1gbTVrwyRA== -----END CERTIFICATE----- diff --git a/src/test/resources/security/root-ca.pem b/src/test/resources/security/root-ca.pem index 4015d866e..5948a73b3 100644 --- a/src/test/resources/security/root-ca.pem +++ b/src/test/resources/security/root-ca.pem @@ -1,24 +1,28 @@ -----BEGIN CERTIFICATE----- -MIID/jCCAuagAwIBAgIBATANBgkqhkiG9w0BAQsFADCBjzETMBEGCgmSJomT8ixk -ARkWA2NvbTEXMBUGCgmSJomT8ixkARkWB2V4YW1wbGUxGTAXBgNVBAoMEEV4YW1w -bGUgQ29tIEluYy4xITAfBgNVBAsMGEV4YW1wbGUgQ29tIEluYy4gUm9vdCBDQTEh -MB8GA1UEAwwYRXhhbXBsZSBDb20gSW5jLiBSb290IENBMB4XDTE4MDQyMjAzNDM0 -NloXDTI4MDQxOTAzNDM0NlowgY8xEzARBgoJkiaJk/IsZAEZFgNjb20xFzAVBgoJ -kiaJk/IsZAEZFgdleGFtcGxlMRkwFwYDVQQKDBBFeGFtcGxlIENvbSBJbmMuMSEw -HwYDVQQLDBhFeGFtcGxlIENvbSBJbmMuIFJvb3QgQ0ExITAfBgNVBAMMGEV4YW1w -bGUgQ29tIEluYy4gUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAK/u+GARP5innhpXK0c0q7s1Su1VTEaIgmZr8VWI6S8amf5cU3ktV7WT9SuV -TsAm2i2A5P+Ctw7iZkfnHWlsC3HhPUcd6mvzGZ4moxnamM7r+a9otRp3owYoGStX -ylVTQusAjbq9do8CMV4hcBTepCd+0w0v4h6UlXU8xjhj1xeUIz4DKbRgf36q0rv4 -VIX46X72rMJSETKOSxuwLkov1ZOVbfSlPaygXIxqsHVlj1iMkYRbQmaTib6XWHKf -MibDaqDejOhukkCjzpptGZOPFQ8002UtTTNv1TiaKxkjMQJNwz6jfZ53ws3fh1I0 -RWT6WfM4oeFRFnyFRmc4uYTUgAkCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAf -BgNVHSMEGDAWgBSSNQzgDx4rRfZNOfN7X6LmEpdAczAdBgNVHQ4EFgQUkjUM4A8e -K0X2TTnze1+i5hKXQHMwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4IB -AQBoQHvwsR34hGO2m8qVR9nQ5Klo5HYPyd6ySKNcT36OZ4AQfaCGsk+SecTi35QF -RHL3g2qffED4tKR0RBNGQSgiLavmHGCh3YpDupKq2xhhEeS9oBmQzxanFwWFod4T -nnsG2cCejyR9WXoRzHisw0KJWeuNlwjUdJY0xnn16srm1zL/M/f0PvCyh9HU1mF1 -ivnOSqbDD2Z7JSGyckgKad1Omsg/rr5XYtCeyJeXUPcmpeX6erWJJNTUh6yWC/hY -G/dFC4xrJhfXwz6Z0ytUygJO32bJG4Np2iGAwvvgI9EfxzEv/KP+FGrJOvQJAq4/ -BU36ZAa80W/8TBnqZTkNnqZV +MIIExjCCA66gAwIBAgIUd+SvPvzan5P2TQbEZ4zj4Gt6FYowDQYJKoZIhvcNAQEL +BQAwgY8xEzARBgoJkiaJk/IsZAEZFgNjb20xFzAVBgoJkiaJk/IsZAEZFgdleGFt +cGxlMRkwFwYDVQQKDBBFeGFtcGxlIENvbSBJbmMuMSEwHwYDVQQLDBhFeGFtcGxl +IENvbSBJbmMuIFJvb3QgQ0ExITAfBgNVBAMMGEV4YW1wbGUgQ29tIEluYy4gUm9v +dCBDQTAeFw0yMzA4MjkwNDIwMDNaFw0yMzA5MjgwNDIwMDNaMIGPMRMwEQYKCZIm +iZPyLGQBGRYDY29tMRcwFQYKCZImiZPyLGQBGRYHZXhhbXBsZTEZMBcGA1UECgwQ +RXhhbXBsZSBDb20gSW5jLjEhMB8GA1UECwwYRXhhbXBsZSBDb20gSW5jLiBSb290 +IENBMSEwHwYDVQQDDBhFeGFtcGxlIENvbSBJbmMuIFJvb3QgQ0EwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDEPyN7J9VGPyJcQmCBl5TGwfSzvVdWwoQU +j9aEsdfFJ6pBCDQSsj8Lv4RqL0dZra7h7SpZLLX/YZcnjikrYC+rP5OwsI9xEE/4 +U98CsTBPhIMgqFK6SzNE5494BsAk4cL72dOOc8tX19oDS/PvBULbNkthQ0aAF1dg +vbrHvu7hq7LisB5ZRGHVE1k/AbCs2PaaKkn2jCw/b+U0Ml9qPuuEgz2mAqJDGYoA +WSR4YXrOcrmPuRqbws464YZbJW898/0Pn/U300ed+4YHiNYLLJp51AMkR4YEw969 +VRPbWIvLrd0PQBooC/eLrL6rvud/GpYhdQEUx8qcNCKd4bz3OaQ5AgMBAAGjggEW +MIIBEjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQU +F4ffoFrrZhKn1dD4uhJFPLcrAJwwgc8GA1UdIwSBxzCBxIAUF4ffoFrrZhKn1dD4 +uhJFPLcrAJyhgZWkgZIwgY8xEzARBgoJkiaJk/IsZAEZFgNjb20xFzAVBgoJkiaJ +k/IsZAEZFgdleGFtcGxlMRkwFwYDVQQKDBBFeGFtcGxlIENvbSBJbmMuMSEwHwYD +VQQLDBhFeGFtcGxlIENvbSBJbmMuIFJvb3QgQ0ExITAfBgNVBAMMGEV4YW1wbGUg +Q29tIEluYy4gUm9vdCBDQYIUd+SvPvzan5P2TQbEZ4zj4Gt6FYowDQYJKoZIhvcN +AQELBQADggEBAIopqco/k9RSjouTeKP4z0EVUxdD4qnNh1GLSRqyAVe0aChyKF5f +qt1Bd1XCY8D16RgekkKGHDpJhGCpel+vtIoXPBxUaGQNYxmJCf5OzLMODlcrZk5i +jHIcv/FMeK02NBcz/WQ3mbWHVwXLhmwqa2zBsF4FmPCJAbFLchLhkAv1HJifHbnD +jQzlKyl5jxam/wtjWxSm0iyso0z2TgyzY+MESqjEqB1hZkCFzD1xtUOCxbXgtKae +dgfHVFuovr3fNLV3GvQk0s9okDwDUcqV7DSH61e5bUMfE84o3of8YA7+HUoPV5Du +8sTOKRf7ncGXdDRA8aofW268pTCuIu3+g/Y= -----END CERTIFICATE----- diff --git a/src/test/resources/security/sample.pem b/src/test/resources/security/sample.pem index fa785ca10..a1fc20a77 100644 --- a/src/test/resources/security/sample.pem +++ b/src/test/resources/security/sample.pem @@ -1,28 +1,25 @@ -----BEGIN CERTIFICATE----- -MIIEyTCCA7GgAwIBAgIGAWLrc1O2MA0GCSqGSIb3DQEBCwUAMIGPMRMwEQYKCZIm -iZPyLGQBGRYDY29tMRcwFQYKCZImiZPyLGQBGRYHZXhhbXBsZTEZMBcGA1UECgwQ -RXhhbXBsZSBDb20gSW5jLjEhMB8GA1UECwwYRXhhbXBsZSBDb20gSW5jLiBSb290 -IENBMSEwHwYDVQQDDBhFeGFtcGxlIENvbSBJbmMuIFJvb3QgQ0EwHhcNMTgwNDIy -MDM0MzQ3WhcNMjgwNDE5MDM0MzQ3WjBeMRIwEAYKCZImiZPyLGQBGRYCZGUxDTAL -BgNVBAcMBHRlc3QxDTALBgNVBAoMBG5vZGUxDTALBgNVBAsMBG5vZGUxGzAZBgNV -BAMMEm5vZGUtMC5leGFtcGxlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAJa+f476vLB+AwK53biYByUwN+40D8jMIovGXm6wgT8+9Sbs899dDXgt -9CE1Beo65oP1+JUz4c7UHMrCY3ePiDt4cidHVzEQ2g0YoVrQWv0RedS/yx/DKhs8 -Pw1O715oftP53p/2ijD5DifFv1eKfkhFH+lwny/vMSNxellpl6NxJTiJVnQ9HYOL -gf2t971ITJHnAuuxUF48HcuNovW4rhtkXef8kaAN7cE3LU+A9T474ULNCKkEFPIl -ZAKN3iJNFdVsxrTU+CUBHzk73Do1cCkEvJZ0ZFjp0Z3y8wLY/gqWGfGVyA9l2CUq -eIZNf55PNPtGzOrvvONiui48vBKH1LsCAwEAAaOCAVkwggFVMIG8BgNVHSMEgbQw -gbGAFJI1DOAPHitF9k0583tfouYSl0BzoYGVpIGSMIGPMRMwEQYKCZImiZPyLGQB -GRYDY29tMRcwFQYKCZImiZPyLGQBGRYHZXhhbXBsZTEZMBcGA1UECgwQRXhhbXBs -ZSBDb20gSW5jLjEhMB8GA1UECwwYRXhhbXBsZSBDb20gSW5jLiBSb290IENBMSEw -HwYDVQQDDBhFeGFtcGxlIENvbSBJbmMuIFJvb3QgQ0GCAQEwHQYDVR0OBBYEFKyv -78ZmFjVKM9g7pMConYH7FVBHMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgXg -MCAGA1UdJQEB/wQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjA1BgNVHREELjAsiAUq -AwQFBYISbm9kZS0wLmV4YW1wbGUuY29tgglsb2NhbGhvc3SHBH8AAAEwDQYJKoZI -hvcNAQELBQADggEBAIOKuyXsFfGv1hI/Lkpd/73QNqjqJdxQclX57GOMWNbOM5H0 -5/9AOIZ5JQsWULNKN77aHjLRr4owq2jGbpc/Z6kAd+eiatkcpnbtbGrhKpOtoEZy -8KuslwkeixpzLDNISSbkeLpXz4xJI1ETMN/VG8ZZP1bjzlHziHHDu0JNZ6TnNzKr -XzCGMCohFfem8vnKNnKUneMQMvXd3rzUaAgvtf7Hc2LTBlf4fZzZF1EkwdSXhaMA -1lkfHiqOBxtgeDLxCHESZ2fqgVqsWX+t3qHQfivcPW6txtDyrFPRdJOGhiMGzT/t -e/9kkAtQRgpTb3skYdIOOUOV0WGQ60kJlFhAzIs= ------END CERTIFICATE----- \ No newline at end of file +MIIEPDCCAySgAwIBAgIUZjrlDPP8azRDPZchA/XEsx0X2iIwDQYJKoZIhvcNAQEL +BQAwgY8xEzARBgoJkiaJk/IsZAEZFgNjb20xFzAVBgoJkiaJk/IsZAEZFgdleGFt +cGxlMRkwFwYDVQQKDBBFeGFtcGxlIENvbSBJbmMuMSEwHwYDVQQLDBhFeGFtcGxl +IENvbSBJbmMuIFJvb3QgQ0ExITAfBgNVBAMMGEV4YW1wbGUgQ29tIEluYy4gUm9v +dCBDQTAeFw0yMzA4MjkwNDIzMTJaFw0zMzA4MjYwNDIzMTJaMFcxCzAJBgNVBAYT +AmRlMQ0wCwYDVQQHDAR0ZXN0MQ0wCwYDVQQKDARub2RlMQ0wCwYDVQQLDARub2Rl +MRswGQYDVQQDDBJub2RlLTAuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQCm93kXteDQHMAvbUPNPW5pyRHKDD42XGWSgq0k1D29C/Ud +yL21HLzTJa49ZU2ldIkSKs9JqbkHdyK0o8MO6L8dotLoYbxDWbJFW8bp1w6tDTU0 +HGkn47XVu3EwbfrTENg3jFu+Oem6a/501SzITzJWtS0cn2dIFOBimTVpT/4Zv5qr +XA6Cp4biOmoTYWhi/qQl8d0IaADiqoZ1MvZbZ6x76qTrRAbg+UWkpTEXoH1xTc8n +dibR7+HP6OTqCKvo1NhE8uP4pY+fWd6b6l+KLo3IKpfTbAIJXIO+M67FLtWKtttD +ao94B069skzKk6FPgW/OZh6PRCD0oxOavV+ld2SjAgMBAAGjgcYwgcMwRwYDVR0R +BEAwPogFKgMEBQWCEm5vZGUtMC5leGFtcGxlLmNvbYIJbG9jYWxob3N0hxAAAAAA +AAAAAAAAAAAAAAABhwR/AAABMAsGA1UdDwQEAwIF4DAdBgNVHSUEFjAUBggrBgEF +BQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQU0/qDQaY10jIo +wCjLUpz/HfQXyt8wHwYDVR0jBBgwFoAUF4ffoFrrZhKn1dD4uhJFPLcrAJwwDQYJ +KoZIhvcNAQELBQADggEBAD2hkndVih6TWxoe/oOW0i2Bq7ScNO/n7/yHWL04HJmR +MaHv/Xjc8zLFLgHuHaRvC02ikWIJyQf5xJt0Oqu2GVbqXH9PBGKuEP2kCsRRyU27 +zTclAzfQhqmKBTYQ/3lJ3GhRQvXIdYTe+t4aq78TCawp1nSN+vdH/1geG6QjMn5N +1FU8tovDd4x8Ib/0dv8RJx+n9gytI8n/giIaDCEbfLLpe4EkV5e5UNpOnRgJjjuy +vtZutc81TQnzBtkS9XuulovDE0qI+jQrKkKu8xgGLhgH0zxnPkKtUg2I3Aq6zl1L +zYkEOUF8Y25J6WeY88Yfnc0iigI+Pnz5NK8R9GL7TYo= +-----END CERTIFICATE----- diff --git a/src/test/resources/security/test-kirk.jks b/src/test/resources/security/test-kirk.jks index 174dbda656f41b10341adb78ab91a46afaae8a1c..6dbc51e714784fa58a4209c75deab8b9ed1698ff 100644 GIT binary patch literal 4504 zcma)AXEYp+vt7GZ$?DyT=tPUf>Rt32Rtcg+B4PQKLo)5nT`xBt(f8 zz4zYx{`1az=l47B(|aH0%$a-V&c}OZ28N+d1QLK?7-~f#Qh{)-@KbUEVuBnDwFn`G zTJSH-2g86X{uc$#Cd7a<{=zALBY_C=KPs|Y1i%~&Sotp~4}12H0!$9GfJy&blEDNC z=>%hA9@l)1y-8vD6#cH^U}=KBI0FdeqXH7J!^nt8{(B;j6byi|5|P@4YY{kr2nhrT zsl1TD93_M516EPM#9d4EG(rsFKtBW4^r*(5KwKbTLB){+^0E(}Q+A7HoW0lrA)@i+ zydGtY^95cAh7C?*2qIcESObb&7%#|($|(-eXIiQ#0>bYpj@=?*4?U=5@-ISTdSa4x zOtEjIWb0hr)D^1HVpX7-CjwnsDG8#WM@AVZvyufeW?}`^GtGW7WcGsVl)G*$?lP3S z^GYelg04B!ZBp4GnwCzq@uOLfB4xY#hE;StB61*Yd8?%(Nl9NW{s3+HODy#ik72s%Hj($a8 zhF0>hs}=106=eHlR<&9zT@LuHAUIZWLFWrKQ#$R3^=pv*&-7e6{O_Ji`|s`^^4v@-Hr>`?(V#!ktZ-$-0?Jt1G-G? zE9HvN@-0iPpKSDRsLacPB>#JY4d$KM!zs7xPBvUu4HQ}!Bz$qc)A`=Ver4EBC?!g7b zuW7GvE*puJA=;!bv2_S?8ZQx_n`M?F&kkb{-h zKwO=OA_@auvAUmAsQW~NjYK|}m{>`{*n^45MJ^ph*%K9}8GnxA%-;D^^-}ih8oWP* zXJ#vzJY3e4?&oSey+_=qv19lq zeLI>%Gjx=y!qVzf%Y&c7dgkjEw?^rl8^KxGs^%{Fd_(b51&l(wYCO&Rc~ZUl5^~y> zc}BJ!4+n2KaS|<{vd#M44my1W|M0Y-gfk9<&l%IBje@31-Sr1Mt!fvT(Pe+Gt$Bz? z_up@HJf$b!)YfI|4{%l^JDxgWvp75|nMzg7E)(qZ%=alvt zXMfZg7Z=_eanGP?tBXFKyvFRu$?uMAzg|k-(32orZccxnHGr$(gM%4Hgc&3blJCi; z6j@^Y3XVg*doBz7pms~Jn7 z9>1&oI7bPBOnn7vyV1x>YahPMDy_bySw!71ij);ebzBEUSZK&o1y43I-AuJKXJ~C3 z{ScF0neCZB8?5r>Px#3V%} zq$OY&i2FZH#6&q5i2Yy421o$-o6P@Z2>vgd4p$sB)+@I7CAQvk>m=OVG#EC`^#8Hx zXo}&oS5+Eg(sw4>QN4_Cy_0U!W9o!pxS@}|4s+L{ow)59*P>fYuDV~JqCwTL5s{)3(v zzbM`$E?)E;`zu*Kjpah> zgQl1ucOJOd1|%MDBk_Lsu64*-#r>9orWT19xT!DnCoNv_AnWczl?5a3@Sd4mtPrx@ z;QPqXK#%ve%3=_Sa$)(zJ)mvCYW0$Uim6bQ!S}#H@uPFY+qvmT_x`cr%&q*~6sufG zKKVZ8ebd?WhVYT)or=?jzV*~PLH&t?CH^KO=IX%=oHNr75%vVz=nN9ipHOrX*7{h! zNkaI3@a@JfTINcbD<@;DNwqa&=S5v4pM=tBEMN8HU3}euq?(dEFWfNC>H+2C+1dBA zFs|s&27315cK^vG`LRKX~{Ugw!|2K~TP_VAqXtzNY6)j={rQ zv73v$!psb1ph9o6`kKlGjC8GEdFX9+@{I}q{33}%?v>$a-cw6HGOOLVnv3ITN_D~k zo^QL%)6K#_{j)b&>8Qy@Eweq=Ne8rKsjJTe)mfDw?scqlc&US2dxU0@o5$(Zu(GB4 zujr5^yZdwlP>E{wrkq=NiW~PQZm5`fJz5m&9I}B^zPVNSSa9vWcXu^m%+bU|aOg5q zK%|a72J^vxGy)&3GlNod=Wt|FBG=mgP)o%{(2PCL$9s$dMvIcv^FdM?hbNYQrX%I| z{binoW_?J27M3L2H_Y4n0!3PGL#b*UxRbpd3l$RLC#I})-32((m#4}vP%kHB3Q7PGLpvuro4~7i2u6z$3ar+YSP2?_%+^%f* zR}5Rl@nUnDVdT&uE_ZP%NU-(Zn*^k2*4S;xubW_f3f-cK+=>uy-sK;&F{mRdpgwIgSHfJSw=22paH-mu>R=3Kf9cR*A_Sjg7q#MM< zqobyHu#q_oM3;REOf&nTGa=n6MK4QZ{pey;iGwX&bnAUCVq`=c0{gykLm{VZo%ulF z*n_LEk%}KbmVW1)L+Ab3sSZPR+Fe*5p$^HC|Oyb{_is> zsuD42;l;BT-a#X6fP(~C+`TP&(``5KD7dp9)GD&EVfNN4Bf@5N63j4c_IOZZ`^gF1 zphj9>;b1JVOWrk`HhO{mmk*Lp>wXpL*r|VQth!^2ajO2-Q$=;E0ZcMzj9V;D}3k7ej?g$MEOSvfr*p<&b z6B?7p3F^a78y9pEd$#q2Pm1b zU#?c^Op~TXSZ`3z2a{A=UzcS`zB%Z|XG2xth@1`h=wY$wyp|u2)s&QN#af+k>`vF! z&{oB;K{Wblwtcc`JH%E!TwV2q%vd}p>iZ9d@C(kwR>Dm)p? zV-i0tv8PP66)jD1#I*Qm*`@U`^o)}|58+bGD1y(EEM_dJh-O9xP^xdF-_Z#qZ&m{c zbC6W;iNU!24Cvnj14>>_V8a{IB$GXu&z39rEKNX_07*3xp*W3rJo!}pp2M0Hwe$#* zi#HgV_>>SSD;YT=uK8*Lu|$a+IIXPF$${!eaPU%X#jh@y96VcWEFGqB#<_hE8QPmQ zO_C$p_nXzGgQtqVrC1t-5`*juoj0Q%VLnw`@Yt&eCg!x)84Pq&N%`@t**O@LYz3OR(@+})Hu&$>gJ;6oxdO{ z&KR3!hDx52>YBb*JE@4B`8}j*yOg=37>&zbSN}#T@GA6n9+dFcA*9q_l2eI%Xh*7~ ziU87?k{%5!@e5oasj8xTY|ysPyOMR3W;w?vvG}prD%~$8wf$j!6&K4LI%aD1$6B&8 zG|Bq_{em<75I~pVeMNJ6Dv9e{<=x@Es?2r|L;d(lJhNv+5~$`ps7`1lAq>B{Ot5Ga z6qD6CeNHKADuYBeC(!$C>E5yJ7O5IFfdN*2lPV*LTj(fX$`T*h6!l7_BFQ%HhbJFp zKUVk@Dl`5ZH)LoQ^{7N6?HyY_;Jo?*Uu#dn_XW`49o!xdK!+JJN_3KD7k@2J((0h0 z?0!++a*3VkR_Y8-s+o<1M(>PCz=|sJMqa z0+r0sNH_$gvD_@AC}TCb8}m~2v}_leWOtWdheZwxJl0i{OGIRcO0iVJ-B>5CgP^O-M7OYVJ*8(0|euX~UGp`sq@@gaEw*bHD4*Dj8_ zPO4*=dce-k-f;9Xl`P>A2U6SzIPhFWQT>2(PjqTMlBf}zL3<&dS*!E0mM}&jbXhc- zAb9}5!V(`=H1zl4fM|8TdAE{XwAuTJ>dTw3o}wzSb&xhxCijhe4Q#{|l(FXGy+A)j zH>IZrWy4|#?wJ-1?zBm;cKLHK*H5ngXeiJE?k?6Lz1i+02rcMG7kNDQlDJ_??0D#; z(Bju>vbV@>IGl97vC?TD(|fa!E?NjDA;*m&#_ZiX>Vgi+wr`atYOngkRp_w%?M~sv zUVImV4>dX4Ih+MO4LU`Ui=K%20a~JOwq1$6)KUw@81y#uUGKMV4>O0ioDGDvtZ{Jl zmay)x!zLD>Hl1jqnzX9b_da}w9xr9S`kQwUZPAei4I5Ao#$N}f9I10=!}MXIF!F!C z6+i+ofRKI2Rvlk8erCmgYu2%A6S_nSX7!cGJQ6pQ{xw*Iw(KXQGft90Ft(YQ<7nw! ROz*Khv5A{`^It3We*oUlR=)rM literal 3874 zcmY+GcQhM}zs8e@RFtSn>{Y9_XzfvZl*TSQG6F9FNd(wu zFab99cRY+FKt2CO5E21u`*&mo0s{VisDB9%$qk|Z?*;}S1PKGv1*1XCugHHEKp;B6 z69Saqd|bch;ZdXcj@o48Or^T{VjiQWQ)um?koax&EW2Jd6%cmO+99&?<0M#TkhMY0 z>TOc9NNj$5o%GwnI2>ZpA<-syd;YVlrkqVstJxqe_w8#F0dlKW!#D3WVDWfwaN@uX z{)l!>hgv`=r)M_tPedAH8wS zrMCsCM3^vbf3iWkdUoK)O(h9`bxp3s^zq4CU5%IJN;Y04OLiLfXPS%;Duo}L?EKtE z$4DyO?uRf+Ovm@OBmMKYjcI;;3k(jA`wJ`_W&){Es6Nv(A-s;NYZhfPTZJ%tBZ{1@ zc|_(P(o|Du6c{sJ4@Q6w- zF)*aVb&dDqmGoH8(8Y;T2S?DR9+P|nUT>q8177|so}DjY7IWc!jB(9r?rJ%YyVvh5 z4`BJLeFX6F2g1N^WT?dWin3^|1>$*MQP~CSqFMgQ4m&bJp``1>I(!5Pe9&NB7{wXc z+p)Bs6Durb104tWmIOYRkBU~Waz;l#k`+@Fye00vbTIQq3dY*R{KBH-UF3%r{=+v` zqu(DD1~xv;*N0vqhN9l+bCm(5u37KF+&JF&or0qB&J%}ZmdviHekDmr#GlPK60J4Q zJ#vSZYt1pSxEPM~S27`bL-X}ig&?t1ubwy1&P?lEwQUs|t?a7>dqM7^&@^5tSL9pMp+&5H?jk>BGMj!JcQ+3*rxFcY4MY2z z4C?1*^xq&(g`+u7JnXS-Yuq8?$%DG-Zs#VDo=cTmcJRfEFTG1T4~(u1j$Snc+7Cs; zyB9?mE4rqbq_*xqj?#OlN%@YGt*PgH+-~Fy+blur5jn zu_S?>vGKl_57zp6>#CW5Q&HHKl|qVToNrM`8!zz5n*{CQ+r2#n4{2tk@;0m{ zM8pbY25rVQv1<0iw2CPT?uG+>NVZVLalVoRSZQdC(&M@`0$mC@6l?zxF&LAM8XHR1Ah3S zb?4&7@N$w<+PVC^0ws=h2pqrozQ!=b!?Zy2@uQjFh1)BEPT$JlDa9Q8(%YHT_r)w# z<4bW`j)gX^ktonho#Uf=U=ZH5QT!;ug%qe!Fi?N(OjphEVY3YTU5B*j^ZMOg+XmnL zPpT%`zoHjGCw~=w|5zC`KWOFwsF`=Jjwez^hwA2rgTt^ z^10Gp<3*%@mI37QZ>P3$*PX4;4LpFQqK9AnvMxAg!|B)unEQ{13w`0LO;;mgV22L5 z=Y8bwo8Fch2UFgZEqeTdMGZMKmz)4Uzb#-R)&H4zUC45?<4&g?`6XX-=`F2|(~Esf z4P+-+Y;J{*hV8L55?o`K^wL+ zE>e|WH7ZW48)vi%Zq4nbkLikeTd&2pCr5A#jJC9jypS>*@uF<#i}Xp$3X7~b0>bXQ zd@CV7FY-$A{IR_m5uZie z+ckdOpNC4bjck=wZ@3lTl5+`W3~_4oPuGx4#mk-f?CsbGulgu|BAb)LTI|hBYM==Q zPLdu6@x)I_O{qq^{%cI*Q`-C+WZjpp^GjGiWv(#7Vr(pZ@A532u&Rn|3@4+xgKqNc zMhtgDOn)7lv}KZc^U}jD!KU{3;=7as(>uBwDx5}ii8iIz!F(WDlbe(V`WH5PS-XhZ zPJFI;eV}4{aJ?&?Sv%?zMZJ9SRFL%?ZZ0C(FdozY2R@i=1>&&E< z<(hauSRE!6;QE6ujbYrYrWNm9;!ixJV`}*=J$7wZ^0l>rTb7|)`olK^*^m3Ex%nq2 zL({r^1)T=Q7qM>-F~1lC817t!PNhq1c&?{#kiAuiMtlDELuI?Ut6LMQ6()675@U5L z_g(P7&7MR-N3z!C5a+qZ$!xmrg0qbsQn*7vqc!v-^yqc6`tlc%aQl-Fe+IYP5Pe^K z^%zx2w*a+^&+F*;<~HZ&=XwRTB6z)Uec2XkH=^cl)cHs|VxGqSQStks&td*NQbTPW z@??ewN#dRVCH?t{p-$)JDIxkVF$#9Q?iS!Qqby9p zttQuw3k2_4Hs9`5TG}3Jwk97Nste6#I!jG)f$b(~xI#)Bs7nQ7es#6RzYPh=8vCY$@K;aE z0JYYxSm&6)?GS&eI-ibs8vhi$EXK)Yhv7%bHy2C$czjfz?F4J+b%lJkXj+1&h?Ti_R;#D>}h%qh-ltN3^kJE=J$q9lGN z97&*c`aeQNBG8(G3ADz4#|D3&4&?Ix=oLK>L?VDUkp%Gi|FbTdf2<2!*X4kUenR(; zb%6=se)ca%eZ zOyn3`1eb66NoONNlb!Qgq|BuMxwULjnW>4u2iuhj(ZUV8fC!eY=nsZF*}w6V0(LxJ zVJ|ew^cV0%UizR_Y1yOEtM1}iw*f#fPAX(#E)%*G)QD7W7O$XT5e!*pv0krMED!yw zv)_h?54B@8<=GZ6ukEmkmrx<@jaUud2Y%EQU-vBcCChZ&9Xf`1Rw3w4G=@{y>I<<5 zr)BfiiXe`(Z@ksE4@BqB5d!$>pA(N&9b7XX5GBfr?j{H(J6=OSr*~9Ff8Zh0^d;HS3|V9O<+-Py zxI&YAI-gM^t2+X1O6JyQ*^8SfuZ5{?m1F14fGg;0aeF|P)4c8tw{C;?*J)`bjV2~qOsSjk^$@gQ1{3jw}OGfYhan!3#Y zHIQX-5|4fmT69zTvDd3aW(AkQqj4t}?Md}bd>>Q>N!29V@klLOr#L%^gPrlgw8ASS>!fstf*6i;ka?xLu@MUq>?r_mf*HCZ0jHy2N^B`x>Y90Tt5-jn7*G)Ai~?r^6!i zChFK}Z-Np|s#K(ct1NYcNSoxM%p~ng6bf7}uXm#_v&(wHHp4Tljgd6EW$Kg0xZkkr zi&o;({o`MC#=#JXFx-Py14vyFMbGypX`-a>1F9n21b`MXKk|zU$zEO&>l1Rjkx$4Vg-UeUetqM3xCVt2 z#4}QY$t__sQxkuq9U8E_JbjM8#9JvlSK48A@`?q^I*~JnT-!@f$l49YlT>fpGqYJ9 zr+k*tw-oT8l~Dr<$GT8lt$6D+{n7Af1%CX7h0*}>N)s;I);DZqq{57a Date: Thu, 7 Sep 2023 17:25:26 -0700 Subject: [PATCH 22/29] Added 2.10 release notes (#925) Signed-off-by: Ashish Agrawal Signed-off-by: Tanqiu Liu --- ...index-management.release-notes-2.10.0.0.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 release-notes/opensearch-index-management.release-notes-2.10.0.0.md diff --git a/release-notes/opensearch-index-management.release-notes-2.10.0.0.md b/release-notes/opensearch-index-management.release-notes-2.10.0.0.md new file mode 100644 index 000000000..d17d06e5b --- /dev/null +++ b/release-notes/opensearch-index-management.release-notes-2.10.0.0.md @@ -0,0 +1,32 @@ +## Version 2.10.0.0 2023-09-07 + +Compatible with OpenSearch 2.10.0 + +### Maintenance +* Increment version to 2.10.0-SNAPSHOT. ([#852](https://github.com/opensearch-project/index-management/pull/852)) + +### Features +* Support copy alias in rollover. ([#892](https://github.com/opensearch-project/index-management/pull/892)) +* make control center index as system index. ([#919](https://github.com/opensearch-project/index-management/pull/919)) + +### Bug fixes +* Fix debug log for missing ISM config index. ([#846](https://github.com/opensearch-project/index-management/pull/846)) +* Handle NPE in isRollupIndex. ([#855](https://github.com/opensearch-project/index-management/pull/855)) +* fix for max & min aggregations when no metric property exist. ([#870](https://github.com/opensearch-project/index-management/pull/870)) +* fix intelliJ IDEA gradle sync error ([#916](https://github.com/opensearch-project/index-management/pull/916)) + +### Infrastructure +* Add auto github release workflow. ([#691](https://github.com/opensearch-project/index-management/pull/691)) +* Fixed the publish maven workflow to execute after pushes to release branches. ([#837](https://github.com/opensearch-project/index-management/pull/837)) +* Upgrade the backport workflow. ([#862](https://github.com/opensearch-project/index-management/pull/862)) +* Updates demo certs used in integ tests. ([#921](https://github.com/opensearch-project/index-management/pull/921)) + +### Refactoring +* [Backport 2.x] Fix after core #8157. ([#886](https://github.com/opensearch-project/index-management/pull/886)) +* Fix breaking change by core refactor. ([#888](https://github.com/opensearch-project/index-management/pull/888)) +* Handle core breaking change. ([#895](https://github.com/opensearch-project/index-management/pull/895)) +* Set preference to _primary when searching control-center index. ([#911](https://github.com/opensearch-project/index-management/pull/911)) +* Add primary first preference to all search requests. ([#912](https://github.com/opensearch-project/index-management/pull/912)) + +### Documentation +* Added 2.10 release notes. ([#925](https://github.com/opensearch-project/index-management/pull/925)) \ No newline at end of file From e5ff66bcee358e51de3b87bed42ee729fd0e3ce8 Mon Sep 17 00:00:00 2001 From: bowenlan-amzn Date: Thu, 14 Sep 2023 16:01:27 -0700 Subject: [PATCH 23/29] Bump bwc version (#930) Signed-off-by: bowenlan-amzn Signed-off-by: Tanqiu Liu --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3d91528c5..2c59abfd5 100644 --- a/build.gradle +++ b/build.gradle @@ -613,7 +613,7 @@ task integTestRemote(type: RestIntegTestTask) { // === Set up BWC tests === -String bwcVersionShort = "2.10.0" +String bwcVersionShort = "2.11.0" String bwcVersion = bwcVersionShort + ".0" String baseName = "indexmanagementBwcCluster" From 155f0afffb3d76a940d485bd97ca2b0c35340f82 Mon Sep 17 00:00:00 2001 From: Tanqiu Liu Date: Sun, 24 Sep 2023 21:07:05 -0700 Subject: [PATCH 24/29] fix integ tests; upgrade mappings versions Signed-off-by: Tanqiu Liu --- .../model/TransformActionProperties.kt | 8 ++++---- .../indexstatemanagement/action/TransformAction.kt | 2 +- .../action/TransformActionParser.kt | 4 ++-- .../indexmanagement/transform/model/ISMTransform.kt | 10 +++++----- src/main/resources/mappings/opendistro-ism-config.json | 2 +- .../resources/mappings/opendistro-ism-history.json | 2 +- .../indexmanagement/IndexManagementRestTestCase.kt | 4 ++-- .../mappings/cached-opendistro-ism-config.json | 2 +- .../mappings/cached-opendistro-ism-history.json | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt index c9d6c71f0..a501de7a7 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt @@ -5,10 +5,10 @@ package org.opensearch.indexmanagement.spi.indexstatemanagement.model -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable -import org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken +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.XContentParserUtils.ensureExpectedToken import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentFragment import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt index 48cf49904..0de34c15b 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformAction.kt @@ -5,7 +5,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamOutput +import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.indexmanagement.indexstatemanagement.step.transform.AttemptCreateTransformJobStep diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionParser.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionParser.kt index c56a3e3fe..9d7eb1360 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionParser.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionParser.kt @@ -5,9 +5,9 @@ package org.opensearch.indexmanagement.indexstatemanagement.action -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.xcontent.XContentParserUtils +import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.indexmanagement.spi.indexstatemanagement.Action import org.opensearch.indexmanagement.spi.indexstatemanagement.ActionParser import org.opensearch.indexmanagement.transform.model.ISMTransform diff --git a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt index 9bc5a7ef9..ecc092ac9 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/transform/model/ISMTransform.kt @@ -6,19 +6,19 @@ package org.opensearch.indexmanagement.transform.model import org.apache.commons.codec.digest.DigestUtils -import org.opensearch.common.bytes.BytesReference -import org.opensearch.common.io.stream.StreamInput -import org.opensearch.common.io.stream.StreamOutput -import org.opensearch.common.io.stream.Writeable import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentFactory -import org.opensearch.common.xcontent.XContentParserUtils import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.authuser.User +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.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser +import org.opensearch.core.xcontent.XContentParserUtils import org.opensearch.index.query.AbstractQueryBuilder import org.opensearch.index.query.MatchAllQueryBuilder import org.opensearch.index.query.QueryBuilder diff --git a/src/main/resources/mappings/opendistro-ism-config.json b/src/main/resources/mappings/opendistro-ism-config.json index 49e515885..bdcdcea31 100644 --- a/src/main/resources/mappings/opendistro-ism-config.json +++ b/src/main/resources/mappings/opendistro-ism-config.json @@ -1,6 +1,6 @@ { "_meta" : { - "schema_version": 19 + "schema_version": 20 }, "dynamic": "strict", "properties": { diff --git a/src/main/resources/mappings/opendistro-ism-history.json b/src/main/resources/mappings/opendistro-ism-history.json index dcf8a2fe8..6ce6e1779 100644 --- a/src/main/resources/mappings/opendistro-ism-history.json +++ b/src/main/resources/mappings/opendistro-ism-history.json @@ -1,6 +1,6 @@ { "_meta" : { - "schema_version": 6 + "schema_version": 7 }, "dynamic": "strict", "properties": { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt index cc8c60b0e..1dd4938c6 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt @@ -37,8 +37,8 @@ import javax.management.remote.JMXServiceURL abstract class IndexManagementRestTestCase : ODFERestTestCase() { - val configSchemaVersion = 19 - val historySchemaVersion = 6 + val configSchemaVersion = 20 + val historySchemaVersion = 7 // Having issues with tests leaking into other tests and mappings being incorrect and they are not caught by any pending task wait check as // they do not go through the pending task queue. Ideally this should probably be written in a way to wait for the diff --git a/src/test/resources/mappings/cached-opendistro-ism-config.json b/src/test/resources/mappings/cached-opendistro-ism-config.json index 49e515885..bdcdcea31 100644 --- a/src/test/resources/mappings/cached-opendistro-ism-config.json +++ b/src/test/resources/mappings/cached-opendistro-ism-config.json @@ -1,6 +1,6 @@ { "_meta" : { - "schema_version": 19 + "schema_version": 20 }, "dynamic": "strict", "properties": { diff --git a/src/test/resources/mappings/cached-opendistro-ism-history.json b/src/test/resources/mappings/cached-opendistro-ism-history.json index dcf8a2fe8..6ce6e1779 100644 --- a/src/test/resources/mappings/cached-opendistro-ism-history.json +++ b/src/test/resources/mappings/cached-opendistro-ism-history.json @@ -1,6 +1,6 @@ { "_meta" : { - "schema_version": 6 + "schema_version": 7 }, "dynamic": "strict", "properties": { From 19003c9168a72599d117515d07b933978d3ece96 Mon Sep 17 00:00:00 2001 From: Tanqiu Liu Date: Sun, 24 Sep 2023 22:02:30 -0700 Subject: [PATCH 25/29] Fix DCO Signed-off-by: Tanqiu Liu --- DEVELOPER_GUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 61ba3f9f9..c37625806 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -48,7 +48,7 @@ However, to build the `index management` plugin project, we also use the OpenSea ### Building from the command line -1. `./gradlew build` builds and tests project. +1. `./gradlew build` builds and tests project. 2. `./gradlew run` launches a single node cluster with the index management (and job-scheduler) plugin installed. 3. `./gradlew run -PnumNodes=3` launches a multi-node cluster with the index management (and job-scheduler) plugin installed. 4. `./gradlew integTest` launches a single node cluster with the index management (and job-scheduler) plugin installed and runs all integ tests. From 0202ea247ce0925592578f80c98e1a39446f97f0 Mon Sep 17 00:00:00 2001 From: Tanqiu Liu Date: Thu, 5 Oct 2023 01:29:59 -0700 Subject: [PATCH 26/29] Addressed pr comments; Add integ test case for re-execute the same transform action Signed-off-by: Tanqiu Liu --- .../model/TransformActionProperties.kt | 15 +-- .../AttemptCreateTransformJobStep.kt | 15 +-- .../WaitForTransformCompletionStep.kt | 55 +++++---- .../action/TransformActionIT.kt | 115 ++++++++++++++++++ .../AttemptCreateTransformJobStepTests.kt | 9 +- .../WaitForTransformCompletionStepTests.kt | 24 +--- 6 files changed, 166 insertions(+), 67 deletions(-) diff --git a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt index a501de7a7..70b593750 100644 --- a/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt +++ b/spi/src/main/kotlin/org.opensearch.indexmanagement.spi/indexstatemanagement/model/TransformActionProperties.kt @@ -15,18 +15,15 @@ import org.opensearch.core.xcontent.XContentBuilder import org.opensearch.core.xcontent.XContentParser data class TransformActionProperties( - val transformId: String?, - val hasTransformFailed: Boolean? + val transformId: String? ) : Writeable, ToXContentFragment { override fun writeTo(out: StreamOutput) { out.writeOptionalString(transformId) - out.writeOptionalBoolean(hasTransformFailed) } override fun toXContent(builder: XContentBuilder, params: ToXContent.Params?): XContentBuilder { if (transformId != null) builder.field(Properties.TRANSFORM_ID.key, transformId) - if (hasTransformFailed != null) builder.field(Properties.HAS_TRANSFORM_FAILED.key, hasTransformFailed) return builder } @@ -35,13 +32,11 @@ data class TransformActionProperties( fun fromStreamInput(sin: StreamInput): TransformActionProperties { val transformId: String? = sin.readOptionalString() - val hasTransformFailed: Boolean? = sin.readOptionalBoolean() - return TransformActionProperties(transformId, hasTransformFailed) + return TransformActionProperties(transformId) } fun parse(xcp: XContentParser): TransformActionProperties { var transformId: String? = null - var hasTransformFailed: Boolean? = null ensureExpectedToken(XContentParser.Token.START_OBJECT, xcp.currentToken(), xcp) while (xcp.nextToken() != XContentParser.Token.END_OBJECT) { @@ -50,16 +45,14 @@ data class TransformActionProperties( when (fieldName) { Properties.TRANSFORM_ID.key -> transformId = xcp.text() - Properties.HAS_TRANSFORM_FAILED.key -> hasTransformFailed = xcp.booleanValue() } } - return TransformActionProperties(transformId, hasTransformFailed) + return TransformActionProperties(transformId) } } enum class Properties(val key: String) { - TRANSFORM_ID("transformId"), - HAS_TRANSFORM_FAILED("has_transform_failed") + TRANSFORM_ID("transform_id") } } diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt index fa031ed31..806803e3c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/AttemptCreateTransformJobStep.kt @@ -35,14 +35,12 @@ class AttemptCreateTransformJobStep( private var stepStatus = StepStatus.STARTING private var info: Map? = null private var transformId: String? = null - private var hasTransformFailed: Boolean? = null override suspend fun execute(): Step { val context = this.context ?: return this val indexName = context.metadata.index val managedIndexMetadata = context.metadata - val previousRunTransformId = managedIndexMetadata.actionMetaData?.actionProperties?.transformActionProperties?.transformId - val hasPreviousTransformAttemptFailed = managedIndexMetadata.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed + val startedTransformId = managedIndexMetadata.actionMetaData?.actionProperties?.transformActionProperties?.transformId // Creating a transform job val transform = action.ismTransform.toTransform(indexName, context.user) @@ -58,11 +56,13 @@ class AttemptCreateTransformJobStep( stepStatus = StepStatus.COMPLETED info = mapOf("message" to getSuccessMessage(transform.id, indexName)) } catch (e: VersionConflictEngineException) { - val message = getFailedJobExistsMessage(transform.id, indexName) + val message = getTransformJobAlreadyExistsMessage(transform.id, indexName) logger.info(message) - if (transformId == previousRunTransformId && hasPreviousTransformAttemptFailed == true) { + if (startedTransformId == null) { + // restart the transform job when this is another execution of the same action in the ISM policy startTransformJob(transform.id, context) } else { + // directly mark as complete when this is a retry of this step stepStatus = StepStatus.COMPLETED info = mapOf("info" to message) } @@ -80,6 +80,7 @@ class AttemptCreateTransformJobStep( fun processFailure(transformId: String, indexName: String, e: Exception) { val message = getFailedMessage(transformId, indexName) logger.error(message, e) + this.transformId = null stepStatus = StepStatus.FAILED info = mapOf("message" to message, "cause" to "${e.message}") } @@ -103,7 +104,7 @@ class AttemptCreateTransformJobStep( override fun getUpdatedManagedIndexMetadata(currentMetadata: ManagedIndexMetaData): ManagedIndexMetaData { val currentActionMetaData = currentMetadata.actionMetaData - val transformActionProperties = TransformActionProperties(transformId, hasTransformFailed) + val transformActionProperties = TransformActionProperties(transformId) return currentMetadata.copy( actionMetaData = currentActionMetaData?.copy(actionProperties = ActionProperties(transformActionProperties = transformActionProperties)), stepMetaData = StepMetaData(name, getStepStartTime(currentMetadata).toEpochMilli(), stepStatus), @@ -117,7 +118,7 @@ class AttemptCreateTransformJobStep( companion object { const val name = "attempt_create_transform" fun getFailedMessage(transformId: String, index: String) = "Failed to create the transform job [$transformId] [index=$index]" - fun getFailedJobExistsMessage(transformId: String, index: String) = + fun getTransformJobAlreadyExistsMessage(transformId: String, index: String) = "Transform job [$transformId] already exists, skipping creation [index=$index]" fun getFailedToStartMessage(transformId: String, index: String) = "Failed to start the transform job [$transformId] [index=$index]" fun getSuccessMessage(transformId: String, index: String) = "Successfully created the transform job [$transformId] [index=$index]" diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt index 2825fc920..0f3ad71f7 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt @@ -21,7 +21,6 @@ class WaitForTransformCompletionStep : Step(name) { private val logger = LogManager.getLogger(javaClass) private var stepStatus = StepStatus.STARTING private var info: Map? = null - private var hasTransformFailed: Boolean? = null override suspend fun execute(): Step { val context = this.context ?: return this @@ -33,29 +32,40 @@ class WaitForTransformCompletionStep : Step(name) { logger.error("No transform job id passed down.") stepStatus = StepStatus.FAILED info = mapOf("message" to getMissingTransformJobMessage(indexName)) - } else { - val explainTransformRequest = ExplainTransformRequest(listOf(transformJobId)) - try { - val response: ExplainTransformResponse = context.client.suspendUntil { - execute(ExplainTransformAction.INSTANCE, explainTransformRequest, it) - } - logger.info("Received the status for jobs [${response.getIdsToExplain().keys}]") - val metadata = response.getIdsToExplain()[transformJobId]?.metadata + return this + } - if (metadata?.status == null) { - logger.warn("Job $transformJobId has not started yet") - stepStatus = StepStatus.CONDITION_NOT_MET - info = mapOf("message" to getJobProcessingMessage(transformJobId, indexName)) - } else { - processTransformMetadataStatus(transformJobId, indexName, metadata) - } - } catch (e: RemoteTransportException) { - processFailure(transformJobId, indexName, e) - } catch (e: Exception) { - processFailure(transformJobId, indexName, e) + val explainTransformRequest = ExplainTransformRequest(listOf(transformJobId)) + val response: ExplainTransformResponse + try { + response = context.client.suspendUntil { + execute(ExplainTransformAction.INSTANCE, explainTransformRequest, it) } + logger.info("Received the status for jobs [${response.getIdsToExplain().keys}]") + } catch (e: RemoteTransportException) { + processFailure(transformJobId, indexName, e) + return this + } catch (e: Exception) { + processFailure(transformJobId, indexName, e) + return this + } + + val explainTransform = response.getIdsToExplain()[transformJobId] + if (explainTransform == null) { + logger.warn("Job $transformJobId is not found, mark step as COMPLETED.") + stepStatus = StepStatus.COMPLETED + info = mapOf("message" to getJobNotFoundMessage(transformJobId, indexName)) + return this + } + + if (explainTransform.metadata?.status == null) { + logger.warn("Job $transformJobId has not started yet") + stepStatus = StepStatus.CONDITION_NOT_MET + info = mapOf("message" to getJobProcessingMessage(transformJobId, indexName)) + return this } + processTransformMetadataStatus(transformJobId, indexName, explainTransform.metadata) return this } @@ -67,7 +77,6 @@ class WaitForTransformCompletionStep : Step(name) { } TransformMetadata.Status.FAILED -> { stepStatus = StepStatus.FAILED - hasTransformFailed = true info = mapOf("message" to getJobFailedMessage(transformJobId, indexName), "cause" to "${transformMetadata.failureReason}") } TransformMetadata.Status.FINISHED -> { @@ -76,7 +85,6 @@ class WaitForTransformCompletionStep : Step(name) { } TransformMetadata.Status.STOPPED -> { stepStatus = StepStatus.FAILED - hasTransformFailed = true info = mapOf("message" to getJobFailedMessage(transformJobId, indexName), "cause" to JOB_STOPPED_MESSAGE) } } @@ -100,7 +108,7 @@ class WaitForTransformCompletionStep : Step(name) { actionMetaData = currentActionMetadata?.copy( actionProperties = currentActionProperties?.copy( transformActionProperties = currentTransformActionProperties?.copy( - hasTransformFailed = hasTransformFailed + transformId = currentTransformActionProperties.transformId ) ) ), @@ -120,5 +128,6 @@ class WaitForTransformCompletionStep : Step(name) { fun getJobCompletionMessage(transformJob: String, index: String) = "Transform job [$transformJob] completed [index=$index]" fun getJobFailedMessage(transformJob: String, index: String) = "Transform job [$transformJob] failed [index=$index]" fun getMissingTransformJobMessage(index: String) = "Transform job was not found [index=$index]" + fun getJobNotFoundMessage(transformJob: String, index: String) = "Transform job [$transformJob] is not found [index=$index]" } } diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt index 6288767a6..1b0de903d 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt @@ -15,9 +15,11 @@ import org.opensearch.indexmanagement.indexstatemanagement.IndexStateManagementR import org.opensearch.indexmanagement.indexstatemanagement.model.ISMTemplate import org.opensearch.indexmanagement.indexstatemanagement.model.Policy import org.opensearch.indexmanagement.indexstatemanagement.model.State +import org.opensearch.indexmanagement.indexstatemanagement.model.Transition import org.opensearch.indexmanagement.indexstatemanagement.randomErrorNotification import org.opensearch.indexmanagement.indexstatemanagement.step.transform.AttemptCreateTransformJobStep import org.opensearch.indexmanagement.indexstatemanagement.step.transform.WaitForTransformCompletionStep +import org.opensearch.indexmanagement.indexstatemanagement.step.transition.AttemptTransitionStep import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionRetry import org.opensearch.indexmanagement.transform.avgAggregation @@ -148,6 +150,19 @@ class TransformActionIT : IndexStateManagementRestTestCase() { } } + fun `test policy succeeded when run the same transform job twice`() { + val indexName = "${testPrefix}_index_two_transforms" + val targetIndex = "${testPrefix}_target_two_transforms" + val policyId = "${testPrefix}_policy_two_transforms" + + val ismTransform = prepareISMTransform(targetIndex) + val policy = preparePolicyContainingTransformTwice(indexName, ismTransform, policyId) + createPolicy(policy, policyId) + createIndex(indexName, policyId, mapping = SOURCE_INDEX_MAPPING) + + assertIndexTransformSucceededTwice(indexName, policyId, ismTransform) + } + // create an ISMTransform that matches SOURCE_INDEX_MAPPING private fun prepareISMTransform(targetIndex: String): ISMTransform { return ISMTransform( @@ -192,6 +207,36 @@ class TransformActionIT : IndexStateManagementRestTestCase() { ) } + private fun preparePolicyContainingTransformTwice( + indexName: String, + ismTransform: ISMTransform, + policyId: String, + retry: Long = 0 + ): Policy { + val actionConfig = TransformAction(ismTransform, 0) + actionConfig.configRetry = ActionRetry(retry) + val states = listOf( + State("transform1", listOf(actionConfig), listOf(Transition(stateName = "transform2", conditions = null))), + State("transform2", listOf(actionConfig), listOf()) + ) + return Policy( + id = policyId, + description = "test description", + schemaVersion = 1L, + lastUpdatedTime = Instant.now().truncatedTo(ChronoUnit.MILLIS), + errorNotification = randomErrorNotification(), + defaultState = states[0].name, + states = states, + ismTemplate = listOf( + ISMTemplate( + indexPatterns = listOf(indexName), + priority = 100, + lastUpdatedTime = Instant.now().truncatedTo(ChronoUnit.MILLIS) + ) + ) + ) + } + private fun createDataStream(dataStreamName: String) { // create an index template for data stream client().makeRequest( @@ -245,6 +290,76 @@ class TransformActionIT : IndexStateManagementRestTestCase() { } } + private fun assertIndexTransformSucceededTwice(indexName: String, policyId: String, ismTransform: ISMTransform) { + val transformId = ismTransform.toTransform(indexName).id + val managedIndexConfig = getExistingManagedIndexConfig(indexName) + + // Change the start time so that the policy will be initialized. + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { assertEquals(policyId, getExplainManagedIndexMetaData(indexName).policyID) } + + // Change the start time so that the transform action will be attempted. + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { + assertEquals( + AttemptCreateTransformJobStep.getSuccessMessage(transformId, indexName), + getExplainManagedIndexMetaData(indexName).info?.get("message") + ) + } + Thread.sleep(60000) + + // Change the start time so that the transform action will be attempted. + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { + assertEquals( + WaitForTransformCompletionStep.getJobCompletionMessage(transformId, indexName), + getExplainManagedIndexMetaData(indexName).info?.get("message") + ) + } + + var transformJob = getTransform(transformId = transformId) + waitFor { + assertNotNull("Transform job doesn't have metadata set", transformJob.metadataId) + val transformMetadata = getTransformMetadata(transformJob.metadataId!!) + assertEquals("Transform is not finished", TransformMetadata.Status.FINISHED, transformMetadata.status) + } + + // Change the start time so that the transition attempted. + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { + assertEquals( + AttemptTransitionStep.getSuccessMessage(indexName, "transform2"), + getExplainManagedIndexMetaData(indexName).info?.get("message") + ) + } + + // Change the start time so that the second transform action will be attempted. + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { + assertEquals( + AttemptCreateTransformJobStep.getSuccessRestartMessage(transformId, indexName), + getExplainManagedIndexMetaData(indexName).info?.get("message") + ) + } + Thread.sleep(60000) + + // Change the start time so that the second transform action will be attempted. + updateManagedIndexConfigStartTime(managedIndexConfig) + waitFor { + assertEquals( + WaitForTransformCompletionStep.getJobCompletionMessage(transformId, indexName), + getExplainManagedIndexMetaData(indexName).info?.get("message") + ) + } + + transformJob = getTransform(transformId = transformId) + waitFor { + assertNotNull("Transform job doesn't have metadata set", transformJob.metadataId) + val transformMetadata = getTransformMetadata(transformJob.metadataId!!) + assertEquals("Transform is not finished", TransformMetadata.Status.FINISHED, transformMetadata.status) + } + } + private fun assertIndexTransformFailedInAttemptCreateTransformStep(indexName: String, policyId: String, ismTransform: ISMTransform) { val transformId = ismTransform.toTransform(indexName).id val managedIndexConfig = getExistingManagedIndexConfig(indexName) diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCreateTransformJobStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCreateTransformJobStepTests.kt index 2e06ee740..02945979e 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCreateTransformJobStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/AttemptCreateTransformJobStepTests.kt @@ -6,7 +6,6 @@ package org.opensearch.indexmanagement.indexstatemanagement.step import org.opensearch.indexmanagement.indexstatemanagement.randomTransformActionConfig -import org.opensearch.indexmanagement.indexstatemanagement.step.rollup.AttemptCreateRollupJobStep import org.opensearch.indexmanagement.indexstatemanagement.step.transform.AttemptCreateTransformJobStep import org.opensearch.indexmanagement.spi.indexstatemanagement.Step import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionMetaData @@ -32,8 +31,8 @@ class AttemptCreateTransformJobStepTests : OpenSearchTestCase() { null, null, ActionMetaData( - AttemptCreateRollupJobStep.name, 1, 0, false, 0, null, - ActionProperties(transformActionProperties = TransformActionProperties(transformId, false)) + AttemptCreateTransformJobStep.name, 1, 0, false, 0, null, + ActionProperties(transformActionProperties = TransformActionProperties(transformId)) ), null, null, @@ -54,6 +53,10 @@ class AttemptCreateTransformJobStepTests : OpenSearchTestCase() { AttemptCreateTransformJobStep.getFailedMessage(transformId, indexName), updatedManagedIndexMedaData.info?.get("message") ) + assertNull( + "TransformId in action properties is not cleaned up", + updatedManagedIndexMedaData.actionMetaData?.actionProperties?.transformActionProperties?.transformId + ) } fun `test isIdempotent`() { diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForTransformCompletionStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForTransformCompletionStepTests.kt index a78fa387a..d536c7449 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForTransformCompletionStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/WaitForTransformCompletionStepTests.kt @@ -46,7 +46,7 @@ class WaitForTransformCompletionStepTests : OpenSearchTestCase() { null, ActionMetaData( AttemptCreateTransformJobStep.name, 1, 0, false, 0, null, - ActionProperties(transformActionProperties = TransformActionProperties(transformId, false)) + ActionProperties(transformActionProperties = TransformActionProperties(transformId)) ), null, null, @@ -93,11 +93,6 @@ class WaitForTransformCompletionStepTests : OpenSearchTestCase() { WaitForTransformCompletionStep.getJobFailedMessage(transformId, indexName), updateManagedIndexMetaData.info?.get("message") ) - assertEquals( - "Missing transform failed action property", - true, - updateManagedIndexMetaData.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed - ) } fun `test process transform metadata STOPPED status`() { @@ -111,11 +106,6 @@ class WaitForTransformCompletionStepTests : OpenSearchTestCase() { WaitForTransformCompletionStep.getJobFailedMessage(transformId, indexName), updateManagedIndexMetaData.info?.get("message") ) - assertEquals( - "Missing transform failed action property", - true, - updateManagedIndexMetaData.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed - ) assertEquals("Mismatch in cause", WaitForTransformCompletionStep.JOB_STOPPED_MESSAGE, updateManagedIndexMetaData.info?.get("cause")) } @@ -134,10 +124,6 @@ class WaitForTransformCompletionStepTests : OpenSearchTestCase() { WaitForTransformCompletionStep.getJobProcessingMessage(transformId, indexName), updateManagedIndexMetaData.info?.get("message") ) - assertNull( - "transform failed property is not null", - updateManagedIndexMetaData.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed - ) } fun `test process transform metadata STARTED status`() { @@ -151,10 +137,6 @@ class WaitForTransformCompletionStepTests : OpenSearchTestCase() { WaitForTransformCompletionStep.getJobProcessingMessage(transformId, indexName), updateManagedIndexMetaData.info?.get("message") ) - assertNull( - "transform failed property is not null", - updateManagedIndexMetaData.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed - ) } fun `test process transform metadata FINISHED status`() { @@ -168,10 +150,6 @@ class WaitForTransformCompletionStepTests : OpenSearchTestCase() { WaitForTransformCompletionStep.getJobCompletionMessage(transformId, indexName), updateManagedIndexMetaData.info?.get("message") ) - assertNull( - "transform failed property is not null", - updateManagedIndexMetaData.actionMetaData?.actionProperties?.transformActionProperties?.hasTransformFailed - ) } fun `test process failure`() { From a082860ef6788cfee26666d42b69a13f92926451 Mon Sep 17 00:00:00 2001 From: Tanqiu Liu Date: Thu, 5 Oct 2023 22:34:22 -0700 Subject: [PATCH 27/29] Addressed detekt error Signed-off-by: Tanqiu Liu --- .../WaitForTransformCompletionStep.kt | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt index 0f3ad71f7..a3b53a895 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt @@ -9,6 +9,7 @@ import org.apache.logging.log4j.LogManager import org.opensearch.indexmanagement.opensearchapi.suspendUntil import org.opensearch.indexmanagement.spi.indexstatemanagement.Step import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData +import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepContext import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepMetaData import org.opensearch.indexmanagement.transform.action.explain.ExplainTransformAction import org.opensearch.indexmanagement.transform.action.explain.ExplainTransformRequest @@ -16,6 +17,7 @@ import org.opensearch.indexmanagement.transform.action.explain.ExplainTransformR import org.opensearch.indexmanagement.transform.model.TransformMetadata import org.opensearch.transport.RemoteTransportException +@Suppress("ReturnCount") class WaitForTransformCompletionStep : Step(name) { private val logger = LogManager.getLogger(javaClass) @@ -35,22 +37,11 @@ class WaitForTransformCompletionStep : Step(name) { return this } - val explainTransformRequest = ExplainTransformRequest(listOf(transformJobId)) - val response: ExplainTransformResponse - try { - response = context.client.suspendUntil { - execute(ExplainTransformAction.INSTANCE, explainTransformRequest, it) - } - logger.info("Received the status for jobs [${response.getIdsToExplain().keys}]") - } catch (e: RemoteTransportException) { - processFailure(transformJobId, indexName, e) - return this - } catch (e: Exception) { - processFailure(transformJobId, indexName, e) - return this - } + val explainTransformResponse = explainTransformJob(transformJobId, indexName, context) + // if explainTransform call failed, return early + explainTransformResponse ?: return this - val explainTransform = response.getIdsToExplain()[transformJobId] + val explainTransform = explainTransformResponse.getIdsToExplain()[transformJobId] if (explainTransform == null) { logger.warn("Job $transformJobId is not found, mark step as COMPLETED.") stepStatus = StepStatus.COMPLETED @@ -69,6 +60,22 @@ class WaitForTransformCompletionStep : Step(name) { return this } + private suspend fun explainTransformJob(transformJobId: String, indexName: String, context: StepContext): ExplainTransformResponse? { + val explainTransformRequest = ExplainTransformRequest(listOf(transformJobId)) + try { + val response = context.client.suspendUntil { + execute(ExplainTransformAction.INSTANCE, explainTransformRequest, it) + } + logger.info("Received the status for jobs [${response.getIdsToExplain().keys}]") + return response + } catch (e: RemoteTransportException) { + processFailure(transformJobId, indexName, e) + } catch (e: Exception) { + processFailure(transformJobId, indexName, e) + } + return null + } + fun processTransformMetadataStatus(transformJobId: String, indexName: String, transformMetadata: TransformMetadata) { when (transformMetadata.status) { TransformMetadata.Status.INIT, TransformMetadata.Status.STARTED -> { From 2f8c4d6a8fda57557c8bbcdd6502fbc7fba57a53 Mon Sep 17 00:00:00 2001 From: Tanqiu Liu Date: Sat, 7 Oct 2023 02:14:52 -0700 Subject: [PATCH 28/29] Added ISMTransform writeable test Signed-off-by: Tanqiu Liu --- .../indexmanagement/transform/model/WriteableTests.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/model/WriteableTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/model/WriteableTests.kt index 06c3a6b71..af1053641 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/model/WriteableTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/model/WriteableTests.kt @@ -8,6 +8,7 @@ package org.opensearch.indexmanagement.transform.model import org.opensearch.common.io.stream.BytesStreamOutput import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.indexmanagement.transform.buildStreamInputForTransforms +import org.opensearch.indexmanagement.transform.randomISMTransform import org.opensearch.indexmanagement.transform.randomTransform import org.opensearch.indexmanagement.transform.randomTransformMetadata import org.opensearch.test.OpenSearchTestCase @@ -36,4 +37,11 @@ class WriteableTests : OpenSearchTestCase() { @Suppress("DEPRECATION") assertTrue("roles field in transform model is deprecated and should be parsed to empty list.", streamedTransform.roles.isEmpty()) } + + fun `test ism transform as stream`() { + val ismTransform = randomISMTransform() + val out = BytesStreamOutput().also { ismTransform.writeTo(it) } + val streamedISMTransform = ISMTransform(buildStreamInputForTransforms(out)) + assertEquals("Round tripping ISMTransform stream doesn't work", ismTransform, streamedISMTransform) + } } From 399afba8cc23d02fa292d66ab962617fb3fe5afc Mon Sep 17 00:00:00 2001 From: Tanqiu Liu Date: Mon, 9 Oct 2023 23:49:37 -0700 Subject: [PATCH 29/29] Addressed comments; Moved updateTransformStartTime to IndexManagementRestTestCase Signed-off-by: Tanqiu Liu --- .../WaitForTransformCompletionStep.kt | 14 ++------ .../IndexManagementRestTestCase.kt | 30 ++++++++++++++++ .../indexmanagement/SecurityRestTestCase.kt | 6 ---- .../action/TransformActionIT.kt | 16 +++++---- .../transform/TransformRestTestCase.kt | 34 ------------------- 5 files changed, 42 insertions(+), 58 deletions(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt index a3b53a895..78aa41f3d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/transform/WaitForTransformCompletionStep.kt @@ -6,6 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.step.transform import org.apache.logging.log4j.LogManager +import org.opensearch.ExceptionsHelper import org.opensearch.indexmanagement.opensearchapi.suspendUntil import org.opensearch.indexmanagement.spi.indexstatemanagement.Step import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData @@ -69,7 +70,7 @@ class WaitForTransformCompletionStep : Step(name) { logger.info("Received the status for jobs [${response.getIdsToExplain().keys}]") return response } catch (e: RemoteTransportException) { - processFailure(transformJobId, indexName, e) + processFailure(transformJobId, indexName, ExceptionsHelper.unwrapCause(e) as Exception) } catch (e: Exception) { processFailure(transformJobId, indexName, e) } @@ -108,17 +109,8 @@ class WaitForTransformCompletionStep : Step(name) { } override fun getUpdatedManagedIndexMetadata(currentMetadata: ManagedIndexMetaData): ManagedIndexMetaData { - val currentActionMetadata = currentMetadata.actionMetaData - val currentActionProperties = currentActionMetadata?.actionProperties - val currentTransformActionProperties = currentActionProperties?.transformActionProperties return currentMetadata.copy( - actionMetaData = currentActionMetadata?.copy( - actionProperties = currentActionProperties?.copy( - transformActionProperties = currentTransformActionProperties?.copy( - transformId = currentTransformActionProperties.transformId - ) - ) - ), + actionMetaData = currentMetadata.actionMetaData, stepMetaData = StepMetaData(name, getStepStartTime(currentMetadata).toEpochMilli(), stepStatus), transitionTo = null, info = info diff --git a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt index 97eb3fc13..80813c19a 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/IndexManagementRestTestCase.kt @@ -28,6 +28,7 @@ import org.opensearch.indexmanagement.indexstatemanagement.util.INDEX_HIDDEN import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.MediaType import org.opensearch.indexmanagement.rollup.model.Rollup +import org.opensearch.indexmanagement.transform.model.Transform import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule import java.io.IOException import java.nio.file.Files @@ -229,6 +230,35 @@ abstract class IndexManagementRestTestCase : ODFERestTestCase() { assertEquals("Request failed", RestStatus.OK, response.restStatus()) } + protected fun updateTransformStartTime(update: Transform, desiredStartTimeMillis: Long? = null) { + // Before updating start time of a job always make sure there are no unassigned shards that could cause the config + // index to move to a new node and negate this forced start + if (isMultiNode) { + waitFor { + try { + client().makeRequest("GET", "_cluster/allocation/explain") + fail("Expected 400 Bad Request when there are no unassigned shards to explain") + } catch (e: ResponseException) { + assertEquals(RestStatus.BAD_REQUEST, e.response.restStatus()) + } + } + } + val intervalSchedule = (update.jobSchedule as IntervalSchedule) + val millis = Duration.of(intervalSchedule.interval.toLong(), intervalSchedule.unit).minusSeconds(2).toMillis() + val startTimeMillis = desiredStartTimeMillis ?: (Instant.now().toEpochMilli() - millis) + val waitForActiveShards = if (isMultiNode) "all" else "1" + val response = client().makeRequest( + "POST", "${IndexManagementPlugin.INDEX_MANAGEMENT_INDEX}/_update/${update.id}?wait_for_active_shards=$waitForActiveShards", + StringEntity( + "{\"doc\":{\"transform\":{\"schedule\":{\"interval\":{\"start_time\":" + + "\"$startTimeMillis\"}}}}}", + ContentType.APPLICATION_JSON + ) + ) + + assertEquals("Request failed", RestStatus.OK, response.restStatus()) + } + override fun preserveIndicesUponCompletion(): Boolean = true companion object { val isMultiNode = System.getProperty("cluster.number_of_nodes", "1").toInt() > 1 diff --git a/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt index 87cbb21c0..f77a9be21 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/SecurityRestTestCase.kt @@ -109,9 +109,6 @@ abstract class SecurityRestTestCase : IndexManagementRestTestCase() { private object TransformRestTestCaseExt : TransformRestTestCase() { - fun updateTransformStartTimeExt(update: Transform, desiredStartTimeMillis: Long? = null) = - super.updateTransformStartTime(update, desiredStartTimeMillis) - fun createTransformExt( transform: Transform, transformId: String = randomAlphaOfLength(10), @@ -310,9 +307,6 @@ abstract class SecurityRestTestCase : IndexManagementRestTestCase() { executeRequest(request, expectedStatus, userClient) } - protected fun updateTransformStartTime(update: Transform, desiredStartTimeMillis: Long? = null) = - TransformRestTestCaseExt.updateTransformStartTimeExt(update, desiredStartTimeMillis) - protected fun createTransform( transform: Transform, transformId: String = randomAlphaOfLength(10), diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt index 1b0de903d..a054d94bc 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/action/TransformActionIT.kt @@ -133,6 +133,7 @@ class TransformActionIT : IndexStateManagementRestTestCase() { .addAggregator(avgAggregation()) .addAggregator(valueCountAggregation()) ) + val transform = ismTransform.toTransform(indexName) val policy = preparePolicyContainingTransform(indexName, ismTransform, policyId, retry = 1) createPolicy(policy, policyId) createIndex(indexName, policyId, mapping = SOURCE_INDEX_MAPPING) @@ -140,11 +141,10 @@ class TransformActionIT : IndexStateManagementRestTestCase() { assertIndexTransformFailedInAttemptCreateTransformStep(indexName, policyId, ismTransform) // verify the wait for transform completion step will be retried and failed again. - Thread.sleep(60000) updateManagedIndexConfigStartTime(getExistingManagedIndexConfig(indexName)) waitFor { assertEquals( - AttemptCreateTransformJobStep.getFailedMessage(ismTransform.toTransform(indexName).id, indexName), + AttemptCreateTransformJobStep.getFailedMessage(transform.id, indexName), getExplainManagedIndexMetaData(indexName).info?.get("message") ) } @@ -255,7 +255,8 @@ class TransformActionIT : IndexStateManagementRestTestCase() { } private fun assertIndexTransformSucceeded(indexName: String, policyId: String, ismTransform: ISMTransform) { - val transformId = ismTransform.toTransform(indexName).id + val transform = ismTransform.toTransform(indexName) + val transformId = transform.id val managedIndexConfig = getExistingManagedIndexConfig(indexName) // Change the start time so that the policy will be initialized. @@ -271,7 +272,7 @@ class TransformActionIT : IndexStateManagementRestTestCase() { ) } - Thread.sleep(60000) + updateTransformStartTime(transform) // Change the start time so that the transform action will be attempted. updateManagedIndexConfigStartTime(managedIndexConfig) @@ -291,7 +292,8 @@ class TransformActionIT : IndexStateManagementRestTestCase() { } private fun assertIndexTransformSucceededTwice(indexName: String, policyId: String, ismTransform: ISMTransform) { - val transformId = ismTransform.toTransform(indexName).id + val transform = ismTransform.toTransform(indexName) + val transformId = transform.id val managedIndexConfig = getExistingManagedIndexConfig(indexName) // Change the start time so that the policy will be initialized. @@ -306,7 +308,7 @@ class TransformActionIT : IndexStateManagementRestTestCase() { getExplainManagedIndexMetaData(indexName).info?.get("message") ) } - Thread.sleep(60000) + updateTransformStartTime(transform) // Change the start time so that the transform action will be attempted. updateManagedIndexConfigStartTime(managedIndexConfig) @@ -341,7 +343,7 @@ class TransformActionIT : IndexStateManagementRestTestCase() { getExplainManagedIndexMetaData(indexName).info?.get("message") ) } - Thread.sleep(60000) + updateTransformStartTime(transform) // Change the start time so that the second transform action will be attempted. updateManagedIndexConfigStartTime(managedIndexConfig) diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRestTestCase.kt index 4d01e49b2..aaba661c3 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/TransformRestTestCase.kt @@ -12,7 +12,6 @@ import org.apache.hc.core5.http.io.entity.StringEntity import org.apache.hc.core5.http.message.BasicHeader import org.junit.AfterClass import org.opensearch.client.Response -import org.opensearch.client.ResponseException import org.opensearch.client.RestClient import org.opensearch.common.settings.Settings import org.opensearch.core.xcontent.NamedXContentRegistry @@ -30,12 +29,8 @@ import org.opensearch.indexmanagement.transform.model.TransformMetadata import org.opensearch.indexmanagement.util._ID import org.opensearch.indexmanagement.util._PRIMARY_TERM import org.opensearch.indexmanagement.util._SEQ_NO -import org.opensearch.indexmanagement.waitFor -import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule import org.opensearch.core.rest.RestStatus import org.opensearch.search.SearchModule -import java.time.Duration -import java.time.Instant abstract class TransformRestTestCase : IndexManagementRestTestCase() { @@ -221,35 +216,6 @@ abstract class TransformRestTestCase : IndexManagementRestTestCase() { return continuousStats["documents_behind"] as Map } - protected fun updateTransformStartTime(update: Transform, desiredStartTimeMillis: Long? = null) { - // Before updating start time of a job always make sure there are no unassigned shards that could cause the config - // index to move to a new node and negate this forced start - if (isMultiNode) { - waitFor { - try { - client().makeRequest("GET", "_cluster/allocation/explain") - fail("Expected 400 Bad Request when there are no unassigned shards to explain") - } catch (e: ResponseException) { - assertEquals(RestStatus.BAD_REQUEST, e.response.restStatus()) - } - } - } - val intervalSchedule = (update.jobSchedule as IntervalSchedule) - val millis = Duration.of(intervalSchedule.interval.toLong(), intervalSchedule.unit).minusSeconds(2).toMillis() - val startTimeMillis = desiredStartTimeMillis ?: Instant.now().toEpochMilli() - millis - val waitForActiveShards = if (isMultiNode) "all" else "1" - val response = client().makeRequest( - "POST", "$INDEX_MANAGEMENT_INDEX/_update/${update.id}?wait_for_active_shards=$waitForActiveShards", - StringEntity( - "{\"doc\":{\"transform\":{\"schedule\":{\"interval\":{\"start_time\":" + - "\"$startTimeMillis\"}}}}}", - ContentType.APPLICATION_JSON - ) - ) - - assertEquals("Request failed", RestStatus.OK, response.restStatus()) - } - protected fun Transform.toHttpEntity(): HttpEntity = StringEntity(toJsonString(), ContentType.APPLICATION_JSON) override fun xContentRegistry(): NamedXContentRegistry {