primary
public boolean primary()
Returns
true iff this shard is a primary.Writeable, ToXContent, ToXContentObjectShardRouting immutably encapsulates information about shard
indexRoutings like id, state, version, etc.
Information about a particular shard instance.ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsWriteable.Reader<V>, Writeable.Writer<V>static final longEMPTY, EMPTY_PARAMSbooleanactive()booleantrue iff this shard is assigned to a node ie.booleanbooleanlongShardRoutingState.RELOCATING and ShardRoutingState.INITIALIZING
shards.intgetId()inthashCode()intid()index()initialize(String nodeId,
String existingAllocationId,
long expectedShardSize) booleanbooleanbooleanisRelocationSourceOf(ShardRouting other) booleantrue if this shard is a relocation target for another shard
(i.e., was created with initializeTargetRelocatingShard()booleanisRelocationTargetOf(ShardRouting other) booleanisSameAllocation(ShardRouting other) booleanmoveToStarted(long expectedShardSize) STARTED.moveToUnassigned(UnassignedInfo unassignedInfo) static ShardRoutingnewUnassigned(ShardId shardId,
boolean primary,
RecoverySource recoverySource,
UnassignedInfo unassignedInfo,
ShardRouting.Role role) booleanprimary()true iff this shard is a primary.booleantrue iff this shard is currently relocating to
another node.role()shardId()shardsIt()booleanstarted()state()toString()toXContent(XContentBuilder builder,
ToXContent.Params params) booleanupdateRelocationFailure(RelocationFailureInfo relocationFailureInfo) updateUnassigned(UnassignedInfo unassignedInfo,
RecoverySource recoverySource) voidwriteTo(StreamOutput out) voidwriteToThin(StreamOutput out) StreamOutput without writing index name and shard idclone, finalize, getClass, notify, notifyAll, wait, wait, waitisFragmentIOExceptionIOExceptiontrue iff this shard is currently relocating to
another node. Otherwise falsetrue iff this shard is a primary.StreamOutput without writing index name and shard idout - StreamOutput to write shard information toIOException - if something happens during writeWriteablewriteTo in interface WriteableIOExceptionexistingAllocationId - allocation id to use. If null, a fresh allocation id is generated.relocatingNodeId - id of the node to relocate the shardRELOCATING.INITIALIZING.
This allows the non-primary shard to continue recovery from the primary even though its non-primary
relocation source has failed.STARTED. The shards state must be
INITIALIZING or RELOCATING. Any relocation will be
canceled.IllegalShardRoutingStateException - if shard is already a primaryIllegalShardRoutingStateException - if shard is already a replica
Note: if both shard routing has a null as their allocationId(), this method returns false as the routing describe
no allocation at all..
true if this shard is a relocation target for another shard
(i.e., was created with initializeTargetRelocatingShard()toXContent in interface ToXContentIOExceptionShardRoutingState.RELOCATING and ShardRoutingState.INITIALIZING
shards. If it's size is not available -1L will be returned.RecoverySource.PeerRecoverySource.active()IndexRoutingTable.readyForSearch(ClusterState) to determine if an index
is ready to be searched.