From 04676e724893f550dcf5da8feaf4ee5ef2be00f2 Mon Sep 17 00:00:00 2001 From: Marc Handalian Date: Thu, 26 Jan 2023 16:33:28 -0800 Subject: [PATCH] spotless. Signed-off-by: Marc Handalian --- .../replication/SegmentReplicationIT.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java index 3ae172ae7ad4b..d4a6e11181188 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java @@ -11,10 +11,6 @@ import com.carrotsearch.randomizedtesting.RandomizedTest; import org.opensearch.OpenSearchCorruptionException; import org.opensearch.action.admin.cluster.health.ClusterHealthResponse; -import org.opensearch.action.admin.indices.segments.IndexShardSegments; -import org.opensearch.action.admin.indices.segments.IndicesSegmentResponse; -import org.opensearch.action.admin.indices.segments.IndicesSegmentsRequest; -import org.opensearch.action.admin.indices.segments.ShardSegments; import org.opensearch.action.search.SearchResponse; import org.opensearch.action.support.WriteRequest; import org.opensearch.action.update.UpdateResponse; @@ -22,7 +18,6 @@ import org.opensearch.cluster.ClusterState; import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.cluster.routing.IndexRoutingTable; import org.opensearch.cluster.routing.IndexShardRoutingTable; import org.opensearch.cluster.routing.ShardRouting; @@ -215,7 +210,7 @@ public void testCancelPrimaryAllocation() throws Exception { *

* TODO: Ignoring this test as its flaky and needs separate fix */ -// @AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/5669") + @AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/5669") public void testAddNewReplicaFailure() throws Exception { logger.info("--> starting [Primary Node] ..."); final String primaryNode = internalCluster().startNode(); @@ -223,9 +218,7 @@ public void testAddNewReplicaFailure() throws Exception { logger.info("--> creating test index ..."); prepareCreate( INDEX_NAME, - Settings.builder() - .put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1) - .put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) + Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) ).get(); @@ -691,18 +684,17 @@ private void waitForSearchableDocs(long docCount, String... nodes) throws Except waitForSearchableDocs(docCount, Arrays.stream(nodes).collect(Collectors.toList())); } - private void verifyStoreContent() throws Exception { assertBusy(() -> { final ClusterState clusterState = getClusterState(); - for (IndexRoutingTable indexRoutingTable: clusterState.routingTable()) { - for (IndexShardRoutingTable shardRoutingTable: indexRoutingTable) { + for (IndexRoutingTable indexRoutingTable : clusterState.routingTable()) { + for (IndexShardRoutingTable shardRoutingTable : indexRoutingTable) { final ShardRouting primaryRouting = shardRoutingTable.primaryShard(); final String indexName = primaryRouting.getIndexName(); final List replicaRouting = shardRoutingTable.replicaShards(); final IndexShard primaryShard = getIndexShard(clusterState, primaryRouting, indexName); final Map primarySegmentMetadata = primaryShard.getSegmentMetadataMap(); - for(ShardRouting replica: replicaRouting) { + for (ShardRouting replica : replicaRouting) { IndexShard replicaShard = getIndexShard(clusterState, replica, indexName); final Store.RecoveryDiff recoveryDiff = Store.segmentReplicationDiff( primarySegmentMetadata,