public class AllocationId extends java.lang.Object implements ToXContent, Writeable
Relocation is a special case, where the origin shard is relocating with a relocationId and same id, and the target shard (only materialized in RoutingNodes) is initializing with the id set to the origin shard relocationId. Once relocation is done, the new allocation id is set to the relocationId. This is similar behavior to how ShardRouting#currentNodeId is used.
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
EMPTY_PARAMS
Modifier and Type | Method and Description |
---|---|
static AllocationId |
cancelRelocation(AllocationId allocationId)
Creates a new allocation id representing a cancelled relocation.
|
boolean |
equals(java.lang.Object o) |
static AllocationId |
finishRelocation(AllocationId allocationId)
Creates a new allocation id finalizing a relocation.
|
static AllocationId |
fromXContent(XContentParser parser) |
java.lang.String |
getId()
The allocation id uniquely identifying an allocation, note, if it is relocation
the
getRelocationId() need to be taken into account as well. |
java.lang.String |
getRelocationId()
The transient relocation id holding the unique id that is used for relocation.
|
int |
hashCode() |
static AllocationId |
newInitializing()
Creates a new allocation id for initializing allocation.
|
static AllocationId |
newInitializing(java.lang.String existingAllocationId)
Creates a new allocation id for initializing allocation based on an existing id.
|
static AllocationId |
newRelocation(AllocationId allocationId)
Creates a new allocation id for a shard that moves to be relocated, populating
the transient holder for relocationId.
|
static AllocationId |
newTargetRelocation(AllocationId allocationId)
Creates a new allocation id for the target initializing shard that is the result
of a relocation.
|
java.lang.String |
toString() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public static AllocationId newInitializing()
public static AllocationId newInitializing(java.lang.String existingAllocationId)
public static AllocationId newTargetRelocation(AllocationId allocationId)
public static AllocationId newRelocation(AllocationId allocationId)
public static AllocationId cancelRelocation(AllocationId allocationId)
Note that this is expected to be called on the allocation id of the *source* shard
public static AllocationId finishRelocation(AllocationId allocationId)
Note that this is expected to be called on the allocation id of the *target* shard and thus it only needs to clear the relocating id.
public java.lang.String getId()
getRelocationId()
need to be taken into account as well.public java.lang.String getRelocationId()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public static AllocationId fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException