public class CancelAllocationCommand extends java.lang.Object implements AllocationCommand
AllocationCommand.Parser<T extends AllocationCommand>
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static ParseField |
COMMAND_NAME_FIELD |
static java.lang.String |
NAME |
EMPTY_PARAMS
Constructor and Description |
---|
CancelAllocationCommand(StreamInput in)
Read from a stream.
|
CancelAllocationCommand(java.lang.String index,
int shardId,
java.lang.String node,
boolean allowPrimary)
Creates a new
CancelAllocationCommand |
Modifier and Type | Method and Description |
---|---|
boolean |
allowPrimary() |
boolean |
equals(java.lang.Object obj) |
RerouteExplanation |
execute(RoutingAllocation allocation,
boolean explain)
Executes the command on a
RoutingAllocation setup |
static CancelAllocationCommand |
fromXContent(XContentParser parser) |
int |
hashCode() |
java.lang.String |
index()
Get the index of the shard which allocation should be canceled
|
java.lang.String |
name()
Get the name of the command
|
java.lang.String |
node()
Get the id of the node that manages the shard which allocation should be canceled
|
int |
shardId()
Get the id of the shard which allocation should be canceled
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getWriteableName
isFragment
public static final java.lang.String NAME
public static final ParseField COMMAND_NAME_FIELD
public CancelAllocationCommand(java.lang.String index, int shardId, java.lang.String node, boolean allowPrimary)
CancelAllocationCommand
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 canceledpublic CancelAllocationCommand(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public java.lang.String name()
AllocationCommand
name
in interface AllocationCommand
public java.lang.String index()
public int shardId()
public java.lang.String node()
public boolean allowPrimary()
public RerouteExplanation execute(RoutingAllocation allocation, boolean explain)
AllocationCommand
RoutingAllocation
setupexecute
in interface AllocationCommand
allocation
- RoutingAllocation
to modifypublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public static CancelAllocationCommand fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object