Package org.elasticsearch

Examples of org.elasticsearch.ElasticSearchIllegalStateException


                        while ((bytesRead = is.read(buffer)) != -1) {
                            raf.write(buffer, 0, bytesRead);
                            bytesWritten += bytesRead;
                        }
                        if (bytesWritten != sizeInBytes) {
                            listener.onFailure(new ElasticSearchIllegalStateException("[" + blobName + "]: wrote [" + bytesWritten + "], expected to write [" + sizeInBytes + "]"));
                            return;
                        }
                    } finally {
                        try {
                            is.close();
View Full Code Here


            Collections.sort(intfsList, new Comparator<NetworkInterface>() {
                @Override public int compare(NetworkInterface o1, NetworkInterface o2) {
                    try {
                        return ((Integer) getIndexMethod.invoke(o1)).intValue() - ((Integer) getIndexMethod.invoke(o2)).intValue();
                    } catch (Exception e) {
                        throw new ElasticSearchIllegalStateException("failed to fetch index of network interface");
                    }
                }
            });
        } catch (Exception e) {
            // ignore
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

         candidate = analyzeStringForTerm(value.toString(), termHash, indexFieldName, fieldIndexAnalyzer);
         if (candidate != null) {
            return candidate;
         }
      }
      throw new ElasticSearchIllegalStateException(
              "Failed to find hash code " + termHash + " in an array of docId " + docId +
                      ". You can only use stored fields or when you store the original document under _source");
   }
View Full Code Here

        executeIfNeeded();
    }

    private void executeIfNeeded() {
        if (closed) {
            throw new ElasticsearchIllegalStateException("bulk process already closed");
        }
        if (!isOverTheLimit()) {
            return;
        }
        execute(null);
View Full Code Here

        executeIfNeeded(channel);
    }

    private void executeIfNeeded(InteractiveChannel channel) {
        if (closed) {
            throw new ElasticsearchIllegalStateException("bulk process already closed");
        }
        if (!isOverTheLimit()) {
            return;
        }
        execute(channel);
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");
        }
        globalLock.readLock().lock();
        try {
            if (!lifecycle.started()) {
                throw new ElasticsearchIllegalStateException("can't add nodes to a stopped transport");
            }
            NodeChannels nodeChannels = connectedNodes.get(node);
            if (nodeChannels != null) {
                return;
            }
            connectionLock.acquire(node.id());
            try {
                if (!lifecycle.started()) {
                    throw new ElasticsearchIllegalStateException("can't add nodes to a stopped transport");
                }
                try {


                    if (light) {
View Full Code Here

    @Override
    public void publish(ClusterState clusterState, AckListener ackListener) {
        logger.debug("Publishing cluster state");
        if (!singleton.isMaster()) {
            throw new ElasticsearchIllegalStateException("Shouldn't publish state when not master");
        }
        latestDiscoNodes = clusterState.nodes();
        publishClusterState.publish(clusterState, ackListener);
        logger.debug("Cluster state published");
    }
View Full Code Here

    public static byte[] decodeHex(char[] data) throws ElasticsearchIllegalStateException {

        int len = data.length;

        if ((len & 0x01) != 0) {
            throw new ElasticsearchIllegalStateException("Odd number of characters.");
        }

        byte[] out = new byte[len >> 1];

        // two characters form the hex value.
View Full Code Here

    }

    protected static int toDigit(char ch, int index) throws ElasticsearchIllegalStateException {
        int digit = Character.digit(ch, 16);
        if (digit == -1) {
            throw new ElasticsearchIllegalStateException("Illegal hexadecimal character " + ch + " at index " + index);
        }
        return digit;
    }
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.