File tree Expand file tree Collapse file tree
server/src/main/java/org/elasticsearch Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -446,7 +446,7 @@ public long getRemainingDelay(
446446 */
447447 public static int getNumberOfDelayedUnassigned (ClusterState state ) {
448448 int count = 0 ;
449- for (ShardRouting shard : state .getRoutingNodes ().shardsWithState ( ShardRoutingState . UNASSIGNED )) {
449+ for (ShardRouting shard : state .getRoutingNodes ().unassigned ( )) {
450450 if (shard .unassignedInfo ().isDelayed ()) {
451451 count ++;
452452 }
@@ -462,7 +462,7 @@ public static int getNumberOfDelayedUnassigned(ClusterState state) {
462462 public static long findNextDelayedAllocation (long currentNanoTime , ClusterState state ) {
463463 Metadata metadata = state .metadata ();
464464 long nextDelayNanos = Long .MAX_VALUE ;
465- for (ShardRouting shard : state .getRoutingNodes ().shardsWithState ( ShardRoutingState . UNASSIGNED )) {
465+ for (ShardRouting shard : state .getRoutingNodes ().unassigned ( )) {
466466 UnassignedInfo unassignedInfo = shard .unassignedInfo ();
467467 if (unassignedInfo .isDelayed ()) {
468468 Settings indexSettings = metadata .index (shard .index ()).getSettings ();
Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ int numberOfKnownSnapshotShardSizes() {
320320
321321 private static Set <SnapshotShard > listOfSnapshotShards (final ClusterState state ) {
322322 final Set <SnapshotShard > snapshotShards = new HashSet <>();
323- for (ShardRouting shardRouting : state .getRoutingNodes ().shardsWithState ( ShardRoutingState . UNASSIGNED )) {
323+ for (ShardRouting shardRouting : state .getRoutingNodes ().unassigned ( )) {
324324 if (shardRouting .primary () && shardRouting .recoverySource ().getType () == RecoverySource .Type .SNAPSHOT ) {
325325 final RecoverySource .SnapshotRecoverySource snapshotRecoverySource = (RecoverySource .SnapshotRecoverySource ) shardRouting
326326 .recoverySource ();
You can’t perform that action at this time.
0 commit comments