Module org.elasticsearch.server
Class CancelAllocationCommand
java.lang.Object
org.elasticsearch.cluster.routing.allocation.command.CancelAllocationCommand
- All Implemented Interfaces:
AllocationCommand,NamedWriteable,Writeable,ToXContent,ToXContentObject
A command that cancels relocation, or recovery of a given shard on a node.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionCancelAllocationCommand(String index, int shardId, String node, boolean allowPrimary) Deprecated, for removal: This API element is subject to removal in a future version.CancelAllocationCommand(String index, int shardId, String node, boolean allowPrimary, ProjectId projectId) Creates a newCancelAllocationCommandRead from a stream. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanexecute(RoutingAllocation allocation, boolean explain) Executes the command on aRoutingAllocationsetupstatic CancelAllocationCommandfromXContent(XContentParser parser, Object projectId) inthashCode()index()Get the index of the shard which allocation should be canceledname()Get the name of the commandnode()Get the id of the node that manages the shard which allocation should be canceledGet theProjectIdthat this command targets to.intshardId()Get the id of the shard which allocation should be canceledtoXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.routing.allocation.command.AllocationCommand
getMessage, getWriteableNameMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME
- See Also:
-
COMMAND_NAME_FIELD
-
-
Constructor Details
-
CancelAllocationCommand
public CancelAllocationCommand(String index, int shardId, String node, boolean allowPrimary, ProjectId projectId) Creates a newCancelAllocationCommand- Parameters:
index- index of the shard which allocation should be canceledshardId- id of the shard which allocation should be cancelednode- id of the node that manages the shard which allocation should be canceledprojectId- the project-id that this index belongs to
-
CancelAllocationCommand
@Deprecated(forRemoval=true) public CancelAllocationCommand(String index, int shardId, String node, boolean allowPrimary) Deprecated, for removal: This API element is subject to removal in a future version. -
CancelAllocationCommand
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
name
Description copied from interface:AllocationCommandGet the name of the command- Specified by:
namein interfaceAllocationCommand- Returns:
- name of the command
-
projectId
Description copied from interface:AllocationCommandGet theProjectIdthat this command targets to.- Specified by:
projectIdin interfaceAllocationCommand
-
index
Get the index of the shard which allocation should be canceled- Returns:
- index of the shard which allocation should be canceled
-
shardId
public int shardId()Get the id of the shard which allocation should be canceled- Returns:
- id of the shard which allocation should be canceled
-
node
Get the id of the node that manages the shard which allocation should be canceled- Returns:
- id of the node that manages the shard which allocation should be canceled
-
allowPrimary
public boolean allowPrimary() -
execute
Description copied from interface:AllocationCommandExecutes the command on aRoutingAllocationsetup- Specified by:
executein interfaceAllocationCommand- Parameters:
allocation-RoutingAllocationto modify
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
fromXContent
public static CancelAllocationCommand fromXContent(XContentParser parser, Object projectId) throws IOException - Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-