From 347d9362cfcf45ea443e33bc325f964499cd57bb Mon Sep 17 00:00:00 2001 From: monusingh-1 Date: Tue, 8 Aug 2023 10:33:43 +0530 Subject: [PATCH] Move to core.common.Strings Signed-off-by: monusingh-1 --- .../replication/action/stats/FollowerStatsResponse.kt | 3 +-- .../opensearch/replication/action/stats/LeaderStatsResponse.kt | 3 +-- .../replication/task/index/IndexReplicationParams.kt | 2 +- .../replication/task/shard/ShardReplicationParams.kt | 2 +- .../kotlin/org/opensearch/replication/util/ValidationUtil.kt | 2 +- .../org/opensearch/replication/MultiClusterRestTestCase.kt | 3 +-- 6 files changed, 6 insertions(+), 9 deletions(-) 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/task/index/IndexReplicationParams.kt b/src/main/kotlin/org/opensearch/replication/task/index/IndexReplicationParams.kt index 644b73e3..fc842f34 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/shard/ShardReplicationParams.kt b/src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationParams.kt index 95b22425..0f7c798b 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/ValidationUtil.kt b/src/main/kotlin/org/opensearch/replication/util/ValidationUtil.kt index 9f0bb4fc..0e2b4e62 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 d6981ad2..76519067 100644 --- a/src/test/kotlin/org/opensearch/replication/MultiClusterRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/replication/MultiClusterRestTestCase.kt @@ -38,7 +38,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 @@ -419,7 +418,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) } }