Skip to content

Commit

Permalink
Fix spotless check
Browse files Browse the repository at this point in the history
Signed-off-by: Rishab Nahata <rnnahata@amazon.com>
  • Loading branch information
imRishN committed Sep 13, 2022
1 parent 4b37726 commit a268fd3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ public ClusterState execute(ClusterState currentState) throws Exception {
// For failures, we update it no matter what
int previousStage = decommissionAttributeMetadata.status().stage();
int expectedStage = decommissionStatus.stage();
logger.info("attempting to update current decommission status [{}] with expected status [{}]",
logger.info(
"attempting to update current decommission status [{}] with expected status [{}]",
decommissionAttributeMetadata.status().stage(),
decommissionStatus
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public ClusterState execute(ClusterState currentState) throws Exception {
DecommissionAttributeMetadata decommissionAttributeMetadata = metadata.custom(DecommissionAttributeMetadata.TYPE);
// check if the same attribute is requested for decommission and currently not FAILED,
// then return the current state as is; as we don't need a state update here
if(isSameNonFailedRequest(decommissionAttributeMetadata, decommissionAttribute)) {
if (isSameNonFailedRequest(decommissionAttributeMetadata, decommissionAttribute)) {
logger.info("re-request received for decommissioning [{}], will not update state", decommissionAttribute);
return currentState;
}
Expand Down Expand Up @@ -406,7 +406,8 @@ private static void ensureNoConflictingInflightRequest(

private static boolean isSameNonFailedRequest(
DecommissionAttributeMetadata decommissionAttributeMetadata,
DecommissionAttribute decommissionAttribute) {
DecommissionAttribute decommissionAttribute
) {
return decommissionAttributeMetadata != null
&& decommissionAttributeMetadata.decommissionAttribute().equals(decommissionAttribute)
&& !decommissionAttributeMetadata.status().equals(DecommissionStatus.FAILED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

import static java.util.Collections.emptySet;
import static java.util.Collections.singletonMap;
import static org.mockito.Mockito.mock;
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 @@ -151,8 +150,13 @@ public void onResponse(ClusterStateUpdateResponse clusterStateUpdateResponse) {
@Override
public void onFailure(Exception e) {
assertTrue(e instanceof DecommissioningFailedException);
assertThat(e.getMessage(), Matchers.endsWith("invalid awareness attribute value requested for decommissioning. " +
"Set forced awareness values before to decommission"));
assertThat(
e.getMessage(),
Matchers.endsWith(
"invalid awareness attribute value requested for decommissioning. "
+ "Set forced awareness values before to decommission"
)
);
countDownLatch.countDown();
}
};
Expand Down

0 comments on commit a268fd3

Please sign in to comment.