Package org.elasticsearch

Examples of org.elasticsearch.ElasticSearchIllegalStateException


            throw new QueryParsingException(parseContext.index(), "[custom_score] requires 'script' field");
        }

        SearchContext context = SearchContext.current();
        if (context == null) {
            throw new ElasticSearchIllegalStateException("No search context on going...");
        }
        SearchScript searchScript = context.scriptService().search(context.lookup(), scriptLang, script, vars);
        FunctionScoreQuery functionScoreQuery = new FunctionScoreQuery(query, new ScriptScoreFunction(searchScript));
        functionScoreQuery.setBoost(boost);
        return functionScoreQuery;
View Full Code Here


         * {@link ElasticSearchIllegalStateException} if {@link #newTranslogCreated()} is <tt>true</tt>, so
         * always check that first.
         */
        public boolean sameTranslogNewOperations() {
            if (newTranslogCreated()) {
                throw new ElasticSearchIllegalStateException("Should not be called when there is a new translog");
            }
            return translogSnapshot.length() > lastTranslogLength;
        }
View Full Code Here

        return shardInjector;
    }

    @Override public synchronized IndexShard createShard(int sShardId) throws ElasticSearchException {
        if (closed) {
            throw new ElasticSearchIllegalStateException("Can't create shard [" + index.name() + "][" + sShardId + "], closed");
        }
        ShardId shardId = new ShardId(index, sShardId);
        if (shardsInjectors.containsKey(shardId.id())) {
            throw new IndexShardAlreadyExistsException(shardId + " already exists");
        }
View Full Code Here

    @Override public void deleteUnallocated(ShardId shardId) throws IOException {
        if (location == null) {
            return;
        }
        if (indexService.hasShard(shardId.id())) {
            throw new ElasticSearchIllegalStateException(shardId + " allocated, can't be deleted");
        }
        FileSystemUtils.deleteRecursively(shardLocation(shardId));
    }
View Full Code Here

            } else if (scoreType == ScoreType.AVG) {
                return docs[index].sumScores / docs[index].count;
            } else if (scoreType == ScoreType.SUM) {
                return docs[index].sumScores;
            }
            throw new ElasticSearchIllegalStateException("No support for score type [" + scoreType + "]");
        }
View Full Code Here

            case DELETE_BY_QUERY:
                Translog.DeleteByQuery deleteByQuery = (Translog.DeleteByQuery) operation;
                innerDeleteByQuery(deleteByQuery.source(), deleteByQuery.filteringAliases(), deleteByQuery.types());
                break;
            default:
                throw new ElasticSearchIllegalStateException("No operation defined for [" + operation + "]");
        }
    }
View Full Code Here

                mpq.add(multiTerms.toArray(new Term[multiTerms.size()]));
            }
            return wrapSmartNameQuery(mpq, smartNameFieldMappers, parseContext);
        }

        throw new ElasticSearchIllegalStateException("No type found for [" + type + "]");
    }
View Full Code Here

    @Override public Tokenizer create(Reader reader) {
        try {
            return new PatternTokenizer(reader, pattern, group);
        } catch (IOException e) {
            throw new ElasticSearchIllegalStateException("failed to create pattern tokenizer", e);
        }
    }
View Full Code Here

        NativeFSLockFactory lockFactory = new NativeFSLockFactory(fsBlobContainer.filePath());

        Lock lock = lockFactory.makeLock("snapshot.lock");
        boolean obtained = lock.obtain();
        if (!obtained) {
            throw new ElasticSearchIllegalStateException("failed to obtain snapshot lock [" + lock + "]");
        }
        return new FsSnapshotLock(lock);
    }
View Full Code Here

        }
    }

    @Override protected NodesShutdownResponse masterOperation(final NodesShutdownRequest request, final ClusterState state) throws ElasticSearchException {
        if (disabled) {
            throw new ElasticSearchIllegalStateException("Shutdown is disabled");
        }
        Set<DiscoveryNode> nodes = Sets.newHashSet();
        if (state.nodes().isAllNodes(request.nodesIds)) {
            logger.info("[cluster_shutdown]: requested, shutting down in [{}]", request.delay);
            nodes.addAll(state.nodes().dataNodes().values());
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.