Examples of DeleteIndexRequest


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

                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

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

        }

    }

    private void deleteESIndex(String indexOrAlias) {
        deleteIndexAction.execute(new DeleteIndexRequest(indexOrAlias), new ActionListener<DeleteIndexResponse>() {
            @Override
            public void onResponse(DeleteIndexResponse response) {
                if (!response.isAcknowledged()) {
                    warnNotAcknowledged(String.format(Locale.ENGLISH, "dropping table '%s'", tableInfo.ident().fqn()));
                }
View Full Code Here

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

     * @param index The index to delete
     * @return The delete index request
     * @see org.elasticsearch.client.IndicesAdminClient#delete(org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest)
     */
    public static DeleteIndexRequest deleteIndexRequest(String index) {
        return new DeleteIndexRequest(index);
    }
View Full Code Here

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

        controller.registerHandler(RestRequest.Method.DELETE, "/{index}", this);
    }

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(Strings.splitStringByCommaToArray(request.param("index")));
        deleteIndexRequest.listenerThreaded(false);
        deleteIndexRequest.timeout(request.paramAsTime("timeout", deleteIndexRequest.timeout()));
        deleteIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", deleteIndexRequest.masterNodeTimeout()));
        deleteIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, deleteIndexRequest.indicesOptions()));
        client.admin().indices().delete(deleteIndexRequest, new AcknowledgedRestListener<DeleteIndexResponse>(channel));
    }
View Full Code Here

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

    @Test
    public void testDeleteIndex() {
        interceptTransportActions(DeleteIndexAction.NAME);

        String[] randomIndicesOrAliases = randomUniqueIndicesOrAliases();
        DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(randomIndicesOrAliases);
        assertAcked(internalCluster().clientNodeClient().admin().indices().delete(deleteIndexRequest).actionGet());

        clearInterceptedActions();
        assertSameIndices(deleteIndexRequest, DeleteIndexAction.NAME);
    }
View Full Code Here

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

    @AfterMethod
    public void deleteIndices() {
        try {
            // clear test index
            client("1").admin().indices()
                    .delete(new DeleteIndexRequest().indices(INDEX))
                    .actionGet();
        } catch (IndexMissingException e) {
            // ignore
        }
        closeNode("1");
View Full Code Here

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

   * @see ch.entwine.weblounge.search.impl.SearchIndex#clear()
   */
  @Override
  public void clear() throws IOException {
    try {
      DeleteIndexResponse delete = nodeClient.admin().indices().delete(new DeleteIndexRequest()).actionGet();
      if (!delete.acknowledged())
        logger.error("Indices could not be deleted");
    } catch (Throwable t) {
      throw new IOException("Cannot clear index", t);
    }
View Full Code Here

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

    @Override
    public <T> boolean deleteIndex(Class<T> clazz){
        String indexName = getPersistentEntityFor(clazz).getIndexName();
        if(indexExists(indexName)){
            return client.admin().indices().delete(new DeleteIndexRequest(indexName)).actionGet().acknowledged();
        }
        return false;
    }
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.