本文整理匯總了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;
}
示例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));
}
示例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));
}
示例4: deleteRepository
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse; //導入依賴的package包/類
@Override
public ActionFuture<DeleteRepositoryResponse> deleteRepository(DeleteRepositoryRequest request) {
return execute(DeleteRepositoryAction.INSTANCE, request);
}
示例5: deleteRepository
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse; //導入依賴的package包/類
/**
* Unregisters a repository.
*/
ActionFuture<DeleteRepositoryResponse> deleteRepository(DeleteRepositoryRequest request);