File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
server/src/main/java/org/elasticsearch Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -456,7 +456,7 @@ public long getRemainingDelay(
456456 */
457457 public static int getNumberOfDelayedUnassigned (ClusterState state ) {
458458 int count = 0 ;
459- for (ShardRouting shard : state .routingTable ().shardsWithState ( ShardRoutingState . UNASSIGNED )) {
459+ for (ShardRouting shard : state .getRoutingNodes ().unassigned ( )) {
460460 if (shard .unassignedInfo ().isDelayed ()) {
461461 count ++;
462462 }
@@ -471,9 +471,8 @@ public static int getNumberOfDelayedUnassigned(ClusterState state) {
471471 */
472472 public static long findNextDelayedAllocation (long currentNanoTime , ClusterState state ) {
473473 Metadata metadata = state .metadata ();
474- RoutingTable routingTable = state .routingTable ();
475474 long nextDelayNanos = Long .MAX_VALUE ;
476- for (ShardRouting shard : routingTable . shardsWithState ( ShardRoutingState . UNASSIGNED )) {
475+ for (ShardRouting shard : state . getRoutingNodes (). unassigned ( )) {
477476 UnassignedInfo unassignedInfo = shard .unassignedInfo ();
478477 if (unassignedInfo .isDelayed ()) {
479478 Settings indexSettings = metadata .index (shard .index ()).getSettings ();
Original file line number Diff line number Diff line change 2121import org .elasticsearch .cluster .routing .RecoverySource ;
2222import org .elasticsearch .cluster .routing .RerouteService ;
2323import org .elasticsearch .cluster .routing .ShardRouting ;
24- import org .elasticsearch .cluster .routing .ShardRoutingState ;
2524import org .elasticsearch .cluster .service .ClusterService ;
2625import org .elasticsearch .common .Priority ;
2726import org .elasticsearch .common .collect .ImmutableOpenMap ;
@@ -320,7 +319,7 @@ int numberOfKnownSnapshotShardSizes() {
320319
321320 private static Set <SnapshotShard > listOfSnapshotShards (final ClusterState state ) {
322321 final Set <SnapshotShard > snapshotShards = new HashSet <>();
323- for (ShardRouting shardRouting : state .routingTable ().shardsWithState ( ShardRoutingState . UNASSIGNED )) {
322+ for (ShardRouting shardRouting : state .getRoutingNodes ().unassigned ( )) {
324323 if (shardRouting .primary () && shardRouting .recoverySource ().getType () == RecoverySource .Type .SNAPSHOT ) {
325324 final RecoverySource .SnapshotRecoverySource snapshotRecoverySource = (RecoverySource .SnapshotRecoverySource ) shardRouting
326325 .recoverySource ();
You can’t perform that action at this time.
0 commit comments