Skip to content

Commit

Permalink
code refactoring and spotless checks
Browse files Browse the repository at this point in the history
Signed-off-by: Shubh Sahu <shubhvs@amazon.com>
  • Loading branch information
Shubh Sahu committed Apr 1, 2024
1 parent f262296 commit 872f742
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.opensearch.client.Client;
import org.opensearch.common.settings.Settings;
import org.opensearch.indices.replication.common.ReplicationType;
import org.opensearch.node.remotestore.RemoteStoreNodeService;
import org.opensearch.test.OpenSearchIntegTestCase;

import java.util.List;
Expand Down Expand Up @@ -137,7 +136,6 @@ public void testFailResizeIndexWhileRemoteStoreToDocRepMigration() throws Except
addRemote = false;
String nonRemoteNodeName = internalCluster().startNode();


logger.info("-->Create index on remote node and SETTING_REMOTE_STORE_ENABLED is true. Resize should not happen");
Settings.Builder builder = Settings.builder().put(SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT);
client.admin()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,11 @@ private static void validateClusterModeSettings(
if (clusterSettings.get(RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING)
.equals(RemoteStoreNodeService.CompatibilityMode.MIXED)) {
boolean isRemoteStoreEnabled = sourceIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false);
if ((clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING).equals(RemoteStoreNodeService.Direction.REMOTE_STORE)
if ((clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING)
.equals(RemoteStoreNodeService.Direction.REMOTE_STORE)
&& isRemoteStoreEnabled == false)
|| (clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING).equals(RemoteStoreNodeService.Direction.DOCREP)
&& isRemoteStoreEnabled == true)) {
&& isRemoteStoreEnabled == true)) {
throw new IllegalStateException(
"index Resizing for type ["
+ type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ public void testResizeFailuresDuringMigration() {

if (compatibilityMode == CompatibilityMode.MIXED) {
if ((migrationDirection == RemoteStoreNodeService.Direction.REMOTE_STORE && isRemoteStoreEnabled == false)
|| migrationDirection == RemoteStoreNodeService.Direction.DOCREP && isRemoteStoreEnabled == true ){
|| migrationDirection == RemoteStoreNodeService.Direction.DOCREP && isRemoteStoreEnabled == true) {
ClusterState finalState = clusterState;
IllegalStateException ise = expectThrows(
IllegalStateException.class,
Expand Down

0 comments on commit 872f742

Please sign in to comment.