primary
public boolean primary()
Returns
true
iff this shard is a primary.Writeable
, org.elasticsearch.common.xcontent.ToXContent
, org.elasticsearch.common.xcontent.ToXContentObject
ShardRouting
immutably encapsulates information about shard
indexRoutings like id, state, version, etc.org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
static long
EMPTY_PARAMS
boolean
active()
boolean
true
iff this shard is assigned to a node ie.boolean
boolean
long
ShardRoutingState.RELOCATING
and ShardRoutingState.INITIALIZING
shards.int
getId()
int
hashCode()
int
id()
index()
initialize(String nodeId,
String existingAllocationId,
long expectedShardSize)
boolean
boolean
isRelocationSourceOf(ShardRouting other)
boolean
true
if this shard is a relocation target for another shard
(i.e., was created with initializeTargetRelocatingShard()
boolean
isRelocationTargetOf(ShardRouting other)
boolean
isSameAllocation(ShardRouting other)
STARTED
.moveToUnassigned(UnassignedInfo unassignedInfo)
static ShardRouting
newUnassigned(ShardId shardId,
boolean primary,
RecoverySource recoverySource,
UnassignedInfo unassignedInfo)
boolean
primary()
true
iff this shard is a primary.boolean
true
iff the this shard is currently relocating to
another node.shardId()
shardsIt()
boolean
started()
state()
toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder,
org.elasticsearch.common.xcontent.ToXContent.Params params)
boolean
updateUnassigned(UnassignedInfo unassignedInfo,
RecoverySource recoverySource)
void
writeTo(StreamOutput out)
void
writeToThin(StreamOutput out)
StreamOutput
without writing index name and shard idclone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
IOException
IOException
true
iff the this shard is currently relocating to
another node. Otherwise false
ShardRoutingState.RELOCATING
true
iff this shard is a primary.StreamOutput
without writing index name and shard idout
- StreamOutput
to write shard information toIOException
- if something happens during writeWriteable
writeTo
in interface Writeable
IOException
existingAllocationId
- 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 org.elasticsearch.common.xcontent.ToXContent
IOException
ShardRoutingState.RELOCATING
and ShardRoutingState.INITIALIZING
shards. If it's size is not available -1L will be returned.RecoverySource.PeerRecoverySource
.active()