Package org.elasticsearch.cluster.routing

Examples of org.elasticsearch.cluster.routing.RoutingNode.node()


            ObjectIntOpenHashMap<String> shardPerAttribute = new ObjectIntOpenHashMap<>();
            for (MutableShardRouting assignedShard : allocation.routingNodes().assignedShards(shardRouting)) {
                // if the shard is relocating, then make sure we count it as part of the node it is relocating to
                if (assignedShard.relocating()) {
                    RoutingNode relocationNode = allocation.routingNodes().node(assignedShard.relocatingNodeId());
                    shardPerAttribute.addTo(relocationNode.node().attributes().get(awarenessAttribute), 1);
                } else if (assignedShard.started()) {
                    RoutingNode routingNode = allocation.routingNodes().node(assignedShard.currentNodeId());
                    shardPerAttribute.addTo(routingNode.node().attributes().get(awarenessAttribute), 1);
                }
            }
View Full Code Here


                if (assignedShard.relocating()) {
                    RoutingNode relocationNode = allocation.routingNodes().node(assignedShard.relocatingNodeId());
                    shardPerAttribute.addTo(relocationNode.node().attributes().get(awarenessAttribute), 1);
                } else if (assignedShard.started()) {
                    RoutingNode routingNode = allocation.routingNodes().node(assignedShard.currentNodeId());
                    shardPerAttribute.addTo(routingNode.node().attributes().get(awarenessAttribute), 1);
                }
            }

            if (moveToNode) {
                if (shardRouting.assignedToNode()) {
View Full Code Here

    }

    private Decision isVersionCompatible(final RoutingNodes routingNodes, final String sourceNodeId, final RoutingNode target, RoutingAllocation allocation) {
        final RoutingNode source = routingNodes.node(sourceNodeId);
        if (target.node().version().onOrAfter(source.node().version())) {
            /* we can allocate if we can recover from a node that is younger or on the same version
             * if the primary is already running on a newer version that won't work due to possible
             * differences in the lucene index format etc.*/
            return allocation.decision(Decision.YES, NAME, "target node version [%s] is same or newer than source node version [%s]",
                    target.node().version(), source.node().version());
View Full Code Here

        if (target.node().version().onOrAfter(source.node().version())) {
            /* we can allocate if we can recover from a node that is younger or on the same version
             * if the primary is already running on a newer version that won't work due to possible
             * differences in the lucene index format etc.*/
            return allocation.decision(Decision.YES, NAME, "target node version [%s] is same or newer than source node version [%s]",
                    target.node().version(), source.node().version());
        } else {
            return allocation.decision(Decision.NO, NAME, "target node version [%s] is older than source node version [%s]",
                    target.node().version(), source.node().version());
        }
    }
View Full Code Here

             * differences in the lucene index format etc.*/
            return allocation.decision(Decision.YES, NAME, "target node version [%s] is same or newer than source node version [%s]",
                    target.node().version(), source.node().version());
        } else {
            return allocation.decision(Decision.NO, NAME, "target node version [%s] is older than source node version [%s]",
                    target.node().version(), source.node().version());
        }
    }
}
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.