diff --git a/src/main/kotlin/org/opensearch/index/translog/ReplicationTranslogDeletionPolicy.kt b/src/main/kotlin/org/opensearch/index/translog/ReplicationTranslogDeletionPolicy.kt index ec7a36d0..963044dd 100644 --- a/src/main/kotlin/org/opensearch/index/translog/ReplicationTranslogDeletionPolicy.kt +++ b/src/main/kotlin/org/opensearch/index/translog/ReplicationTranslogDeletionPolicy.kt @@ -1,6 +1,6 @@ package org.opensearch.index.translog -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.index.IndexSettings import org.opensearch.index.seqno.RetentionLease import org.opensearch.index.seqno.RetentionLeases diff --git a/src/main/kotlin/org/opensearch/replication/ReplicationPlugin.kt b/src/main/kotlin/org/opensearch/replication/ReplicationPlugin.kt index 7d66c976..8a17fc51 100644 --- a/src/main/kotlin/org/opensearch/replication/ReplicationPlugin.kt +++ b/src/main/kotlin/org/opensearch/replication/ReplicationPlugin.kt @@ -83,7 +83,7 @@ import org.opensearch.cluster.node.DiscoveryNodes import org.opensearch.cluster.service.ClusterService import org.opensearch.common.CheckedFunction import org.opensearch.core.ParseField -import org.opensearch.common.component.LifecycleComponent +import org.opensearch.common.lifecycle.LifecycleComponent import org.opensearch.core.common.io.stream.NamedWriteableRegistry import org.opensearch.core.common.io.stream.Writeable import org.opensearch.common.settings.ClusterSettings @@ -92,8 +92,8 @@ import org.opensearch.common.settings.Setting import org.opensearch.common.settings.Settings import org.opensearch.common.settings.SettingsFilter import org.opensearch.common.settings.SettingsModule -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.common.util.concurrent.OpenSearchExecutors import org.opensearch.core.xcontent.NamedXContentRegistry diff --git a/src/main/kotlin/org/opensearch/replication/ReplicationSettings.kt b/src/main/kotlin/org/opensearch/replication/ReplicationSettings.kt index 2b516f8e..a5065c6d 100644 --- a/src/main/kotlin/org/opensearch/replication/ReplicationSettings.kt +++ b/src/main/kotlin/org/opensearch/replication/ReplicationSettings.kt @@ -13,7 +13,7 @@ package org.opensearch.replication import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.ClusterSettings -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.unit.TimeValue import org.opensearch.commons.utils.OpenForTesting diff --git a/src/main/kotlin/org/opensearch/replication/action/stats/FollowerStatsResponse.kt b/src/main/kotlin/org/opensearch/replication/action/stats/FollowerStatsResponse.kt index 9d4ae15c..3b4c4503 100644 --- a/src/main/kotlin/org/opensearch/replication/action/stats/FollowerStatsResponse.kt +++ b/src/main/kotlin/org/opensearch/replication/action/stats/FollowerStatsResponse.kt @@ -16,7 +16,6 @@ import org.apache.logging.log4j.LogManager import org.opensearch.action.FailedNodeException import org.opensearch.action.support.nodes.BaseNodesResponse import org.opensearch.cluster.ClusterName -import org.opensearch.common.Strings import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS @@ -117,7 +116,7 @@ class FollowerStatsResponse : BaseNodesResponse, ToX override fun toString(): String { val builder: XContentBuilder = XContentFactory.jsonBuilder().prettyPrint() toXContent(builder, EMPTY_PARAMS) - return Strings.toString(builder) + return builder.toString() } } diff --git a/src/main/kotlin/org/opensearch/replication/action/stats/LeaderStatsResponse.kt b/src/main/kotlin/org/opensearch/replication/action/stats/LeaderStatsResponse.kt index 29abc78c..d3a54454 100644 --- a/src/main/kotlin/org/opensearch/replication/action/stats/LeaderStatsResponse.kt +++ b/src/main/kotlin/org/opensearch/replication/action/stats/LeaderStatsResponse.kt @@ -16,7 +16,6 @@ import org.apache.logging.log4j.LogManager import org.opensearch.action.FailedNodeException import org.opensearch.action.support.nodes.BaseNodesResponse import org.opensearch.cluster.ClusterName -import org.opensearch.common.Strings import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.common.io.stream.StreamOutput import org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS @@ -76,7 +75,7 @@ class LeaderStatsResponse : BaseNodesResponse, ToXCont override fun toString(): String { val builder: XContentBuilder = XContentFactory.jsonBuilder().prettyPrint() toXContent(builder, EMPTY_PARAMS) - return Strings.toString(builder) + return builder.toString() } } diff --git a/src/main/kotlin/org/opensearch/replication/metadata/store/ReplicationMetadataStore.kt b/src/main/kotlin/org/opensearch/replication/metadata/store/ReplicationMetadataStore.kt index 18a0cd6c..d5cbe751 100644 --- a/src/main/kotlin/org/opensearch/replication/metadata/store/ReplicationMetadataStore.kt +++ b/src/main/kotlin/org/opensearch/replication/metadata/store/ReplicationMetadataStore.kt @@ -30,7 +30,7 @@ import org.opensearch.client.Client import org.opensearch.cluster.health.ClusterHealthStatus import org.opensearch.cluster.metadata.IndexMetadata import org.opensearch.cluster.service.ClusterService -import org.opensearch.common.component.AbstractLifecycleComponent +import org.opensearch.common.lifecycle.AbstractLifecycleComponent import org.opensearch.common.settings.Settings import org.opensearch.common.util.concurrent.ThreadContext import org.opensearch.common.xcontent.XContentType diff --git a/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterMultiChunkTransfer.kt b/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterMultiChunkTransfer.kt index b3097f13..344fbcbb 100644 --- a/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterMultiChunkTransfer.kt +++ b/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterMultiChunkTransfer.kt @@ -26,7 +26,7 @@ import org.apache.logging.log4j.Logger import org.opensearch.action.ActionListener import org.opensearch.client.Client import org.opensearch.cluster.node.DiscoveryNode -import org.opensearch.common.unit.ByteSizeValue +import org.opensearch.core.common.unit.ByteSizeValue import org.opensearch.common.util.concurrent.ThreadContext import org.opensearch.core.index.shard.ShardId import org.opensearch.index.store.Store diff --git a/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterRepository.kt b/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterRepository.kt index f5e7a149..7272c006 100644 --- a/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterRepository.kt +++ b/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterRepository.kt @@ -47,7 +47,7 @@ import org.opensearch.cluster.node.DiscoveryNode import org.opensearch.cluster.service.ClusterService import org.opensearch.common.Nullable import org.opensearch.common.UUIDs -import org.opensearch.common.component.AbstractLifecycleComponent +import org.opensearch.common.lifecycle.AbstractLifecycleComponent import org.opensearch.common.metrics.CounterMetric import org.opensearch.common.settings.Settings import org.opensearch.index.mapper.MapperService diff --git a/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterRestoreLeaderService.kt b/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterRestoreLeaderService.kt index 5c06e4d4..22c279a2 100644 --- a/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterRestoreLeaderService.kt +++ b/src/main/kotlin/org/opensearch/replication/repository/RemoteClusterRestoreLeaderService.kt @@ -17,7 +17,7 @@ import org.opensearch.replication.util.performOp import org.opensearch.OpenSearchException import org.opensearch.action.support.single.shard.SingleShardRequest import org.opensearch.client.node.NodeClient -import org.opensearch.common.component.AbstractLifecycleComponent +import org.opensearch.common.lifecycle.AbstractLifecycleComponent import org.opensearch.common.inject.Inject import org.opensearch.common.inject.Singleton import org.opensearch.common.lucene.store.InputStreamIndexInput diff --git a/src/main/kotlin/org/opensearch/replication/seqno/RemoteClusterStats.kt b/src/main/kotlin/org/opensearch/replication/seqno/RemoteClusterStats.kt index 80a9d6d2..9481543a 100644 --- a/src/main/kotlin/org/opensearch/replication/seqno/RemoteClusterStats.kt +++ b/src/main/kotlin/org/opensearch/replication/seqno/RemoteClusterStats.kt @@ -11,7 +11,7 @@ package org.opensearch.replication.seqno -import org.opensearch.common.component.AbstractLifecycleComponent +import org.opensearch.common.lifecycle.AbstractLifecycleComponent import org.opensearch.common.inject.Singleton import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.common.io.stream.StreamOutput diff --git a/src/main/kotlin/org/opensearch/replication/seqno/RemoteClusterTranslogService.kt b/src/main/kotlin/org/opensearch/replication/seqno/RemoteClusterTranslogService.kt index 21edfea3..bc210c72 100644 --- a/src/main/kotlin/org/opensearch/replication/seqno/RemoteClusterTranslogService.kt +++ b/src/main/kotlin/org/opensearch/replication/seqno/RemoteClusterTranslogService.kt @@ -13,7 +13,7 @@ package org.opensearch.replication.seqno import org.apache.logging.log4j.LogManager import org.opensearch.ResourceNotFoundException -import org.opensearch.common.component.AbstractLifecycleComponent +import org.opensearch.common.lifecycle.AbstractLifecycleComponent import org.opensearch.common.inject.Singleton import org.opensearch.index.engine.Engine import org.opensearch.index.shard.IndexShard diff --git a/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationParams.kt b/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationParams.kt index 6a758b8f..5d045b3d 100644 --- a/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationParams.kt +++ b/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationParams.kt @@ -13,7 +13,7 @@ package org.opensearch.replication.task.index import org.opensearch.Version import org.opensearch.core.ParseField -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.xcontent.ObjectParser diff --git a/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt b/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt index f520926b..ce3cb43a 100644 --- a/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt +++ b/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationTask.kt @@ -73,8 +73,8 @@ import org.opensearch.common.logging.Loggers import org.opensearch.common.settings.Setting import org.opensearch.common.settings.Settings import org.opensearch.common.settings.SettingsModule -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.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContentObject import org.opensearch.core.xcontent.XContentBuilder diff --git a/src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationParams.kt b/src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationParams.kt index c1981de1..95b805b1 100644 --- a/src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationParams.kt +++ b/src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationParams.kt @@ -13,7 +13,7 @@ package org.opensearch.replication.task.shard import org.opensearch.Version import org.opensearch.core.ParseField -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.xcontent.ObjectParser diff --git a/src/main/kotlin/org/opensearch/replication/util/Injectables.kt b/src/main/kotlin/org/opensearch/replication/util/Injectables.kt index 55f45690..88e4cd48 100644 --- a/src/main/kotlin/org/opensearch/replication/util/Injectables.kt +++ b/src/main/kotlin/org/opensearch/replication/util/Injectables.kt @@ -11,7 +11,7 @@ package org.opensearch.replication.util -import org.opensearch.common.component.AbstractLifecycleComponent +import org.opensearch.common.lifecycle.AbstractLifecycleComponent import org.opensearch.common.inject.Inject import org.opensearch.indices.IndicesService import org.opensearch.persistent.PersistentTasksService diff --git a/src/main/kotlin/org/opensearch/replication/util/ValidationUtil.kt b/src/main/kotlin/org/opensearch/replication/util/ValidationUtil.kt index 1cfa7444..1d6b8c2e 100644 --- a/src/main/kotlin/org/opensearch/replication/util/ValidationUtil.kt +++ b/src/main/kotlin/org/opensearch/replication/util/ValidationUtil.kt @@ -17,7 +17,7 @@ import org.opensearch.Version import org.opensearch.cluster.ClusterState import org.opensearch.cluster.metadata.IndexMetadata import org.opensearch.cluster.metadata.MetadataCreateIndexService -import org.opensearch.common.Strings +import org.opensearch.core.common.Strings import org.opensearch.common.ValidationException import org.opensearch.common.settings.Settings import org.opensearch.env.Environment diff --git a/src/test/kotlin/org/opensearch/replication/MultiClusterRestTestCase.kt b/src/test/kotlin/org/opensearch/replication/MultiClusterRestTestCase.kt index 0dd38a22..523ff913 100644 --- a/src/test/kotlin/org/opensearch/replication/MultiClusterRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/replication/MultiClusterRestTestCase.kt @@ -37,7 +37,6 @@ import org.opensearch.client.ResponseException import org.opensearch.client.RestClient import org.opensearch.client.RestClientBuilder import org.opensearch.client.RestHighLevelClient -import org.opensearch.common.Strings import org.opensearch.common.io.PathUtils import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue @@ -416,7 +415,7 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() { clearCommand.endObject() if (mustClear) { val request = Request("PUT", "/_cluster/settings") - request.setJsonEntity(Strings.toString(clearCommand)) + request.setJsonEntity(clearCommand.toString()) testCluster.lowLevelClient.performRequest(request) } } diff --git a/src/test/kotlin/org/opensearch/replication/ReplicationHelpers.kt b/src/test/kotlin/org/opensearch/replication/ReplicationHelpers.kt index f5c9ff24..4a0c6a3a 100644 --- a/src/test/kotlin/org/opensearch/replication/ReplicationHelpers.kt +++ b/src/test/kotlin/org/opensearch/replication/ReplicationHelpers.kt @@ -25,7 +25,7 @@ import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue import org.opensearch.core.xcontent.DeprecationHandler import org.opensearch.core.xcontent.NamedXContentRegistry -import org.opensearch.common.xcontent.XContentType +import org.opensearch.core.xcontent.MediaType import org.opensearch.test.OpenSearchTestCase.assertBusy import org.opensearch.test.rest.OpenSearchRestTestCase import org.junit.Assert @@ -96,7 +96,7 @@ fun RestHighLevelClient.startReplication(request: StartReplicationRequest, waitForNoInitializingShards() } fun getAckResponse(lowLevelResponse: Response): AcknowledgedResponse { - val xContentType = XContentType.fromMediaType(lowLevelResponse.entity.contentType.value) + val xContentType = MediaType.fromMediaType(lowLevelResponse.entity.contentType.value) val xcp = xContentType.xContent().createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.IGNORE_DEPRECATIONS, lowLevelResponse.entity.content) return AcknowledgedResponse.fromXContent(xcp)