Skip to content

Commit

Permalink
Fix spotless errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranshu-S committed May 17, 2024
1 parent 8139e64 commit 5e636dc
Showing 1 changed file with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,35 @@ public void testDecisionTakenForNewIndexShards() {
.routingTable(routingTableBuilder.build())
.nodes(DiscoveryNodes.builder().add(node1).add(node2).add(node3))
.build();
RoutingAllocation newIndexRoutingAllocation = new RoutingAllocation(noAllocationDeciders(), new RoutingNodes(state, false), state, null, null, System.nanoTime());
RoutingAllocation newIndexRoutingAllocation = new RoutingAllocation(
noAllocationDeciders(),
new RoutingNodes(state, false),
state,
null,
null,
System.nanoTime()
);

ShardRouting primaryShard1 = newIndexRoutingAllocation.routingTable().getIndicesRouting().get("test").shard(shard1.id()).primaryShard();
ShardRouting primaryShard2 = newIndexRoutingAllocation.routingTable().getIndicesRouting().get("test").shard(shard2.id()).primaryShard();
ShardRouting primaryShard1 = newIndexRoutingAllocation.routingTable()
.getIndicesRouting()
.get("test")
.shard(shard1.id())
.primaryShard();
ShardRouting primaryShard2 = newIndexRoutingAllocation.routingTable()
.getIndicesRouting()
.get("test")
.shard(shard2.id())
.primaryShard();

List<ShardRouting> shards = new ArrayList<>();
shards.add(primaryShard1);
shards.add(primaryShard2);

HashMap<ShardRouting, AllocateUnassignedDecision> allDecisions = batchAllocator.makeAllocationDecision(shards, newIndexRoutingAllocation, logger);
HashMap<ShardRouting, AllocateUnassignedDecision> allDecisions = batchAllocator.makeAllocationDecision(
shards,
newIndexRoutingAllocation,
logger
);
// verify we get decisions for all the shards
assertEquals(shards.size(), allDecisions.size());
assertEquals(shards, new ArrayList<>(allDecisions.keySet()));
Expand Down

0 comments on commit 5e636dc

Please sign in to comment.