public class AllocationCommands extends Object
AllocationCommand
composite managing several
AllocationCommand
implementationsConstructor and Description |
---|
AllocationCommands(AllocationCommand... commands)
Creates a new set of
AllocationCommands |
public AllocationCommands(AllocationCommand... commands)
AllocationCommands
commands
- AllocationCommand
s that are wrapped by this instancepublic static void registerFactory(String type, AllocationCommand.Factory factory)
@Nullable public static <T extends AllocationCommand> AllocationCommand.Factory<T> lookupFactory(String name)
public static <T extends AllocationCommand> AllocationCommand.Factory<T> lookupFactorySafe(String name)
public AllocationCommands add(AllocationCommand... commands)
commands
- Array of commands to add to this instanceAllocationCommands
with the given commands addedpublic List<AllocationCommand> commands()
List
of commandspublic RoutingExplanations execute(RoutingAllocation allocation, boolean explain)
RoutingAllocation
allocation
- RoutingAllocation
to apply this command toElasticsearchException
- if something happens during executionpublic static AllocationCommands readFrom(StreamInput in) throws IOException
AllocationCommands
from a StreamInput
in
- StreamInput
to read fromAllocationCommands
readIOException
- if something happens during readpublic static void writeTo(AllocationCommands commands, StreamOutput out) throws IOException
AllocationCommands
to a StreamOutput
commands
- Commands to writeout
- StreamOutput
to write the commands toIOException
- if something happens during writepublic static AllocationCommands fromXContent(XContentParser parser) throws IOException
AllocationCommands
from a XContentParser
{ "commands" : [ {"allocate" : {"index" : "test", "shard" : 0, "node" : "test"}} ] }
parser
- XContentParser
to read the commands fromAllocationCommands
readIOException
- if something bad happens while reading the streampublic static void toXContent(AllocationCommands commands, XContentBuilder builder, ToXContent.Params params) throws IOException
AllocationCommands
to a XContentBuilder
commands
- AllocationCommands
to writebuilder
- XContentBuilder
to useparams
- Parameters to use for buildingIOException
- if something bad happens while building the contentCopyright © 2009–2016. All rights reserved.