当前位置: 首页>>代码示例>>Java>>正文


Java DeleteRepositoryResponse类代码示例

本文整理汇总了Java中org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse的典型用法代码示例。如果您正苦于以下问题:Java DeleteRepositoryResponse类的具体用法?Java DeleteRepositoryResponse怎么用?Java DeleteRepositoryResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DeleteRepositoryResponse类属于org.elasticsearch.action.admin.cluster.repositories.delete包,在下文中一共展示了DeleteRepositoryResponse类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse; //导入依赖的package包/类
public ListenableFuture<Long> execute(DropRepositoryAnalyzedStatement analyzedStatement) {
    final SettableFuture<Long> future = SettableFuture.create();
    final String repoName = analyzedStatement.repositoryName();
    transportActionProvider.transportDeleteRepositoryAction().execute(
            new DeleteRepositoryRequest(repoName),
            new ActionListener<DeleteRepositoryResponse>() {
                @Override
                public void onResponse(DeleteRepositoryResponse deleteRepositoryResponse) {
                    if (!deleteRepositoryResponse.isAcknowledged()) {
                        LOGGER.info("delete repository '{}' not acknowledged", repoName);
                    }
                    future.set(1L);
                }

                @Override
                public void onFailure(Throwable e) {
                    future.setException(e);
                }
            }
    );
    return future;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:23,代码来源:RepositoryService.java

示例2: testRepositoryAckTimeout

import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse; //导入依赖的package包/类
public void testRepositoryAckTimeout() throws Exception {
    logger.info("-->  creating repository test-repo-1 with 0s timeout - shouldn't ack");
    PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo-1")
            .setType("fs").setSettings(Settings.builder()
                            .put("location", randomRepoPath())
                            .put("compress", randomBoolean())
                            .put("chunk_size", randomIntBetween(5, 100), ByteSizeUnit.BYTES)
            )
            .setTimeout("0s").get();
    assertThat(putRepositoryResponse.isAcknowledged(), equalTo(false));

    logger.info("-->  creating repository test-repo-2 with standard timeout - should ack");
    putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo-2")
            .setType("fs").setSettings(Settings.builder()
                            .put("location", randomRepoPath())
                            .put("compress", randomBoolean())
                            .put("chunk_size", randomIntBetween(5, 100), ByteSizeUnit.BYTES)
            ).get();
    assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));

    logger.info("-->  deleting repository test-repo-2 with 0s timeout - shouldn't ack");
    DeleteRepositoryResponse deleteRepositoryResponse = client().admin().cluster().prepareDeleteRepository("test-repo-2")
            .setTimeout("0s").get();
    assertThat(deleteRepositoryResponse.isAcknowledged(), equalTo(false));

    logger.info("-->  deleting repository test-repo-1 with standard timeout - should ack");
    deleteRepositoryResponse = client().admin().cluster().prepareDeleteRepository("test-repo-1").get();
    assertThat(deleteRepositoryResponse.isAcknowledged(), equalTo(true));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:30,代码来源:RepositoriesIT.java

示例3: handleRequest

import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse; //导入依赖的package包/类
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
    DeleteRepositoryRequest deleteRepositoryRequest = deleteRepositoryRequest(request.param("repository"));
    deleteRepositoryRequest.masterNodeTimeout(request.paramAsTime("master_timeout", deleteRepositoryRequest.masterNodeTimeout()));
    deleteRepositoryRequest.timeout(request.paramAsTime("timeout", deleteRepositoryRequest.timeout()));
    deleteRepositoryRequest.masterNodeTimeout(request.paramAsTime("master_timeout", deleteRepositoryRequest.masterNodeTimeout()));
    client.admin().cluster().deleteRepository(deleteRepositoryRequest, new AcknowledgedRestListener<DeleteRepositoryResponse>(channel));
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:RestDeleteRepositoryAction.java

示例4: deleteRepository

import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse; //导入依赖的package包/类
@Override
public ActionFuture<DeleteRepositoryResponse> deleteRepository(DeleteRepositoryRequest request) {
    return execute(DeleteRepositoryAction.INSTANCE, request);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AbstractClient.java

示例5: deleteRepository

import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse; //导入依赖的package包/类
/**
 * Unregisters a repository.
 */
ActionFuture<DeleteRepositoryResponse> deleteRepository(DeleteRepositoryRequest request);
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:ClusterAdminClient.java


注:本文中的org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。