Module org.elasticsearch.server
Class RoutingNodes.UnassignedShards
java.lang.Object
org.elasticsearch.cluster.routing.RoutingNodes.UnassignedShards
- All Implemented Interfaces:
Iterable<ShardRouting>
- Enclosing class:
RoutingNodes
public static final class RoutingNodes.UnassignedShards
extends Object
implements Iterable<ShardRouting>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ShardRouting shardRouting) copyFor
(RoutingNodes newNodes) drain()
Drains all unassigned shards and returns it.boolean
int
Returns the number of temporarily marked as ignored unassigned primariesint
Returns the number of non-ignored unassigned primariesint
hashCode()
ignored()
The list of ignored unassigned shards (read only).void
ignoreShard
(ShardRouting shard, UnassignedInfo.AllocationStatus allocationStatus, RoutingChangesObserver changes) Marks a shard as temporarily ignored and adds it to the ignore unassigned list.boolean
isEmpty()
Returnstrue
iff this collection contains one or more non-ignored unassigned shards.boolean
Returnstrue
iff any unassigned shards are marked as temporarily ignored.iterator()
void
int
size()
Returns the size of the non-ignored unassigned shardsvoid
sort
(Comparator<ShardRouting> comparator) stream()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
UnassignedShards
-
-
Method Details
-
copyFor
-
add
-
sort
-
size
public int size()Returns the size of the non-ignored unassigned shards -
getNumPrimaries
public int getNumPrimaries()Returns the number of non-ignored unassigned primaries -
getNumIgnoredPrimaries
public int getNumIgnoredPrimaries()Returns the number of temporarily marked as ignored unassigned primaries -
iterator
- Specified by:
iterator
in interfaceIterable<ShardRouting>
-
stream
-
ignored
The list of ignored unassigned shards (read only). The ignored unassigned shards are not part of the formal unassigned list, but are kept around and used to build back the list of unassigned shards as part of the routing table. -
ignoreShard
public void ignoreShard(ShardRouting shard, UnassignedInfo.AllocationStatus allocationStatus, RoutingChangesObserver changes) Marks a shard as temporarily ignored and adds it to the ignore unassigned list. Should be used with caution, typically, the correct usage is to removeAndIgnore from the iterator.- See Also:
-
resetIgnored
public void resetIgnored() -
isEmpty
public boolean isEmpty()Returnstrue
iff this collection contains one or more non-ignored unassigned shards. -
isIgnoredEmpty
public boolean isIgnoredEmpty()Returnstrue
iff any unassigned shards are marked as temporarily ignored.- See Also:
-
drain
Drains all unassigned shards and returns it. This method will not drain ignored shards. -
equals
-
hashCode
public int hashCode()
-