org.elasticsearch.cluster.routing
Class ImmutableShardRouting

java.lang.Object
  extended by org.elasticsearch.cluster.routing.ImmutableShardRouting
All Implemented Interfaces:
java.io.Serializable, ShardRouting, Streamable
Direct Known Subclasses:
MutableShardRouting

public class ImmutableShardRouting
extends java.lang.Object
implements Streamable, java.io.Serializable, ShardRouting

See Also:
Serialized Form

Field Summary
protected  java.lang.String currentNodeId
           
protected  java.lang.String index
           
protected  boolean primary
           
protected  java.lang.String relocatingNodeId
           
protected  int shardId
           
protected  ShardRoutingState state
           
 
Constructor Summary
ImmutableShardRouting()
           
ImmutableShardRouting(ShardRouting copy)
           
ImmutableShardRouting(java.lang.String index, int shardId, java.lang.String currentNodeId, boolean primary, ShardRoutingState state)
           
ImmutableShardRouting(java.lang.String index, int shardId, java.lang.String currentNodeId, java.lang.String relocatingNodeId, boolean primary, ShardRoutingState state)
           
 
Method Summary
 boolean active()
          Relocating or started.
 boolean assignedToNode()
           
 java.lang.String currentNodeId()
           
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 int id()
           
 java.lang.String index()
           
 boolean initializing()
           
 boolean primary()
           
 void readFrom(StreamInput in)
           
 void readFrom(StreamInput in, java.lang.String index, int shardId)
           
 void readFromThin(StreamInput in)
           
static ImmutableShardRouting readShardRoutingEntry(StreamInput in)
           
static ImmutableShardRouting readShardRoutingEntry(StreamInput in, java.lang.String index, int shardId)
           
 boolean relocating()
           
 java.lang.String relocatingNodeId()
           
 ShardId shardId()
           
 ShardsIterator shardsIt()
          A shard iterator with just this shard in it.
 java.lang.String shortSummary()
           
 boolean started()
           
 ShardRoutingState state()
           
 java.lang.String toString()
           
 boolean unassigned()
           
 void writeTo(StreamOutput out)
           
 void writeToThin(StreamOutput out)
          Does not write index name and shard id
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

index

protected java.lang.String index

shardId

protected int shardId

currentNodeId

protected java.lang.String currentNodeId

relocatingNodeId

protected java.lang.String relocatingNodeId

primary

protected boolean primary

state

protected ShardRoutingState state
Constructor Detail

ImmutableShardRouting

public ImmutableShardRouting()

ImmutableShardRouting

public ImmutableShardRouting(ShardRouting copy)

ImmutableShardRouting

public ImmutableShardRouting(java.lang.String index,
                             int shardId,
                             java.lang.String currentNodeId,
                             boolean primary,
                             ShardRoutingState state)

ImmutableShardRouting

public ImmutableShardRouting(java.lang.String index,
                             int shardId,
                             java.lang.String currentNodeId,
                             java.lang.String relocatingNodeId,
                             boolean primary,
                             ShardRoutingState state)
Method Detail

index

public java.lang.String index()
Specified by:
index in interface ShardRouting

id

public int id()
Specified by:
id in interface ShardRouting

unassigned

public boolean unassigned()
Specified by:
unassigned in interface ShardRouting

initializing

public boolean initializing()
Specified by:
initializing in interface ShardRouting

active

public boolean active()
Description copied from interface: ShardRouting
Relocating or started.

Specified by:
active in interface ShardRouting

started

public boolean started()
Specified by:
started in interface ShardRouting

relocating

public boolean relocating()
Specified by:
relocating in interface ShardRouting

assignedToNode

public boolean assignedToNode()
Specified by:
assignedToNode in interface ShardRouting

currentNodeId

public java.lang.String currentNodeId()
Specified by:
currentNodeId in interface ShardRouting

relocatingNodeId

public java.lang.String relocatingNodeId()
Specified by:
relocatingNodeId in interface ShardRouting

primary

public boolean primary()
Specified by:
primary in interface ShardRouting

state

public ShardRoutingState state()
Specified by:
state in interface ShardRouting

shardId

public ShardId shardId()
Specified by:
shardId in interface ShardRouting

shardsIt

public ShardsIterator shardsIt()
Description copied from interface: ShardRouting
A shard iterator with just this shard in it.

Specified by:
shardsIt in interface ShardRouting

readShardRoutingEntry

public static ImmutableShardRouting readShardRoutingEntry(StreamInput in)
                                                   throws java.io.IOException
Throws:
java.io.IOException

readShardRoutingEntry

public static ImmutableShardRouting readShardRoutingEntry(StreamInput in,
                                                          java.lang.String index,
                                                          int shardId)
                                                   throws java.io.IOException
Throws:
java.io.IOException

readFrom

public void readFrom(StreamInput in,
                     java.lang.String index,
                     int shardId)
              throws java.io.IOException
Throws:
java.io.IOException

readFromThin

public void readFromThin(StreamInput in)
                  throws java.io.IOException
Specified by:
readFromThin in interface ShardRouting
Throws:
java.io.IOException

readFrom

public void readFrom(StreamInput in)
              throws java.io.IOException
Specified by:
readFrom in interface Streamable
Throws:
java.io.IOException

writeToThin

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

Specified by:
writeToThin in interface ShardRouting
Throws:
java.io.IOException

writeTo

public void writeTo(StreamOutput out)
             throws java.io.IOException
Specified by:
writeTo in interface Streamable
Throws:
java.io.IOException

equals

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

hashCode

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

shortSummary

public java.lang.String shortSummary()
Specified by:
shortSummary in interface ShardRouting