ToXContent, ToXContentFragmentpublic class AllocationCommands extends java.lang.Object implements ToXContentFragment
AllocationCommand composite managing several
AllocationCommand implementationsToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsEMPTY_PARAMS| Constructor | Description |
|---|---|
AllocationCommands(AllocationCommand... commands) |
Creates a new set of
AllocationCommands |
| Modifier and Type | Method | Description |
|---|---|---|
AllocationCommands |
add(AllocationCommand... commands) |
Adds a set of commands to this collection
|
java.util.List<AllocationCommand> |
commands() |
Get the commands wrapped by this instance
|
boolean |
equals(java.lang.Object obj) |
|
RoutingExplanations |
execute(RoutingAllocation allocation,
boolean explain) |
Executes all wrapped commands on a given
RoutingAllocation |
static AllocationCommands |
fromXContent(XContentParser parser) |
Reads
AllocationCommands from a XContentParser |
int |
hashCode() |
|
static AllocationCommands |
readFrom(StreamInput in) |
Reads a
AllocationCommands from a StreamInput |
java.lang.String |
toString() |
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
static void |
writeTo(AllocationCommands commands,
StreamOutput out) |
Writes
AllocationCommands to a StreamOutput |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitisFragmentpublic AllocationCommands(AllocationCommand... commands)
AllocationCommandscommands - AllocationCommands that are wrapped by this instancepublic AllocationCommands add(AllocationCommand... commands)
commands - Array of commands to add to this instanceAllocationCommands with the given commands addedpublic java.util.List<AllocationCommand> commands()
List of commandspublic RoutingExplanations execute(RoutingAllocation allocation, boolean explain)
RoutingAllocationallocation - RoutingAllocation to apply this command toElasticsearchException - if something happens during executionpublic static AllocationCommands readFrom(StreamInput in) throws java.io.IOException
AllocationCommands from a StreamInputin - StreamInput to read fromAllocationCommands readjava.io.IOException - if something happens during readpublic static void writeTo(AllocationCommands commands, StreamOutput out) throws java.io.IOException
AllocationCommands to a StreamOutputcommands - Commands to writeout - StreamOutput to write the commands tojava.io.IOException - if something happens during writepublic static AllocationCommands fromXContent(XContentParser parser) throws java.io.IOException
AllocationCommands from a XContentParser
{
"commands" : [
{"allocate" : {"index" : "test", "shard" : 0, "node" : "test"}}
]
}
parser - XContentParser to read the commands fromAllocationCommands readjava.io.IOException - if something bad happens while reading the streampublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent in interface ToXContentjava.io.IOExceptionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object