Class CancelAllocationCommand
java.lang.Object
org.elasticsearch.cluster.routing.allocation.command.CancelAllocationCommand
- All Implemented Interfaces:
AllocationCommand
,NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.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.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic org.elasticsearch.common.xcontent.ParseField
static String
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionCancelAllocationCommand(String index, int shardId, String node, boolean allowPrimary)
Creates a newCancelAllocationCommand
Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
execute(RoutingAllocation allocation, boolean explain)
Executes the command on aRoutingAllocation
setupstatic CancelAllocationCommand
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
int
hashCode()
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 canceledint
shardId()
Get the id of the shard which allocation should be canceledorg.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.routing.allocation.command.AllocationCommand
getMessage, getWriteableName
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
COMMAND_NAME_FIELD
public static final org.elasticsearch.common.xcontent.ParseField COMMAND_NAME_FIELD
-
-
Constructor Details
-
CancelAllocationCommand
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 canceled
-
CancelAllocationCommand
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
name
Description copied from interface:AllocationCommand
Get the name of the command- Specified by:
name
in interfaceAllocationCommand
- Returns:
- name of the command
-
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:AllocationCommand
Executes the command on aRoutingAllocation
setup- Specified by:
execute
in interfaceAllocationCommand
- Parameters:
allocation
-RoutingAllocation
to modify
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
IOException
-
fromXContent
public static CancelAllocationCommand fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-