Skip to content

Commit

Permalink
fix format by spotless
Browse files Browse the repository at this point in the history
Signed-off-by: ludongyu <[email protected]>
  • Loading branch information
KunjueYu committed Mar 21, 2024
1 parent 23ce2e1 commit 5c30a74
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.opensearch.cluster.routing.RoutingNodes;
import org.opensearch.cluster.routing.ShardRouting;
import org.opensearch.cluster.routing.allocation.RoutingAllocation;
import org.opensearch.common.settings.Settings;
import org.opensearch.indices.replication.common.ReplicationType;

import java.util.List;
Expand All @@ -58,8 +57,7 @@ public class NodeVersionAllocationDecider extends AllocationDecider {

public static final String NAME = "node_version";

public NodeVersionAllocationDecider() {
}
public NodeVersionAllocationDecider() {}

@Override
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,7 @@ public void testRebalanceDoesNotAllocatePrimaryAndReplicasOnDifferentVersionNode
.routingTable(routingTable)
.nodes(DiscoveryNodes.builder().add(newNode).add(oldNode1).add(oldNode2))
.build();
AllocationDeciders allocationDeciders = new AllocationDeciders(
Collections.singleton(new NodeVersionAllocationDecider())
);
AllocationDeciders allocationDeciders = new AllocationDeciders(Collections.singleton(new NodeVersionAllocationDecider()));
AllocationService strategy = new MockAllocationService(
allocationDeciders,
new TestGatewayAllocator(),
Expand Down Expand Up @@ -648,9 +646,7 @@ public void testRebalanceDoesNotAllocatePrimaryOnHigherVersionNodesSegrepEnabled
.routingTable(routingTable)
.nodes(DiscoveryNodes.builder().add(newNode1).add(newNode2).add(oldNode1).add(oldNode2))
.build();
AllocationDeciders allocationDeciders = new AllocationDeciders(
Collections.singleton(new NodeVersionAllocationDecider())
);
AllocationDeciders allocationDeciders = new AllocationDeciders(Collections.singleton(new NodeVersionAllocationDecider()));
AllocationService strategy = new MockAllocationService(
allocationDeciders,
new TestGatewayAllocator(),
Expand Down Expand Up @@ -715,16 +711,16 @@ public void testCanAllocatePrimaryOnHigherVersionNodesDocRepEnabled() {
IndexRoutingTable.builder(shard1.getIndex())
.addIndexShard(
new IndexShardRoutingTable.Builder(shard1).addShard(
TestShardRouting.newShardRouting(
shard1.getIndexName(),
shard1.getId(),
oldNode1.getId(),
null,
true,
ShardRoutingState.STARTED,
allocationId1P
)
TestShardRouting.newShardRouting(
shard1.getIndexName(),
shard1.getId(),
oldNode1.getId(),
null,
true,
ShardRoutingState.STARTED,
allocationId1P
)
)
.addShard(
TestShardRouting.newShardRouting(
shard1.getIndexName(),
Expand All @@ -745,9 +741,7 @@ public void testCanAllocatePrimaryOnHigherVersionNodesDocRepEnabled() {
.routingTable(routingTable)
.nodes(DiscoveryNodes.builder().add(newNode1).add(oldNode1).add(oldNode2))
.build();
AllocationDeciders allocationDeciders = new AllocationDeciders(
Collections.singleton(new NodeVersionAllocationDecider())
);
AllocationDeciders allocationDeciders = new AllocationDeciders(Collections.singleton(new NodeVersionAllocationDecider()));
AllocationService strategy = new MockAllocationService(
allocationDeciders,
new TestGatewayAllocator(),
Expand Down

0 comments on commit 5c30a74

Please sign in to comment.