Examples of currentNodeId()


Examples of org.elasticsearch.cluster.routing.ShardRouting.currentNodeId()

                    } catch (Exception e) {
                        onFailure(shardRouting, e);
                    }
                }
            } else {
                DiscoveryNode node = nodes.get(shardRouting.currentNodeId());
                transportService.sendRequest(node, transportShardAction, new ShardSingleOperationRequest(request, shardRouting.id()), new BaseTransportResponseHandler<Response>() {

                    @Override public Response newInstance() {
                        return newResponse();
                    }
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardRouting.currentNodeId()

        ShardRouting failedShard = allocation.failedShard();

        boolean shardDirty = false;
        boolean inRelocation = failedShard.relocatingNodeId() != null;
        if (inRelocation) {
            RoutingNode routingNode = allocation.routingNodes().nodesToShards().get(failedShard.currentNodeId());
            if (routingNode != null) {
                Iterator<MutableShardRouting> shards = routingNode.iterator();
                while (shards.hasNext()) {
                    MutableShardRouting shard = shards.next();
                    if (shard.shardId().equals(failedShard.shardId())) {
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardRouting.currentNodeId()

                    }
                }
            }
        }

        String nodeId = inRelocation ? failedShard.relocatingNodeId() : failedShard.currentNodeId();
        RoutingNode currentRoutingNode = allocation.routingNodes().nodesToShards().get(nodeId);

        if (currentRoutingNode == null) {
            // already failed (might be called several times for the same shard)
            return false;
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardRouting.currentNodeId()

        if (!shardDirty) {
            return false;
        }

        // make sure we ignore this shard on the relevant node
        allocation.addIgnoreShardForNode(failedShard.shardId(), failedShard.currentNodeId());

        // if in relocation no need to find a new target, just cancel the relocation.
        if (inRelocation) {
            return true; // lets true, so we reroute in this case
        }
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardRouting.currentNodeId()

                        // find the one that maps to us, if its already started, no need to do anything...
                        // the shard might already be started since the nodes that is starting the shards might get cluster events
                        // with the shard still initializing, and it will try and start it again (until the verification comes)
                        IndexShardRoutingTable indexShardRoutingTable = indexRoutingTable.shard(shardRouting.id());
                        for (ShardRouting entry : indexShardRoutingTable) {
                            if (shardRouting.currentNodeId().equals(entry.currentNodeId())) {
                                // we found the same shard that exists on the same node id
                                if (entry.started()) {
                                    // already started, do nothing here...
                                    shards.remove(i);
                                }
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardRouting.currentNodeId()

            if (request.preferLocalShard()) {
                boolean foundLocal = false;
                ShardRouting shardX;
                while ((shardX = shardsIt.nextOrNull()) != null) {
                    final ShardRouting shard = shardX;
                    if (shard.currentNodeId().equals(nodes.localNodeId())) {
                        foundLocal = true;
                        if (request.operationThreaded()) {
                            request.beforeLocalFork();
                            threadPool.executor(executor()).execute(new Runnable() {
                                @Override public void run() {
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardRouting.currentNodeId()

                        logger.debug("failed to execute [" + request + "]", failure);
                    }
                }
                listener.onFailure(failure);
            } else {
                if (shard.currentNodeId().equals(nodes.localNodeId())) {
                    // we don't prefer local shard, so try and do it here
                    if (!request.preferLocalShard()) {
                        if (request.operationThreaded()) {
                            request.beforeLocalFork();
                            threadPool.executor(executor).execute(new Runnable() {
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardRouting.currentNodeId()

                                onFailure(shard, e);
                            }
                        }
                    }
                } else {
                    DiscoveryNode node = nodes.get(shard.currentNodeId());
                    transportService.sendRequest(node, transportShardAction, new ShardSingleOperationRequest(request, shard.id()), new BaseTransportResponseHandler<Response>() {
                        @Override public Response newInstance() {
                            return newResponse();
                        }
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardRouting.currentNodeId()

            // count the local operations, and perform the non local ones
            int localOperations = 0;
            for (final ShardIterator shardIt : shardsIts) {
                final ShardRouting shard = shardIt.firstOrNull();
                if (shard != null) {
                    if (shard.currentNodeId().equals(nodes.localNodeId())) {
                        localOperations++;
                    } else {
                        // do the remote operation here, the localAsync flag is not relevant
                        performOperation(shardIt, true);
                    }
View Full Code Here

Examples of org.elasticsearch.cluster.routing.ShardRouting.currentNodeId()

                    threadPool.executor(executor).execute(new Runnable() {
                        @Override public void run() {
                            for (final ShardIterator shardIt : shardsIts) {
                                final ShardRouting shard = shardIt.firstOrNull();
                                if (shard != null) {
                                    if (shard.currentNodeId().equals(nodes.localNodeId())) {
                                        performOperation(shardIt, false);
                                    }
                                }
                            }
                        }
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.