Examples of AllocationCommand


Examples of org.elasticsearch.cluster.routing.allocation.command.AllocationCommand

        return this.decisions;
    }

    public static RerouteExplanation readFrom(StreamInput in) throws IOException {
        String commandName = in.readString();
        AllocationCommand command = AllocationCommands.lookupFactorySafe(commandName).readFrom(in);
        Decision decisions = Decision.readFrom(in);
        return new RerouteExplanation(command, decisions);
    }
View Full Code Here

Examples of org.elasticsearch.cluster.routing.allocation.command.AllocationCommand

        logger.info("--> adding node3");
        clusterState = ClusterState.builder(clusterState).nodes(DiscoveryNodes.builder(clusterState.nodes())
                        .put(newNode("node3"))
        ).build();

        AllocationCommand relocate1 = new MoveAllocationCommand(new ShardId("test", 0), "node2", "node3");
        AllocationCommands cmds = new AllocationCommands(relocate1);

        routingTable = strategy.reroute(clusterState, cmds).routingTable();
        clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build();
        logShardStates(clusterState);

        AllocationCommand relocate2 = new MoveAllocationCommand(new ShardId("test2", 0), "node2", "node3");
        cmds = new AllocationCommands(relocate2);

        try {
            // The shard for the "test" index is already being relocated to
            // node3, which will put it over the low watermark when it
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.