Examples of IndicesExistsRequest


Examples of com.dotcms.repackage.org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest

            if(isDotCMSIndexName(idx))
                indexNames.add(idx);

        List<String> existingIndex=new ArrayList<String>();
        for(String idx : indexNames)
            if(client.admin().indices().exists(new IndicesExistsRequest(idx)).actionGet().isExists())
                existingIndex.add(idx);
        indexNames=existingIndex;

        List<String> indexes = new ArrayList<String>();
        indexes.addAll(indexNames);
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.exists.IndicesExistsRequest

     * @param indices The indices to check if they exists or not.
     * @return The indices exists request
     * @see org.elasticsearch.client.IndicesAdminClient#exists(org.elasticsearch.action.admin.indices.exists.IndicesExistsRequest)
     */
    public static IndicesExistsRequest indicesExistsRequest(String... indices) {
        return new IndicesExistsRequest(indices);
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.exists.IndicesExistsRequest

        this.settingsFilter = settingsFilter;
    }

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        IndicesExistsRequest indicesExistsRequest = new IndicesExistsRequest(splitIndices(request.param("index")));
        // we just send back a response, no need to fork a listener
        indicesExistsRequest.listenerThreaded(false);
        client.admin().indices().exists(indicesExistsRequest, new ActionListener<IndicesExistsResponse>() {
            @Override public void onResponse(IndicesExistsResponse response) {
                try {
                    if (response.exists()) {
                        channel.sendResponse(new StringRestResponse(OK));
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.exists.IndicesExistsRequest

* @author kimchy (shay.banon)
*/
public class IndicesExistsRequestBuilder extends BaseIndicesRequestBuilder<IndicesExistsRequest, IndicesExistsResponse> {

    public IndicesExistsRequestBuilder(IndicesAdminClient indicesClient, String... indices) {
        super(indicesClient, new IndicesExistsRequest(indices));
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.exists.IndicesExistsRequest

import org.elasticsearch.client.IndicesAdminClient;

public class IndexExistsUtils {

  public static boolean exists(IndicesAdminClient client, String indexName) {
    return client.exists(new IndicesExistsRequest(indexName)).actionGet().isExists();
  }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest

    public String allIndicesAlias() {
        return configuration.getElasticSearchIndexPrefix() + "_*";
    }

    public boolean exists(String index) {
        ActionFuture<IndicesExistsResponse> existsFuture = c.admin().indices().exists(new IndicesExistsRequest(index));
        return existsFuture.actionGet().isExists();
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest

            String host = locationSocket[0];
            String port = locationSocket.length > 1 ? locationSocket[1] : "9300";
            client.addTransportAddress(new InetSocketTransportAddress(host, Integer.parseInt(port)));
        }
        LOGGER.info("index %s exists?", indexName);
        IndicesExistsRequest existsRequest = client.admin().indices().prepareExists(indexName).request();
        if (client.admin().indices().exists(existsRequest).actionGet().isExists()) {
            LOGGER.info("index %s exists... deleting!", indexName);
            DeleteIndexResponse response = client.admin().indices().delete(new DeleteIndexRequest(indexName)).actionGet();
            if (!response.isAcknowledged()) {
                LOGGER.error("Failed to delete elastic search index named %s", indexName);
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest

*/
@SuppressWarnings("unused")
public class IndicesExistsRequestBuilder<JsonInput, JsonOutput> extends AbstractRequestBuilderJsonOutput<IndicesExistsRequest, IndicesExistsResponse, JsonInput, JsonOutput> {

    public IndicesExistsRequestBuilder(Client client, JsonToString<JsonInput> jsonToString, StringToJson<JsonOutput> stringToJson) {
        super(client, new IndicesExistsRequest(), jsonToString, stringToJson);
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest

                channel.sendResponse(new StringRestResponse(RestStatus.EXPECTATION_FAILED, "parameter searchIndex missing"));
                return;
            }
            int newShards = request.paramAsInt("newIndexShards", -1);
            try {
                if(client.admin().indices().exists(new IndicesExistsRequest(newIndexName)).actionGet().isExists()) {
                    logger.info("target index already exists, skip creation: " + newIndexName);
                }
                else {
                    createIdenticalIndex(searchIndexName, type, newIndexName, newShards);
                }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest

                aReq.addAlias(index, oldAliasCursor.value);
            }
        }
        boolean aliasIncludeIndex = request.paramAsBoolean("addOldIndexAsAlias", false);
        if (aliasIncludeIndex) {
            if (client.admin().indices().exists(new IndicesExistsRequest(searchIndexName)).actionGet().isExists()) {
                logger.warn("Cannot add old index name (" + searchIndexName + ") as alias to index "
                        + index + " - as old index still exists");
            }
            else {
                aReq.addAlias(index, searchIndexName);
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.