org.elasticsearch.cluster.routing
Interface ShardRouting

All Superinterfaces:
java.io.Serializable, Streamable
All Known Implementing Classes:
ImmutableShardRouting, MutableShardRouting

public interface ShardRouting
extends Streamable, java.io.Serializable

Shard routing represents the state of a shard instance allocated in the cluster.


Method Summary
 boolean active()
          Relocating or started.
 boolean assignedToNode()
          The shard is assigned to a node.
 java.lang.String currentNodeId()
          The current node id the shard is allocated to.
 int getId()
          The shard id.
 java.lang.String getIndex()
          The index name.
 int id()
          The shard id.
 java.lang.String index()
          The index name.
 boolean initializing()
          The shard is initializing (usually recovering either from peer shard or from gateway).
 boolean primary()
          Is this a primary shard.
 void readFromThin(StreamInput in)
           
 boolean relocating()
          The shard is in relocating mode.
 java.lang.String relocatingNodeId()
          The relocating node id the shard is either relocating to or relocating from.
 ShardId shardId()
          The shard id.
 ShardsIterator shardsIt()
          A shard iterator with just this shard in it.
 java.lang.String shortSummary()
          A short description of the shard.
 boolean started()
          The shard is in started mode.
 ShardRoutingState state()
          The shard state.
 boolean unassigned()
          The shard is unassigned (not allocated to any node).
 void writeToThin(StreamOutput out)
          Does not write index name and shard id
 
Methods inherited from interface org.elasticsearch.common.io.stream.Streamable
readFrom, writeTo
 

Method Detail

shardId

ShardId shardId()
The shard id.


index

java.lang.String index()
The index name.


getIndex

java.lang.String getIndex()
The index name.


id

int id()
The shard id.


getId

int getId()
The shard id.


state

ShardRoutingState state()
The shard state.


unassigned

boolean unassigned()
The shard is unassigned (not allocated to any node).


initializing

boolean initializing()
The shard is initializing (usually recovering either from peer shard or from gateway).


started

boolean started()
The shard is in started mode.


relocating

boolean relocating()
The shard is in relocating mode.


active

boolean active()
Relocating or started.


assignedToNode

boolean assignedToNode()
The shard is assigned to a node.


currentNodeId

java.lang.String currentNodeId()
The current node id the shard is allocated to.


relocatingNodeId

java.lang.String relocatingNodeId()
The relocating node id the shard is either relocating to or relocating from.


primary

boolean primary()
Is this a primary shard.


shortSummary

java.lang.String shortSummary()
A short description of the shard.


shardsIt

ShardsIterator shardsIt()
A shard iterator with just this shard in it.


writeToThin

void writeToThin(StreamOutput out)
                 throws java.io.IOException
Does not write index name and shard id

Throws:
java.io.IOException

readFromThin

void readFromThin(StreamInput in)
                  throws java.lang.ClassNotFoundException,
                         java.io.IOException
Throws:
java.lang.ClassNotFoundException
java.io.IOException