Package org.elasticsearch.action.admin.indices.delete

Examples of org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest


    public OptimizeResponse optimize(String indexName, int optimizeToSegmentsAfterUpdate) {
        return client.admin().indices().optimize(new OptimizeRequest(indexName).maxNumSegments(optimizeToSegmentsAfterUpdate)).actionGet();
    }

    public void deleteIndex(String indexName) {
        client.admin().indices().delete(new DeleteIndexRequest(indexName)).actionGet();
    }
View Full Code Here


  @Override
  public boolean deleteIndex(String indexName) {
    Assert.notNull(indexName, "No index defined for delete operation");
    if (indexExists(indexName)) {
      return client.admin().indices().delete(new DeleteIndexRequest(indexName)).actionGet().isAcknowledged();
    }
    return false;
  }
View Full Code Here

        __node.close();
    }

    @Before
    public void setUp() throws IOException {
        client().admin().indices().delete(new DeleteIndexRequest("_all")).actionGet();
        client().admin().indices().create(new CreateIndexRequest(__index)).actionGet();
        client().admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
        final String mapping = XContentFactory.jsonBuilder()
                .startObject()
                .startObject(__type)
View Full Code Here

        __node.close();
    }

    @Before
    public void setUp() throws IOException {
        client().admin().indices().delete(new DeleteIndexRequest("_all")).actionGet();
        client().admin().indices().create(new CreateIndexRequest(__index)).actionGet();
        client().admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
        final String mapping = XContentFactory.jsonBuilder()
                .startObject()
                .startObject(__type1)
View Full Code Here

                    }

                    if (!toDelete.isEmpty()) {
                        logger.info("Deleting indices: {}", toDelete);
                        String[] indices = toDelete.toArray(new String[toDelete.size()]);
                        DeleteIndexRequest req = indicesAdminClient.prepareDelete(indices).request();
                        indicesAdminClient.delete(req).actionGet();
                    }
                }

View Full Code Here

    @Override
    public void clearStorage() throws StorageException {
        try {
            try {
                client.admin().indices()
                        .delete(new DeleteIndexRequest(indexName)).actionGet();
                // We wait for one second to let ES delete the river
                Thread.sleep(1000);
            } catch (IndexMissingException e) {
                // Index does not exist... Fine
            }
View Full Code Here

        return result;
    }

    public ListenableFuture<Void> dropBlobTable(final String tableName) {
        final SettableFuture<Void> result = SettableFuture.create();
        transportDeleteIndexAction.execute(new DeleteIndexRequest(fullIndexName(tableName)), new ActionListener<DeleteIndexResponse>() {
            @Override
            public void onResponse(DeleteIndexResponse deleteIndexResponse) {
                result.set(null);
            }
View Full Code Here

    }

    public ESDeleteIndexTask(TransportDeleteIndexAction transport, ESDeleteIndexNode node) {
        super();
        this.transport = transport;
        this.request = new DeleteIndexRequest(node.index());
        this.request.indicesOptions(IndicesOptions.strictExpandOpen());
        this.listener = new DeleteIndexListener(result, node.isPartition());
    }
View Full Code Here

                && PartitionName.isPartition(
                clusterService.state().metaData().aliases().get(planNode.tableName()).keysIt().next(),
                planNode.tableName())
                ) {
            logger.debug("Deleting orphaned partitions with alias: {}", planNode.tableName());
            deleteIndexAction.execute(new DeleteIndexRequest(planNode.tableName()), new ActionListener<DeleteIndexResponse>() {
                @Override
                public void onResponse(DeleteIndexResponse response) {
                    if (!response.isAcknowledged()) {
                        warnNotAcknowledged("deleting orphaned alias");
                    }
View Full Code Here

                new String[]{partitionWildCard});
        if (orphans.length > 0) {
            if (logger.isDebugEnabled()) {
                logger.debug("Deleting orphaned partitions: {}", Joiner.on(", ").join(orphans));
            }
            deleteIndexAction.execute(new DeleteIndexRequest(orphans), new ActionListener<DeleteIndexResponse>() {
                @Override
                public void onResponse(DeleteIndexResponse response) {
                    if (!response.isAcknowledged()) {
                        warnNotAcknowledged("deleting orphans");
                    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest

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.