本文整理汇总了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);