Package org.elasticsearch

Examples of org.elasticsearch.ElasticSearchIllegalStateException


        this.node = node;
        disabled = componentSettings.getAsBoolean("disabled", false);
    }

    @Override protected void doExecute(NodesRestartRequest nodesRestartRequest, ActionListener<NodesRestartResponse> listener) {
        listener.onFailure(new ElasticSearchIllegalStateException("restart is disabled (for now) ...."));
    }
View Full Code Here


        return new NodesRestartResponse.NodeRestartResponse();
    }

    @Override protected NodesRestartResponse.NodeRestartResponse nodeOperation(NodeRestartRequest request) throws ElasticSearchException {
        if (disabled) {
            throw new ElasticSearchIllegalStateException("Restart is disabled");
        }
        if (!restartRequested.compareAndSet(false, true)) {
            return new NodesRestartResponse.NodeRestartResponse(clusterService.state().nodes().localNode());
        }
        logger.info("Restarting in [{}]", request.delay);
View Full Code Here

            return ThreadPool.Names.SAME;
        }

        @Override public void messageReceived(final NodeShutdownRequest request, TransportChannel channel) throws Exception {
            if (disabled) {
                throw new ElasticSearchIllegalStateException("Shutdown is disabled");
            }
            logger.info("shutting down in [{}]", delay);
            Thread t = new Thread(new Runnable() {
                @Override public void run() {
                    try {
View Full Code Here

        } else if (searchType == SearchType.QUERY_AND_FETCH || searchType == SearchType.DFS_QUERY_AND_FETCH) {
            return buildScrollId(ParsedScrollId.QUERY_AND_FETCH_TYPE, searchPhaseResults, attributes);
        } else if (searchType == SearchType.SCAN) {
            return buildScrollId(ParsedScrollId.SCAN, searchPhaseResults, attributes);
        } else {
            throw new ElasticSearchIllegalStateException();
        }
    }
View Full Code Here

        return nodeFile != null && lock != null;
    }

    public File nodeDataLocation() {
        if (nodeFile == null || lock == null) {
            throw new ElasticSearchIllegalStateException("node is not configured to store local location");
        }
        return nodeFile;
    }
View Full Code Here

            comparators = new FieldComparator[fields.length];
            for (int fieldIDX = 0; fieldIDX < fields.length; fieldIDX++) {
                comparators[fieldIDX] = fields[fieldIDX].getComparator(1, fieldIDX);
            }
        } catch (IOException e) {
            throw new ElasticSearchIllegalStateException("failed to get comparator", e);
        }
    }
View Full Code Here

        for (ShardIterator shardIt : group) {
            if (shardIt.shardId().id() == request.shardId()) {
                return shardIt;
            }
        }
        throw new ElasticSearchIllegalStateException("No shards iterator found for shard [" + request.shardId() + "]");
    }
View Full Code Here

        return clusterName.value() + "/" + localNode.id();
    }

    @Override public void publish(ClusterState clusterState) {
        if (!master) {
            throw new ElasticSearchIllegalStateException("Shouldn't publish state when not master");
        }
        ClusterGroup clusterGroup = clusterGroups.get(clusterName);
        if (clusterGroup == null) {
            // nothing to publish to
            return;
        }
        try {
            // we do the marshaling intentionally, to check it works well...
            final byte[] clusterStateBytes = Builder.toBytes(clusterState);
            for (LocalDiscovery discovery : clusterGroup.members()) {
                if (discovery.master) {
                    continue;
                }
                final ClusterState nodeSpecificClusterState = ClusterState.Builder.fromBytes(clusterStateBytes, discovery.localNode);
                // ignore cluster state messages that do not include "me", not in the game yet...
                if (nodeSpecificClusterState.nodes().localNode() != null) {
                    discovery.clusterService.submitStateUpdateTask("local-disco-receive(from master)", new ProcessedClusterStateUpdateTask() {
                        @Override public ClusterState execute(ClusterState currentState) {
                            ClusterState.Builder builder = ClusterState.builder().state(nodeSpecificClusterState);
                            // if the routing table did not change, use the original one
                            if (nodeSpecificClusterState.routingTable().version() == currentState.routingTable().version()) {
                                builder.routingTable(currentState.routingTable());
                            }
                            if (nodeSpecificClusterState.metaData().version() == currentState.metaData().version()) {
                                builder.metaData(currentState.metaData());
                            }

                            return builder.build();
                        }

                        @Override public void clusterStateProcessed(ClusterState clusterState) {
                            sendInitialStateEventIfNeeded();
                        }
                    });
                }
            }
        } catch (Exception e) {
            // failure to marshal or un-marshal
            throw new ElasticSearchIllegalStateException("Cluster state failed to serialize", e);
        }
    }
View Full Code Here

        this.reconnectInterval = componentSettings.getAsTime("reconnect_interval", TimeValue.timeValueSeconds(10));
    }

    public void addInitialStateBlock(ClusterBlock block) throws ElasticSearchIllegalStateException {
        if (lifecycle.started()) {
            throw new ElasticSearchIllegalStateException("can't set initial block when started");
        }
        initialBlocks.addGlobalBlock(block);
    }
View Full Code Here

        connectToNode(node, false);
    }

    public void connectToNode(DiscoveryNode node, boolean light) {
        if (!lifecycle.started()) {
            throw new ElasticSearchIllegalStateException("Can't add nodes to a stopped transport");
        }
        if (node == null) {
            throw new ConnectTransportException(null, "Can't connect to a null node");
        }
        try {
View Full Code Here

TOP

Related Classes of org.elasticsearch.ElasticSearchIllegalStateException

Copyright © 2018 www.massapicom. 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.