@@ -663,36 +663,36 @@ public ShardAllocationDecision decideShardAllocation(ShardRouting shard, Routing
663663 clusterState = rebuildRoutingTable (clusterState , routingNodes );
664664
665665 final var dataNodeIds = clusterState .nodes ().getDataNodes ().keySet ();
666- final var desiredBalanceInput = new DesiredBalanceInput (
667- randomInt (),
668- new RoutingAllocation (new AllocationDeciders (List .of (new AllocationDecider () {
669- @ Override
670- public Decision canAllocate (ShardRouting shardRouting , RoutingNode node , RoutingAllocation allocation ) {
671- return Decision .NO ;
672- }
673- })), clusterState , ClusterInfo .EMPTY , SnapshotShardSizeInfo .EMPTY , 0L ),
674- List .of ()
675- );
676- var desiredBalance = desiredBalanceComputer .compute (
677- DesiredBalance .BECOME_MASTER_INITIAL ,
678- desiredBalanceInput ,
679- queue (
680- new MoveAllocationCommand (index .getName (), 0 , randomFrom ("node-0" , "node-1" ), "node-2" ),
681- new MoveAllocationCommand (index .getName (), 1 , randomFrom ("node-0" , "node-1" ), "node-2" )
682- ),
683- input -> true
684- );
666+ final var desiredBalanceInput = new DesiredBalanceInput (
667+ randomInt (),
668+ new RoutingAllocation (new AllocationDeciders (List .of (new AllocationDecider () {
669+ @ Override
670+ public Decision canAllocate (ShardRouting shardRouting , RoutingNode node , RoutingAllocation allocation ) {
671+ return Decision .NO ;
672+ }
673+ })), clusterState , ClusterInfo .EMPTY , SnapshotShardSizeInfo .EMPTY , 0L ),
674+ List .of ()
675+ );
676+ var desiredBalance = desiredBalanceComputer .compute (
677+ DesiredBalance .BECOME_MASTER_INITIAL ,
678+ desiredBalanceInput ,
679+ queue (
680+ new MoveAllocationCommand (index .getName (), 0 , randomFrom ("node-0" , "node-1" ), "node-2" ),
681+ new MoveAllocationCommand (index .getName (), 1 , randomFrom ("node-0" , "node-1" ), "node-2" )
682+ ),
683+ input -> true
684+ );
685685
686- final Set <String > expectedNodeIds = Set .of ("node-0" , "node-1" );
687- assertDesiredAssignments (
688- desiredBalance ,
689- Map .of (
690- new ShardId (index , 0 ),
691- new ShardAssignment (expectedNodeIds , 2 , 0 , 0 ),
692- new ShardId (index , 1 ),
693- new ShardAssignment (expectedNodeIds , 2 , 0 , 0 )
694- )
695- );
686+ final Set <String > expectedNodeIds = Set .of ("node-0" , "node-1" );
687+ assertDesiredAssignments (
688+ desiredBalance ,
689+ Map .of (
690+ new ShardId (index , 0 ),
691+ new ShardAssignment (expectedNodeIds , 2 , 0 , 0 ),
692+ new ShardId (index , 1 ),
693+ new ShardAssignment (expectedNodeIds , 2 , 0 , 0 )
694+ )
695+ );
696696 }
697697
698698 public void testDesiredBalanceShouldConvergeInABigCluster () {
0 commit comments