org.elasticsearch.cluster.routing
Interface ShardsIterator

All Superinterfaces:
java.lang.Iterable<ShardRouting>, java.util.Iterator<ShardRouting>
All Known Implementing Classes:
PlainShardsIterator

public interface ShardsIterator
extends java.lang.Iterable<ShardRouting>, java.util.Iterator<ShardRouting>

Allows to iterate over a set of shard instances (routing) within a shard id group.


Method Summary
 boolean equals(java.lang.Object other)
           
 int hashCode()
           
 boolean hasNextActive()
          Is there an active shard we can iterate to.
 boolean hasNextAssigned()
          Is there an assigned shard we can iterate to.
 ShardRouting nextActive()
          Returns the next active shard, or throws NoSuchElementException.
 ShardRouting nextActiveOrNull()
          Returns the next active shard, or null.
 ShardRouting nextAssigned()
          Returns the next assigned shard, or throws NoSuchElementException.
 ShardRouting nextAssignedOrNull()
          Returns the next assigned shard, or null.
 ShardsIterator reset()
          Resets the iterator.
 ShardId shardId()
          The shard id this group relates to.
 int size()
          The number of shard routing instances.
 int sizeActive()
          The number of active shard routing instances.
 int sizeAssigned()
          The number of assigned shard routing instances.
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

shardId

ShardId shardId()
The shard id this group relates to.


reset

ShardsIterator reset()
Resets the iterator.


size

int size()
The number of shard routing instances.


sizeActive

int sizeActive()
The number of active shard routing instances.

See Also:
ShardRouting.active()

hasNextActive

boolean hasNextActive()
Is there an active shard we can iterate to.

See Also:
ShardRouting.active()

nextActive

ShardRouting nextActive()
                        throws java.util.NoSuchElementException
Returns the next active shard, or throws NoSuchElementException.

Throws:
java.util.NoSuchElementException
See Also:
ShardRouting.active()

nextActiveOrNull

ShardRouting nextActiveOrNull()
Returns the next active shard, or null.

See Also:
ShardRouting.active()

sizeAssigned

int sizeAssigned()
The number of assigned shard routing instances.

See Also:
ShardRouting.assignedToNode()

hasNextAssigned

boolean hasNextAssigned()
Is there an assigned shard we can iterate to.

See Also:
ShardRouting.assignedToNode()

nextAssigned

ShardRouting nextAssigned()
                          throws java.util.NoSuchElementException
Returns the next assigned shard, or throws NoSuchElementException.

Throws:
java.util.NoSuchElementException
See Also:
ShardRouting.assignedToNode()

nextAssignedOrNull

ShardRouting nextAssignedOrNull()
Returns the next assigned shard, or null.

See Also:
ShardRouting.assignedToNode()

hashCode

int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object