Examples of localNodeMaster()


Examples of org.elasticsearch.cluster.node.DiscoveryNodes.localNodeMaster()

            // this can happen if the master got "kill -9" and then another node started using the same port
            if (!request.masterNodeId.equals(nodes.localNodeId())) {
                throw new ElasticSearchIllegalStateException("Got ping as master with id [" + request.masterNodeId + "], but not master and no id");
            }
            // if we are no longer master, fail...
            if (!nodes.localNodeMaster()) {
                throw new NoLongerMasterException();
            }
            // send a response, and note if we are connected to the master or not
            channel.sendResponse(new MasterPingResponseResponse(nodes.nodeExists(request.nodeId)));
        }
View Full Code Here

Examples of org.elasticsearch.cluster.node.DiscoveryNodes.localNodeMaster()

        transportService.registerHandler(NodeMappingRefreshTransportHandler.ACTION, new NodeMappingRefreshTransportHandler());
    }

    public void nodeMappingRefresh(final NodeMappingRefreshRequest request) throws ElasticSearchException {
        DiscoveryNodes nodes = clusterService.state().nodes();
        if (nodes.localNodeMaster()) {
            threadPool.cached().execute(new Runnable() {
                @Override public void run() {
                    innerMappingRefresh(request);
                }
            });
View Full Code Here

Examples of org.elasticsearch.cluster.node.DiscoveryNodes.localNodeMaster()

        listeners.remove(listener);
    }

    public void nodeMappingCreated(final NodeMappingCreatedResponse response) throws ElasticSearchException {
        DiscoveryNodes nodes = clusterService.state().nodes();
        if (nodes.localNodeMaster()) {
            threadPool.cached().execute(new Runnable() {
                @Override public void run() {
                    innerNodeIndexCreated(response);
                }
            });
View Full Code Here

Examples of org.elasticsearch.cluster.node.DiscoveryNodes.localNodeMaster()

        listeners.remove(listener);
    }

    public void nodeAliasesUpdated(final NodeAliasesUpdatedResponse response) throws ElasticSearchException {
        DiscoveryNodes nodes = clusterService.state().nodes();
        if (nodes.localNodeMaster()) {
            threadPool.cached().execute(new Runnable() {
                @Override public void run() {
                    innerNodeAliasesUpdated(response);
                }
            });
View Full Code Here

Examples of org.elasticsearch.cluster.node.DiscoveryNodes.localNodeMaster()

        listeners.remove(listener);
    }

    public void nodeIndexCreated(final String index, final String nodeId) throws ElasticSearchException {
        DiscoveryNodes nodes = clusterService.state().nodes();
        if (nodes.localNodeMaster()) {
            threadPool.cached().execute(new Runnable() {
                @Override public void run() {
                    innerNodeIndexCreated(index, nodeId);
                }
            });
View Full Code Here

Examples of org.elasticsearch.cluster.node.DiscoveryNodes.localNodeMaster()

        listeners.remove(listener);
    }

    public void nodeIndexDeleted(final String index, final String nodeId) throws ElasticSearchException {
        DiscoveryNodes nodes = clusterService.state().nodes();
        if (nodes.localNodeMaster()) {
            threadPool.cached().execute(new Runnable() {
                @Override public void run() {
                    innerNodeIndexDeleted(index, nodeId);
                }
            });
View Full Code Here

Examples of org.elasticsearch.cluster.node.DiscoveryNodes.localNodeMaster()

    }

    public void shardFailed(final ShardRouting shardRouting, final String reason) throws ElasticSearchException {
        logger.warn("sending failed shard for {}, reason [{}]", shardRouting, reason);
        DiscoveryNodes nodes = clusterService.state().nodes();
        if (nodes.localNodeMaster()) {
            innerShardFailed(shardRouting, reason);
        } else {
            transportService.sendRequest(clusterService.state().nodes().masterNode(),
                    ShardFailedTransportHandler.ACTION, new ShardRoutingEntry(shardRouting, reason), new VoidTransportResponseHandler(ThreadPool.Names.SAME) {
                @Override public void handleException(TransportException exp) {
View Full Code Here

Examples of org.elasticsearch.cluster.node.DiscoveryNodes.localNodeMaster()

    public void shardStarted(final ShardRouting shardRouting, final String reason) throws ElasticSearchException {
        if (logger.isDebugEnabled()) {
            logger.debug("sending shard started for {}, reason [{}]", shardRouting, reason);
        }
        DiscoveryNodes nodes = clusterService.state().nodes();
        if (nodes.localNodeMaster()) {
            innerShardStarted(shardRouting, reason);
        } else {
            transportService.sendRequest(clusterService.state().nodes().masterNode(),
                    ShardStartedTransportHandler.ACTION, new ShardRoutingEntry(shardRouting, reason), new VoidTransportResponseHandler(ThreadPool.Names.SAME) {
                @Override public void handleException(TransportException exp) {
View Full Code Here

Examples of org.elasticsearch.cluster.node.DiscoveryNodes.localNodeMaster()

    }

    private void innerExecute(final Request request, final ActionListener<Response> listener, final boolean retrying) {
        final ClusterState clusterState = clusterService.state();
        final DiscoveryNodes nodes = clusterState.nodes();
        if (nodes.localNodeMaster() || localExecute(request)) {
            // check for block, if blocked, retry, else, execute locally
            final ClusterBlockException blockException = checkBlock(request, clusterState);
            if (blockException != null) {
                if (!blockException.retryable()) {
                    listener.onFailure(blockException);
View Full Code Here

Examples of org.elasticsearch.cluster.node.DiscoveryNodes.localNodeMaster()

        transportService.registerHandler(ACTION_NAME, new NodeMappingRefreshTransportHandler());
    }

    public void nodeMappingRefresh(final ClusterState state, final NodeMappingRefreshRequest request) throws ElasticsearchException {
        DiscoveryNodes nodes = state.nodes();
        if (nodes.localNodeMaster()) {
            innerMappingRefresh(request);
        } else {
            transportService.sendRequest(state.nodes().masterNode(),
                    ACTION_NAME, request, EmptyTransportResponseHandler.INSTANCE_SAME);
        }
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.