Skip to content

Commit

Permalink
add annotation + refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Poojita Raj <poojiraj@amazon.com>
  • Loading branch information
Poojita-Raj committed Aug 4, 2023
1 parent 7f7df45 commit 342b6ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*
* ShardMovementStrategy values or rather their string representation to be used with
* {@link BalancedShardsAllocator#SHARD_MOVEMENT_STRATEGY_SETTING} via cluster settings.
*
* @opensearch.internal
*/
public enum ShardMovementStrategy {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ public void testInterleavedShardIteratorPrimaryFirst() {
if (iteratingPrimary) {
iteratingPrimary = shard.primary();
} else {
assert shard.primary() == false;
assertFalse(shard.primary());
}
shardCount++;
}
assert shardCount == this.totalNumberOfShards;
assertEquals(shardCount, this.totalNumberOfShards);
}

public void testInterleavedShardIteratorNoPreference() {
Expand All @@ -178,7 +178,7 @@ public void testInterleavedShardIteratorNoPreference() {
final ShardRouting shard = iterator.next();
shardCount++;
}
assert shardCount == this.totalNumberOfShards;
assertEquals(shardCount, this.totalNumberOfShards);
}

public void testInterleavedShardIteratorReplicaFirst() {
Expand All @@ -199,11 +199,11 @@ public void testInterleavedShardIteratorReplicaFirst() {
if (iteratingReplica) {
iteratingReplica = shard.primary() == false;
} else {
assert shard.primary() == true;
assertTrue(shard.primary());
}
shardCount++;
}
assert shardCount == this.totalNumberOfShards;
assertEquals(shardCount, this.totalNumberOfShards);
}

public void testSwapPrimaryWithReplica() {
Expand Down

0 comments on commit 342b6ed

Please sign in to comment.