public static final class RoutingNodes.UnassignedShards extends java.lang.Object implements java.lang.Iterable<ShardRouting>
Modifier and Type | Class and Description |
---|---|
class |
RoutingNodes.UnassignedShards.UnassignedIterator |
Constructor and Description |
---|
UnassignedShards(RoutingNodes nodes) |
Modifier and Type | Method and Description |
---|---|
void |
add(ShardRouting shardRouting) |
ShardRouting[] |
drain()
Drains all unassigned shards and returns it.
|
int |
getNumIgnoredPrimaries()
Returns the number of temporarily marked as ignored unassigned primaries
|
int |
getNumPrimaries()
Returns the number of non-ignored unassigned primaries
|
java.util.List<ShardRouting> |
ignored()
The list of ignored unassigned shards (read only).
|
int |
ignoredSize()
Returns the size of the temporarily marked as ignored unassigned shards
|
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()
Returns
true iff this collection contains one or more non-ignored unassigned shards. |
boolean |
isIgnoredEmpty()
Returns
true iff any unassigned shards are marked as temporarily ignored. |
RoutingNodes.UnassignedShards.UnassignedIterator |
iterator() |
void |
shuffle() |
int |
size()
Returns the size of the non-ignored unassigned shards
|
void |
sort(java.util.Comparator<ShardRouting> comparator) |
public UnassignedShards(RoutingNodes nodes)
public void add(ShardRouting shardRouting)
public void sort(java.util.Comparator<ShardRouting> comparator)
public int size()
public int ignoredSize()
public int getNumPrimaries()
public int getNumIgnoredPrimaries()
public RoutingNodes.UnassignedShards.UnassignedIterator iterator()
iterator
in interface java.lang.Iterable<ShardRouting>
public java.util.List<ShardRouting> ignored()
public void ignoreShard(ShardRouting shard, UnassignedInfo.AllocationStatus allocationStatus, RoutingChangesObserver changes)
ignored()
,
UnassignedIterator#removeAndIgnore(AllocationStatus, RoutingChangesObserver)
,
isIgnoredEmpty()
public boolean isEmpty()
true
iff this collection contains one or more non-ignored unassigned shards.public boolean isIgnoredEmpty()
true
iff any unassigned shards are marked as temporarily ignored.UnassignedShards#ignoreShard(ShardRouting, AllocationStatus, RoutingChangesObserver)
,
UnassignedIterator#removeAndIgnore(AllocationStatus, RoutingChangesObserver)
public void shuffle()
public ShardRouting[] drain()