public class AllocateAllocationCommand extends Object implements AllocationCommand
Modifier and Type | Class and Description |
---|---|
static class |
AllocateAllocationCommand.Factory |
Constructor and Description |
---|
AllocateAllocationCommand(ShardId shardId,
String node,
boolean allowPrimary)
Create a new
AllocateAllocationCommand |
Modifier and Type | Method and Description |
---|---|
boolean |
allowPrimary()
Determine if primary allocation is allowed
|
RerouteExplanation |
execute(RoutingAllocation allocation,
boolean explain)
Executes the command on a
RoutingAllocation setup |
String |
name()
Get the name of the command
|
String |
node()
Get the id of the Node
|
ShardId |
shardId()
Get the shards id
|
public static final String NAME
public AllocateAllocationCommand(ShardId shardId, String node, boolean allowPrimary)
AllocateAllocationCommand
shardId
- ShardId
of the shrad to assignnode
- Node to assign the shard toallowPrimary
- should the node be allow to allocate the shard as primarypublic String name()
AllocationCommand
name
in interface AllocationCommand
public ShardId shardId()
public String node()
public boolean allowPrimary()
true
if primary allocation is allowed. Otherwise false
public RerouteExplanation execute(RoutingAllocation allocation, boolean explain)
AllocationCommand
RoutingAllocation
setupexecute
in interface AllocationCommand
allocation
- RoutingAllocation
to modifyCopyright © 2009–2016. All rights reserved.