Skip to content

Commit

Permalink
Fix spotless check
Browse files Browse the repository at this point in the history
Signed-off-by: Rishab Nahata <[email protected]>
  • Loading branch information
imRishN committed Sep 9, 2022
1 parent 193a7ec commit 39867e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.opensearch.cluster.decommission;

import org.hamcrest.Matchers;
import org.junit.After;
import org.junit.Before;
import org.opensearch.OpenSearchTimeoutException;
Expand Down Expand Up @@ -53,10 +52,8 @@
import static java.util.Collections.singletonMap;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.sameInstance;
import static org.hamcrest.Matchers.startsWith;
import static org.opensearch.cluster.ClusterState.builder;
import static org.opensearch.cluster.OpenSearchAllocationTestCase.createAllocationService;
import static org.opensearch.test.ClusterServiceUtils.createClusterService;
Expand Down Expand Up @@ -288,7 +285,9 @@ public ClusterState execute(ClusterState currentState) {
final Set<String> votingNodeIds = new HashSet<>();
currentState.nodes().forEach(n -> votingNodeIds.add(n.getId()));
currentState.getVotingConfigExclusions().forEach(t -> votingNodeIds.remove(t.getNodeId()));
final CoordinationMetadata.VotingConfiguration votingConfiguration = new CoordinationMetadata.VotingConfiguration(votingNodeIds);
final CoordinationMetadata.VotingConfiguration votingConfiguration = new CoordinationMetadata.VotingConfiguration(
votingNodeIds
);
return builder(currentState).metadata(
Metadata.builder(currentState.metadata())
.coordinationMetadata(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.opensearch.action.ActionListener;
import org.opensearch.cluster.ClusterName;
import org.opensearch.cluster.ClusterState;
import org.opensearch.cluster.ClusterStateObserver;
import org.opensearch.cluster.ack.ClusterStateUpdateResponse;
import org.opensearch.cluster.coordination.CoordinationMetadata;
import org.opensearch.cluster.metadata.Metadata;
Expand All @@ -27,7 +26,6 @@
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.test.transport.MockTransport;
import org.opensearch.threadpool.TestThreadPool;
Expand Down Expand Up @@ -152,7 +150,7 @@ public void testDecommissioningFailedWhenAnotherAttributeDecommissioningSuccessf
DecommissionStatus oldStatus = randomFrom(DecommissionStatus.SUCCESSFUL, DecommissionStatus.IN_PROGRESS, DecommissionStatus.INIT);
DecommissionAttributeMetadata oldMetadata = new DecommissionAttributeMetadata(
new DecommissionAttribute("zone", "zone_1"),
oldStatus
oldStatus
);
final ClusterState.Builder builder = builder(clusterService.state());
setState(
Expand All @@ -173,18 +171,10 @@ public void onFailure(Exception e) {
if (oldStatus.equals(DecommissionStatus.SUCCESSFUL)) {
assertThat(
e.getMessage(),
Matchers.endsWith(
"already successfully decommissioned, recommission before triggering another decommission"
)
);
}
else {
assertThat(
e.getMessage(),
Matchers.endsWith(
"is in progress, cannot process this request"
)
Matchers.endsWith("already successfully decommissioned, recommission before triggering another decommission")
);
} else {
assertThat(e.getMessage(), Matchers.endsWith("is in progress, cannot process this request"));
}
countDownLatch.countDown();
}
Expand Down

0 comments on commit 39867e3

Please sign in to comment.