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
ShardRouting(StreamInput in)
ShardRouting(ShardId shardId,
StreamInput in)
boolean
active()
boolean
true
iff this shard is assigned to a node ie.
boolean
o)
boolean
equalsIgnoringMetadata(ShardRouting other)
long
ShardRoutingState.RELOCATING
and ShardRoutingState.INITIALIZING
shards.int
getId()
int
hashCode()
int
id()
index()
nodeId,
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. relocatingNodeId,
long expectedShardSize)
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 id, , , , , , ,
isFragment
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 to
- if something happens during writeWriteable
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()
in class
in class
in class
toXContent
in interface org.elasticsearch.common.xcontent.ToXContent
ShardRoutingState.RELOCATING
and ShardRoutingState.INITIALIZING
shards. If it's size is not available -1L will be returned.RecoverySource.PeerRecoverySource
.active()