當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。