Use generic AcknowledgedResponse instead of extended classes (#32859)

This removes custom Response classes that extend `AcknowledgedResponse` and do nothing, these classes are not needed and we can directly use the non-abstract super-class instead.

While this appears to be a large PR, no code has actually changed, only class names have been changed and entire classes removed.
This commit is contained in:
Lee Hinman 2018-08-15 08:06:14 -06:00 committed by GitHub
parent 8ce1ab3ed9
commit 48281ac5bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
169 changed files with 821 additions and 2056 deletions

View File

@ -21,18 +21,15 @@ package org.elasticsearch.client;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse;
import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse;
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheRequest;
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse;
import org.elasticsearch.action.admin.indices.close.CloseIndexRequest;
import org.elasticsearch.action.admin.indices.close.CloseIndexResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.admin.indices.flush.FlushRequest;
import org.elasticsearch.action.admin.indices.flush.FlushResponse;
import org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest;
@ -45,7 +42,6 @@ import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRespon
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest;
import org.elasticsearch.action.admin.indices.open.OpenIndexResponse;
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
@ -55,15 +51,14 @@ import org.elasticsearch.action.admin.indices.rollover.RolloverResponse;
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest;
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse;
import org.elasticsearch.action.admin.indices.shrink.ResizeRequest;
import org.elasticsearch.action.admin.indices.shrink.ResizeResponse;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequest;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateResponse;
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequest;
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.rest.RestStatus;
import java.io.IOException;
@ -93,9 +88,9 @@ public final class IndicesClient {
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public DeleteIndexResponse delete(DeleteIndexRequest deleteIndexRequest, RequestOptions options) throws IOException {
public AcknowledgedResponse delete(DeleteIndexRequest deleteIndexRequest, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(deleteIndexRequest, RequestConverters::deleteIndex, options,
DeleteIndexResponse::fromXContent, emptySet());
AcknowledgedResponse::fromXContent, emptySet());
}
/**
@ -106,9 +101,9 @@ public final class IndicesClient {
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @param listener the listener to be notified upon request completion
*/
public void deleteAsync(DeleteIndexRequest deleteIndexRequest, RequestOptions options, ActionListener<DeleteIndexResponse> listener) {
public void deleteAsync(DeleteIndexRequest deleteIndexRequest, RequestOptions options, ActionListener<AcknowledgedResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(deleteIndexRequest, RequestConverters::deleteIndex, options,
DeleteIndexResponse::fromXContent, listener, emptySet());
AcknowledgedResponse::fromXContent, listener, emptySet());
}
/**
@ -147,9 +142,9 @@ public final class IndicesClient {
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public PutMappingResponse putMapping(PutMappingRequest putMappingRequest, RequestOptions options) throws IOException {
public AcknowledgedResponse putMapping(PutMappingRequest putMappingRequest, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(putMappingRequest, RequestConverters::putMapping, options,
PutMappingResponse::fromXContent, emptySet());
AcknowledgedResponse::fromXContent, emptySet());
}
/**
@ -160,9 +155,10 @@ public final class IndicesClient {
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @param listener the listener to be notified upon request completion
*/
public void putMappingAsync(PutMappingRequest putMappingRequest, RequestOptions options, ActionListener<PutMappingResponse> listener) {
public void putMappingAsync(PutMappingRequest putMappingRequest, RequestOptions options,
ActionListener<AcknowledgedResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(putMappingRequest, RequestConverters::putMapping, options,
PutMappingResponse::fromXContent, listener, emptySet());
AcknowledgedResponse::fromXContent, listener, emptySet());
}
/**
@ -231,9 +227,9 @@ public final class IndicesClient {
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public IndicesAliasesResponse updateAliases(IndicesAliasesRequest indicesAliasesRequest, RequestOptions options) throws IOException {
public AcknowledgedResponse updateAliases(IndicesAliasesRequest indicesAliasesRequest, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(indicesAliasesRequest, RequestConverters::updateAliases, options,
IndicesAliasesResponse::fromXContent, emptySet());
AcknowledgedResponse::fromXContent, emptySet());
}
/**
@ -245,9 +241,9 @@ public final class IndicesClient {
* @param listener the listener to be notified upon request completion
*/
public void updateAliasesAsync(IndicesAliasesRequest indicesAliasesRequest, RequestOptions options,
ActionListener<IndicesAliasesResponse> listener) {
ActionListener<AcknowledgedResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(indicesAliasesRequest, RequestConverters::updateAliases, options,
IndicesAliasesResponse::fromXContent, listener, emptySet());
AcknowledgedResponse::fromXContent, listener, emptySet());
}
/**
@ -286,9 +282,9 @@ public final class IndicesClient {
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public CloseIndexResponse close(CloseIndexRequest closeIndexRequest, RequestOptions options) throws IOException {
public AcknowledgedResponse close(CloseIndexRequest closeIndexRequest, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(closeIndexRequest, RequestConverters::closeIndex, options,
CloseIndexResponse::fromXContent, emptySet());
AcknowledgedResponse::fromXContent, emptySet());
}
/**
@ -299,9 +295,9 @@ public final class IndicesClient {
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @param listener the listener to be notified upon request completion
*/
public void closeAsync(CloseIndexRequest closeIndexRequest, RequestOptions options, ActionListener<CloseIndexResponse> listener) {
public void closeAsync(CloseIndexRequest closeIndexRequest, RequestOptions options, ActionListener<AcknowledgedResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(closeIndexRequest, RequestConverters::closeIndex, options,
CloseIndexResponse::fromXContent, listener, emptySet());
AcknowledgedResponse::fromXContent, listener, emptySet());
}
@ -706,9 +702,9 @@ public final class IndicesClient {
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public UpdateSettingsResponse putSettings(UpdateSettingsRequest updateSettingsRequest, RequestOptions options) throws IOException {
public AcknowledgedResponse putSettings(UpdateSettingsRequest updateSettingsRequest, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(updateSettingsRequest, RequestConverters::indexPutSettings, options,
UpdateSettingsResponse::fromXContent, emptySet());
AcknowledgedResponse::fromXContent, emptySet());
}
/**
@ -720,9 +716,9 @@ public final class IndicesClient {
* @param listener the listener to be notified upon request completion
*/
public void putSettingsAsync(UpdateSettingsRequest updateSettingsRequest, RequestOptions options,
ActionListener<UpdateSettingsResponse> listener) {
ActionListener<AcknowledgedResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(updateSettingsRequest, RequestConverters::indexPutSettings, options,
UpdateSettingsResponse::fromXContent, listener, emptySet());
AcknowledgedResponse::fromXContent, listener, emptySet());
}
/**
@ -734,10 +730,10 @@ public final class IndicesClient {
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public PutIndexTemplateResponse putTemplate(PutIndexTemplateRequest putIndexTemplateRequest,
RequestOptions options) throws IOException {
public AcknowledgedResponse putTemplate(PutIndexTemplateRequest putIndexTemplateRequest,
RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(putIndexTemplateRequest, RequestConverters::putTemplate, options,
PutIndexTemplateResponse::fromXContent, emptySet());
AcknowledgedResponse::fromXContent, emptySet());
}
/**
@ -749,9 +745,9 @@ public final class IndicesClient {
* @param listener the listener to be notified upon request completion
*/
public void putTemplateAsync(PutIndexTemplateRequest putIndexTemplateRequest, RequestOptions options,
ActionListener<PutIndexTemplateResponse> listener) {
ActionListener<AcknowledgedResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(putIndexTemplateRequest, RequestConverters::putTemplate, options,
PutIndexTemplateResponse::fromXContent, listener, emptySet());
AcknowledgedResponse::fromXContent, listener, emptySet());
}
/**

View File

@ -21,6 +21,7 @@ package org.elasticsearch.client;
import org.apache.http.HttpEntity;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.Streams;
import org.elasticsearch.common.xcontent.DeprecationHandler;
@ -30,7 +31,6 @@ import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.protocol.xpack.license.DeleteLicenseRequest;
import org.elasticsearch.protocol.xpack.license.DeleteLicenseResponse;
import org.elasticsearch.protocol.xpack.license.GetLicenseRequest;
import org.elasticsearch.protocol.xpack.license.GetLicenseResponse;
import org.elasticsearch.protocol.xpack.license.PutLicenseRequest;
@ -106,9 +106,9 @@ public final class LicenseClient {
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public DeleteLicenseResponse deleteLicense(DeleteLicenseRequest request, RequestOptions options) throws IOException {
public AcknowledgedResponse deleteLicense(DeleteLicenseRequest request, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(request, RequestConverters::deleteLicense, options,
DeleteLicenseResponse::fromXContent, emptySet());
AcknowledgedResponse::fromXContent, emptySet());
}
/**
@ -116,9 +116,9 @@ public final class LicenseClient {
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @param listener the listener to be notified upon request completion
*/
public void deleteLicenseAsync(DeleteLicenseRequest request, RequestOptions options, ActionListener<DeleteLicenseResponse> listener) {
public void deleteLicenseAsync(DeleteLicenseRequest request, RequestOptions options, ActionListener<AcknowledgedResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(request, RequestConverters::deleteLicense, options,
DeleteLicenseResponse::fromXContent, listener, emptySet());
AcknowledgedResponse::fromXContent, listener, emptySet());
}
/**

View File

@ -27,7 +27,6 @@ import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptResponse;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptResponse;
import org.elasticsearch.action.bulk.BulkRequest;
@ -53,6 +52,7 @@ import org.elasticsearch.action.search.MultiSearchResponse;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchScrollRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.common.CheckedConsumer;
@ -916,9 +916,9 @@ public class RestHighLevelClient implements Closeable {
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public DeleteStoredScriptResponse deleteScript(DeleteStoredScriptRequest request, RequestOptions options) throws IOException {
public AcknowledgedResponse deleteScript(DeleteStoredScriptRequest request, RequestOptions options) throws IOException {
return performRequestAndParseEntity(request, RequestConverters::deleteScript, options,
DeleteStoredScriptResponse::fromXContent, emptySet());
AcknowledgedResponse::fromXContent, emptySet());
}
/**
@ -930,9 +930,9 @@ public class RestHighLevelClient implements Closeable {
* @param listener the listener to be notified upon request completion
*/
public void deleteScriptAsync(DeleteStoredScriptRequest request, RequestOptions options,
ActionListener<DeleteStoredScriptResponse> listener) {
ActionListener<AcknowledgedResponse> listener) {
performRequestAsyncAndParseEntity(request, RequestConverters::deleteScript, options,
DeleteStoredScriptResponse::fromXContent, listener, emptySet());
AcknowledgedResponse::fromXContent, listener, emptySet());
}
/**

View File

@ -21,23 +21,21 @@ package org.elasticsearch.client;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesRequest;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesResponse;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import java.io.IOException;
@ -95,9 +93,9 @@ public final class SnapshotClient {
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public PutRepositoryResponse createRepository(PutRepositoryRequest putRepositoryRequest, RequestOptions options) throws IOException {
public AcknowledgedResponse createRepository(PutRepositoryRequest putRepositoryRequest, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(putRepositoryRequest, RequestConverters::createRepository, options,
PutRepositoryResponse::fromXContent, emptySet());
AcknowledgedResponse::fromXContent, emptySet());
}
/**
@ -109,9 +107,9 @@ public final class SnapshotClient {
* @param listener the listener to be notified upon request completion
*/
public void createRepositoryAsync(PutRepositoryRequest putRepositoryRequest, RequestOptions options,
ActionListener<PutRepositoryResponse> listener) {
ActionListener<AcknowledgedResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(putRepositoryRequest, RequestConverters::createRepository, options,
PutRepositoryResponse::fromXContent, listener, emptySet());
AcknowledgedResponse::fromXContent, listener, emptySet());
}
/**
@ -123,10 +121,10 @@ public final class SnapshotClient {
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public DeleteRepositoryResponse deleteRepository(DeleteRepositoryRequest deleteRepositoryRequest, RequestOptions options)
public AcknowledgedResponse deleteRepository(DeleteRepositoryRequest deleteRepositoryRequest, RequestOptions options)
throws IOException {
return restHighLevelClient.performRequestAndParseEntity(deleteRepositoryRequest, RequestConverters::deleteRepository, options,
DeleteRepositoryResponse::fromXContent, emptySet());
AcknowledgedResponse::fromXContent, emptySet());
}
/**
@ -138,9 +136,9 @@ public final class SnapshotClient {
* @param listener the listener to be notified upon request completion
*/
public void deleteRepositoryAsync(DeleteRepositoryRequest deleteRepositoryRequest, RequestOptions options,
ActionListener<DeleteRepositoryResponse> listener) {
ActionListener<AcknowledgedResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(deleteRepositoryRequest, RequestConverters::deleteRepository, options,
DeleteRepositoryResponse::fromXContent, listener, emptySet());
AcknowledgedResponse::fromXContent, listener, emptySet());
}
/**
@ -294,9 +292,9 @@ public final class SnapshotClient {
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public DeleteSnapshotResponse delete(DeleteSnapshotRequest deleteSnapshotRequest, RequestOptions options) throws IOException {
public AcknowledgedResponse delete(DeleteSnapshotRequest deleteSnapshotRequest, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(deleteSnapshotRequest, RequestConverters::deleteSnapshot, options,
DeleteSnapshotResponse::fromXContent, emptySet());
AcknowledgedResponse::fromXContent, emptySet());
}
/**
@ -309,8 +307,8 @@ public final class SnapshotClient {
* @param listener the listener to be notified upon request completion
*/
public void deleteAsync(DeleteSnapshotRequest deleteSnapshotRequest, RequestOptions options,
ActionListener<DeleteSnapshotResponse> listener) {
ActionListener<AcknowledgedResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(deleteSnapshotRequest, RequestConverters::deleteSnapshot, options,
DeleteSnapshotResponse::fromXContent, listener, emptySet());
AcknowledgedResponse::fromXContent, listener, emptySet());
}
}

View File

@ -27,18 +27,15 @@ import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.action.admin.indices.alias.Alias;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse;
import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse;
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheRequest;
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse;
import org.elasticsearch.action.admin.indices.close.CloseIndexRequest;
import org.elasticsearch.action.admin.indices.close.CloseIndexResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.admin.indices.flush.FlushRequest;
import org.elasticsearch.action.admin.indices.flush.FlushResponse;
import org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest;
@ -51,7 +48,6 @@ import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRespon
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest;
import org.elasticsearch.action.admin.indices.open.OpenIndexResponse;
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
@ -61,20 +57,19 @@ import org.elasticsearch.action.admin.indices.rollover.RolloverResponse;
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest;
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse;
import org.elasticsearch.action.admin.indices.shrink.ResizeRequest;
import org.elasticsearch.action.admin.indices.shrink.ResizeResponse;
import org.elasticsearch.action.admin.indices.shrink.ResizeType;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequest;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateResponse;
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequest;
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.WriteRequest;
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.cluster.metadata.AliasMetaData;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
@ -411,7 +406,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
mappingBuilder.endObject().endObject().endObject();
putMappingRequest.source(mappingBuilder);
PutMappingResponse putMappingResponse =
AcknowledgedResponse putMappingResponse =
execute(putMappingRequest, highLevelClient().indices()::putMapping, highLevelClient().indices()::putMappingAsync);
assertTrue(putMappingResponse.isAcknowledged());
@ -431,7 +426,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
mappingBuilder.endObject().endObject().endObject();
putMappingRequest.source(mappingBuilder);
PutMappingResponse putMappingResponse =
AcknowledgedResponse putMappingResponse =
execute(putMappingRequest, highLevelClient().indices()::putMapping, highLevelClient().indices()::putMappingAsync);
assertTrue(putMappingResponse.isAcknowledged());
@ -467,7 +462,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
mappingBuilder.endObject().endObject().endObject();
putMappingRequest.source(mappingBuilder);
PutMappingResponse putMappingResponse =
AcknowledgedResponse putMappingResponse =
execute(putMappingRequest, highLevelClient().indices()::putMapping, highLevelClient().indices()::putMappingAsync);
assertTrue(putMappingResponse.isAcknowledged());
@ -497,7 +492,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
createIndex(indexName, Settings.EMPTY);
DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(indexName);
DeleteIndexResponse deleteIndexResponse =
AcknowledgedResponse deleteIndexResponse =
execute(deleteIndexRequest, highLevelClient().indices()::delete, highLevelClient().indices()::deleteAsync);
assertTrue(deleteIndexResponse.isAcknowledged());
@ -529,7 +524,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
AliasActions addAction = new AliasActions(AliasActions.Type.ADD).index(index).aliases(alias);
addAction.routing("routing").searchRouting("search_routing").filter("{\"term\":{\"year\":2016}}");
aliasesAddRequest.addAliasAction(addAction);
IndicesAliasesResponse aliasesAddResponse = execute(aliasesAddRequest, highLevelClient().indices()::updateAliases,
AcknowledgedResponse aliasesAddResponse = execute(aliasesAddRequest, highLevelClient().indices()::updateAliases,
highLevelClient().indices()::updateAliasesAsync);
assertTrue(aliasesAddResponse.isAcknowledged());
assertThat(aliasExists(alias), equalTo(true));
@ -547,7 +542,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
aliasesAddRemoveRequest.addAliasAction(addAction);
AliasActions removeAction = new AliasActions(AliasActions.Type.REMOVE).index(index).alias(alias);
aliasesAddRemoveRequest.addAliasAction(removeAction);
IndicesAliasesResponse aliasesAddRemoveResponse = execute(aliasesAddRemoveRequest, highLevelClient().indices()::updateAliases,
AcknowledgedResponse aliasesAddRemoveResponse = execute(aliasesAddRemoveRequest, highLevelClient().indices()::updateAliases,
highLevelClient().indices()::updateAliasesAsync);
assertTrue(aliasesAddRemoveResponse.isAcknowledged());
assertThat(aliasExists(alias), equalTo(false));
@ -558,7 +553,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
IndicesAliasesRequest aliasesRemoveIndexRequest = new IndicesAliasesRequest();
AliasActions removeIndexAction = new AliasActions(AliasActions.Type.REMOVE_INDEX).index(index);
aliasesRemoveIndexRequest.addAliasAction(removeIndexAction);
IndicesAliasesResponse aliasesRemoveIndexResponse = execute(aliasesRemoveIndexRequest, highLevelClient().indices()::updateAliases,
AcknowledgedResponse aliasesRemoveIndexResponse = execute(aliasesRemoveIndexRequest, highLevelClient().indices()::updateAliases,
highLevelClient().indices()::updateAliasesAsync);
assertTrue(aliasesRemoveIndexResponse.isAcknowledged());
assertThat(aliasExists(alias), equalTo(false));
@ -654,7 +649,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
assertThat(response.getStatusLine().getStatusCode(), equalTo(RestStatus.OK.getStatus()));
CloseIndexRequest closeIndexRequest = new CloseIndexRequest(index);
CloseIndexResponse closeIndexResponse = execute(closeIndexRequest, highLevelClient().indices()::close,
AcknowledgedResponse closeIndexResponse = execute(closeIndexRequest, highLevelClient().indices()::close,
highLevelClient().indices()::closeAsync);
assertTrue(closeIndexResponse.isAcknowledged());
@ -1144,7 +1139,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
assertThat(dynamicSetting.getDefault(Settings.EMPTY), not(dynamicSettingValue));
UpdateSettingsRequest dynamicSettingRequest = new UpdateSettingsRequest();
dynamicSettingRequest.settings(Settings.builder().put(dynamicSettingKey, dynamicSettingValue).build());
UpdateSettingsResponse response = execute(dynamicSettingRequest, highLevelClient().indices()::putSettings,
AcknowledgedResponse response = execute(dynamicSettingRequest, highLevelClient().indices()::putSettings,
highLevelClient().indices()::putSettingsAsync);
assertTrue(response.isAcknowledged());
@ -1227,7 +1222,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
.mapping("doc", "host_name", "type=keyword", "description", "type=text")
.alias(new Alias("alias-1").indexRouting("abc")).alias(new Alias("{index}-write").searchRouting("xyz"));
PutIndexTemplateResponse putTemplateResponse = execute(putTemplateRequest,
AcknowledgedResponse putTemplateResponse = execute(putTemplateRequest,
highLevelClient().indices()::putTemplate, highLevelClient().indices()::putTemplateAsync);
assertThat(putTemplateResponse.isAcknowledged(), equalTo(true));

View File

@ -21,24 +21,22 @@ package org.elasticsearch.client;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesRequest;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesResponse;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.repositories.fs.FsRepository;
import org.elasticsearch.rest.RestStatus;
@ -55,7 +53,7 @@ import static org.hamcrest.Matchers.is;
public class SnapshotIT extends ESRestHighLevelClientTestCase {
private PutRepositoryResponse createTestRepository(String repository, String type, String settings) throws IOException {
private AcknowledgedResponse createTestRepository(String repository, String type, String settings) throws IOException {
PutRepositoryRequest request = new PutRepositoryRequest(repository);
request.settings(settings, XContentType.JSON);
request.type(type);
@ -71,7 +69,7 @@ public class SnapshotIT extends ESRestHighLevelClientTestCase {
}
public void testCreateRepository() throws IOException {
PutRepositoryResponse response = createTestRepository("test", FsRepository.TYPE, "{\"location\": \".\"}");
AcknowledgedResponse response = createTestRepository("test", FsRepository.TYPE, "{\"location\": \".\"}");
assertTrue(response.isAcknowledged());
}
@ -117,14 +115,14 @@ public class SnapshotIT extends ESRestHighLevelClientTestCase {
assertThat(1, equalTo(response.repositories().size()));
DeleteRepositoryRequest deleteRequest = new DeleteRepositoryRequest(repository);
DeleteRepositoryResponse deleteResponse = execute(deleteRequest, highLevelClient().snapshot()::deleteRepository,
AcknowledgedResponse deleteResponse = execute(deleteRequest, highLevelClient().snapshot()::deleteRepository,
highLevelClient().snapshot()::deleteRepositoryAsync);
assertTrue(deleteResponse.isAcknowledged());
}
public void testVerifyRepository() throws IOException {
PutRepositoryResponse putRepositoryResponse = createTestRepository("test", FsRepository.TYPE, "{\"location\": \".\"}");
AcknowledgedResponse putRepositoryResponse = createTestRepository("test", FsRepository.TYPE, "{\"location\": \".\"}");
assertTrue(putRepositoryResponse.isAcknowledged());
VerifyRepositoryRequest request = new VerifyRepositoryRequest("test");
@ -153,7 +151,7 @@ public class SnapshotIT extends ESRestHighLevelClientTestCase {
String snapshot1 = "test_snapshot1";
String snapshot2 = "test_snapshot2";
PutRepositoryResponse putRepositoryResponse = createTestRepository(repository, FsRepository.TYPE, "{\"location\": \".\"}");
AcknowledgedResponse putRepositoryResponse = createTestRepository(repository, FsRepository.TYPE, "{\"location\": \".\"}");
assertTrue(putRepositoryResponse.isAcknowledged());
CreateSnapshotRequest createSnapshotRequest1 = new CreateSnapshotRequest(repository, snapshot1);
@ -187,7 +185,7 @@ public class SnapshotIT extends ESRestHighLevelClientTestCase {
String testSnapshot = "snapshot";
String testIndex = "test_index";
PutRepositoryResponse putRepositoryResponse = createTestRepository(testRepository, FsRepository.TYPE, "{\"location\": \".\"}");
AcknowledgedResponse putRepositoryResponse = createTestRepository(testRepository, FsRepository.TYPE, "{\"location\": \".\"}");
assertTrue(putRepositoryResponse.isAcknowledged());
createIndex(testIndex, Settings.EMPTY);
@ -216,7 +214,7 @@ public class SnapshotIT extends ESRestHighLevelClientTestCase {
String testIndex = "test_index";
String restoredIndex = testIndex + "_restored";
PutRepositoryResponse putRepositoryResponse = createTestRepository(testRepository, FsRepository.TYPE, "{\"location\": \".\"}");
AcknowledgedResponse putRepositoryResponse = createTestRepository(testRepository, FsRepository.TYPE, "{\"location\": \".\"}");
assertTrue(putRepositoryResponse.isAcknowledged());
createIndex(testIndex, Settings.EMPTY);
@ -250,7 +248,7 @@ public class SnapshotIT extends ESRestHighLevelClientTestCase {
String repository = "test_repository";
String snapshot = "test_snapshot";
PutRepositoryResponse putRepositoryResponse = createTestRepository(repository, FsRepository.TYPE, "{\"location\": \".\"}");
AcknowledgedResponse putRepositoryResponse = createTestRepository(repository, FsRepository.TYPE, "{\"location\": \".\"}");
assertTrue(putRepositoryResponse.isAcknowledged());
CreateSnapshotRequest createSnapshotRequest = new CreateSnapshotRequest(repository, snapshot);
@ -260,7 +258,7 @@ public class SnapshotIT extends ESRestHighLevelClientTestCase {
assertEquals(RestStatus.OK, createSnapshotResponse.status());
DeleteSnapshotRequest request = new DeleteSnapshotRequest(repository, snapshot);
DeleteSnapshotResponse response = execute(request, highLevelClient().snapshot()::delete, highLevelClient().snapshot()::deleteAsync);
AcknowledgedResponse response = execute(request, highLevelClient().snapshot()::delete, highLevelClient().snapshot()::deleteAsync);
assertTrue(response.isAcknowledged());
}

View File

@ -23,9 +23,9 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.util.EntityUtils;
import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptResponse;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentType;
@ -90,7 +90,7 @@ public class StoredScriptsIT extends ESRestHighLevelClientTestCase {
deleteRequest.masterNodeTimeout("50s");
deleteRequest.timeout("50s");
DeleteStoredScriptResponse deleteResponse = execute(deleteRequest, highLevelClient()::deleteScript,
AcknowledgedResponse deleteResponse = execute(deleteRequest, highLevelClient()::deleteScript,
highLevelClient()::deleteScriptAsync);
assertThat(deleteResponse.isAcknowledged(), equalTo(true));

View File

@ -25,7 +25,6 @@ import org.elasticsearch.action.LatchedActionListener;
import org.elasticsearch.action.admin.indices.alias.Alias;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse;
import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse;
@ -33,11 +32,9 @@ import org.elasticsearch.action.admin.indices.analyze.DetailAnalyzeResponse;
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheRequest;
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse;
import org.elasticsearch.action.admin.indices.close.CloseIndexRequest;
import org.elasticsearch.action.admin.indices.close.CloseIndexResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.admin.indices.flush.FlushRequest;
import org.elasticsearch.action.admin.indices.flush.FlushResponse;
import org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest;
@ -50,7 +47,6 @@ import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRespon
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest;
import org.elasticsearch.action.admin.indices.open.OpenIndexResponse;
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
@ -60,20 +56,19 @@ import org.elasticsearch.action.admin.indices.rollover.RolloverResponse;
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest;
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse;
import org.elasticsearch.action.admin.indices.shrink.ResizeRequest;
import org.elasticsearch.action.admin.indices.shrink.ResizeResponse;
import org.elasticsearch.action.admin.indices.shrink.ResizeType;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequest;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateResponse;
import org.elasticsearch.action.admin.indices.validate.query.QueryExplanation;
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequest;
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryResponse;
import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ESRestHighLevelClientTestCase;
import org.elasticsearch.client.GetAliasesResponse;
import org.elasticsearch.client.RequestOptions;
@ -220,7 +215,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
// end::delete-index-request-indicesOptions
// tag::delete-index-execute
DeleteIndexResponse deleteIndexResponse = client.indices().delete(request, RequestOptions.DEFAULT);
AcknowledgedResponse deleteIndexResponse = client.indices().delete(request, RequestOptions.DEFAULT);
// end::delete-index-execute
// tag::delete-index-response
@ -255,10 +250,10 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
DeleteIndexRequest request = new DeleteIndexRequest("posts");
// tag::delete-index-execute-listener
ActionListener<DeleteIndexResponse> listener =
new ActionListener<DeleteIndexResponse>() {
ActionListener<AcknowledgedResponse> listener =
new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(DeleteIndexResponse deleteIndexResponse) {
public void onResponse(AcknowledgedResponse deleteIndexResponse) {
// <1>
}
@ -480,7 +475,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
"}", // <1>
XContentType.JSON);
// end::put-mapping-request-source
PutMappingResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
AcknowledgedResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
assertTrue(putMappingResponse.isAcknowledged());
}
@ -494,7 +489,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
jsonMap.put("properties", properties);
request.source(jsonMap); // <1>
//end::put-mapping-map
PutMappingResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
AcknowledgedResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
assertTrue(putMappingResponse.isAcknowledged());
}
{
@ -515,14 +510,14 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
builder.endObject();
request.source(builder); // <1>
//end::put-mapping-xcontent
PutMappingResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
AcknowledgedResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
assertTrue(putMappingResponse.isAcknowledged());
}
{
//tag::put-mapping-shortcut
request.source("message", "type=text"); // <1>
//end::put-mapping-shortcut
PutMappingResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
AcknowledgedResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
assertTrue(putMappingResponse.isAcknowledged());
}
@ -536,7 +531,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
// end::put-mapping-request-masterTimeout
// tag::put-mapping-execute
PutMappingResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
AcknowledgedResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
// end::put-mapping-execute
// tag::put-mapping-response
@ -558,10 +553,10 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
PutMappingRequest request = new PutMappingRequest("twitter").type("tweet");
// tag::put-mapping-execute-listener
ActionListener<PutMappingResponse> listener =
new ActionListener<PutMappingResponse>() {
ActionListener<AcknowledgedResponse> listener =
new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(PutMappingResponse putMappingResponse) {
public void onResponse(AcknowledgedResponse putMappingResponse) {
// <1>
}
@ -601,7 +596,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
" }\n" +
"}", // <1>
XContentType.JSON);
PutMappingResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
AcknowledgedResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
assertTrue(putMappingResponse.isAcknowledged());
}
@ -658,7 +653,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
" }\n" +
"}", // <1>
XContentType.JSON);
PutMappingResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
AcknowledgedResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
assertTrue(putMappingResponse.isAcknowledged());
}
@ -731,7 +726,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
" }\n" +
"}", // <1>
XContentType.JSON);
PutMappingResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
AcknowledgedResponse putMappingResponse = client.indices().putMapping(request, RequestOptions.DEFAULT);
assertTrue(putMappingResponse.isAcknowledged());
}
@ -1497,7 +1492,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
// end::close-index-request-indicesOptions
// tag::close-index-execute
CloseIndexResponse closeIndexResponse = client.indices().close(request, RequestOptions.DEFAULT);
AcknowledgedResponse closeIndexResponse = client.indices().close(request, RequestOptions.DEFAULT);
// end::close-index-execute
// tag::close-index-response
@ -1506,10 +1501,10 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
assertTrue(acknowledged);
// tag::close-index-execute-listener
ActionListener<CloseIndexResponse> listener =
new ActionListener<CloseIndexResponse>() {
ActionListener<AcknowledgedResponse> listener =
new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(CloseIndexResponse closeIndexResponse) {
public void onResponse(AcknowledgedResponse closeIndexResponse) {
// <1>
}
@ -1649,7 +1644,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
// end::update-aliases-request-masterTimeout
// tag::update-aliases-execute
IndicesAliasesResponse indicesAliasesResponse =
AcknowledgedResponse indicesAliasesResponse =
client.indices().updateAliases(request, RequestOptions.DEFAULT);
// end::update-aliases-execute
@ -1665,10 +1660,10 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
request.addAliasAction(aliasAction);
// tag::update-aliases-execute-listener
ActionListener<IndicesAliasesResponse> listener =
new ActionListener<IndicesAliasesResponse>() {
ActionListener<AcknowledgedResponse> listener =
new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(IndicesAliasesResponse indicesAliasesResponse) {
public void onResponse(AcknowledgedResponse indicesAliasesResponse) {
// <1>
}
@ -2056,7 +2051,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
// end::put-settings-request-indicesOptions
// tag::put-settings-execute
UpdateSettingsResponse updateSettingsResponse =
AcknowledgedResponse updateSettingsResponse =
client.indices().putSettings(request, RequestOptions.DEFAULT);
// end::put-settings-execute
@ -2066,11 +2061,11 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
assertTrue(acknowledged);
// tag::put-settings-execute-listener
ActionListener<UpdateSettingsResponse> listener =
new ActionListener<UpdateSettingsResponse>() {
ActionListener<AcknowledgedResponse> listener =
new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(UpdateSettingsResponse updateSettingsResponse) {
public void onResponse(AcknowledgedResponse updateSettingsResponse) {
// <1>
}
@ -2219,7 +2214,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
request.create(false); // make test happy
// tag::put-template-execute
PutIndexTemplateResponse putTemplateResponse = client.indices().putTemplate(request, RequestOptions.DEFAULT);
AcknowledgedResponse putTemplateResponse = client.indices().putTemplate(request, RequestOptions.DEFAULT);
// end::put-template-execute
// tag::put-template-response
@ -2228,10 +2223,10 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
assertTrue(acknowledged);
// tag::put-template-execute-listener
ActionListener<PutIndexTemplateResponse> listener =
new ActionListener<PutIndexTemplateResponse>() {
ActionListener<AcknowledgedResponse> listener =
new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(PutIndexTemplateResponse putTemplateResponse) {
public void onResponse(AcknowledgedResponse putTemplateResponse) {
// <1>
}
@ -2461,7 +2456,7 @@ public class IndicesClientDocumentationIT extends ESRestHighLevelClientTestCase
.indices("my_index")
.type("_doc")
.source("my_field", "type=text,analyzer=english");
PutMappingResponse pmResp = client.indices().putMapping(pmReq, RequestOptions.DEFAULT);
AcknowledgedResponse pmResp = client.indices().putMapping(pmReq, RequestOptions.DEFAULT);
assertTrue(pmResp.isAcknowledged());
{

View File

@ -22,12 +22,12 @@ package org.elasticsearch.client.documentation;
import org.elasticsearch.Build;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.LatchedActionListener;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ESRestHighLevelClientTestCase;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.Booleans;
import org.elasticsearch.protocol.xpack.license.DeleteLicenseRequest;
import org.elasticsearch.protocol.xpack.license.DeleteLicenseResponse;
import org.elasticsearch.protocol.xpack.license.GetLicenseRequest;
import org.elasticsearch.protocol.xpack.license.GetLicenseResponse;
import org.elasticsearch.protocol.xpack.license.LicensesStatus;
@ -120,7 +120,7 @@ public class LicensingDocumentationIT extends ESRestHighLevelClientTestCase {
//tag::delete-license-execute
DeleteLicenseRequest request = new DeleteLicenseRequest();
DeleteLicenseResponse response = client.license().deleteLicense(request, RequestOptions.DEFAULT);
AcknowledgedResponse response = client.license().deleteLicense(request, RequestOptions.DEFAULT);
//end::delete-license-execute
//tag::delete-license-response
@ -132,9 +132,9 @@ public class LicensingDocumentationIT extends ESRestHighLevelClientTestCase {
{
DeleteLicenseRequest request = new DeleteLicenseRequest();
// tag::delete-license-execute-listener
ActionListener<DeleteLicenseResponse> listener = new ActionListener<DeleteLicenseResponse>() {
ActionListener<AcknowledgedResponse> listener = new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(DeleteLicenseResponse deleteLicenseResponse) {
public void onResponse(AcknowledgedResponse deleteLicenseResponse) {
// <1>
}

View File

@ -22,27 +22,25 @@ package org.elasticsearch.client.documentation;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.LatchedActionListener;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesRequest;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesResponse;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotStats;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotStatus;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ESRestHighLevelClientTestCase;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.RequestOptions;
@ -163,7 +161,7 @@ public class SnapshotClientDocumentationIT extends ESRestHighLevelClientTestCase
// end::create-repository-request-verify
// tag::create-repository-execute
PutRepositoryResponse response = client.snapshot().createRepository(request, RequestOptions.DEFAULT);
AcknowledgedResponse response = client.snapshot().createRepository(request, RequestOptions.DEFAULT);
// end::create-repository-execute
// tag::create-repository-response
@ -178,10 +176,10 @@ public class SnapshotClientDocumentationIT extends ESRestHighLevelClientTestCase
PutRepositoryRequest request = new PutRepositoryRequest(repositoryName);
// tag::create-repository-execute-listener
ActionListener<PutRepositoryResponse> listener =
new ActionListener<PutRepositoryResponse>() {
ActionListener<AcknowledgedResponse> listener =
new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(PutRepositoryResponse putRepositoryResponse) {
public void onResponse(AcknowledgedResponse putRepositoryResponse) {
// <1>
}
@ -388,7 +386,7 @@ public class SnapshotClientDocumentationIT extends ESRestHighLevelClientTestCase
// end::delete-repository-request-timeout
// tag::delete-repository-execute
DeleteRepositoryResponse response = client.snapshot().deleteRepository(request, RequestOptions.DEFAULT);
AcknowledgedResponse response = client.snapshot().deleteRepository(request, RequestOptions.DEFAULT);
// end::delete-repository-execute
// tag::delete-repository-response
@ -403,10 +401,10 @@ public class SnapshotClientDocumentationIT extends ESRestHighLevelClientTestCase
DeleteRepositoryRequest request = new DeleteRepositoryRequest();
// tag::delete-repository-execute-listener
ActionListener<DeleteRepositoryResponse> listener =
new ActionListener<DeleteRepositoryResponse>() {
ActionListener<AcknowledgedResponse> listener =
new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(DeleteRepositoryResponse deleteRepositoryResponse) {
public void onResponse(AcknowledgedResponse deleteRepositoryResponse) {
// <1>
}
@ -752,7 +750,7 @@ public class SnapshotClientDocumentationIT extends ESRestHighLevelClientTestCase
// end::delete-snapshot-request-masterTimeout
// tag::delete-snapshot-execute
DeleteSnapshotResponse response = client.snapshot().delete(request, RequestOptions.DEFAULT);
AcknowledgedResponse response = client.snapshot().delete(request, RequestOptions.DEFAULT);
// end::delete-snapshot-execute
// tag::delete-snapshot-response
@ -767,10 +765,10 @@ public class SnapshotClientDocumentationIT extends ESRestHighLevelClientTestCase
DeleteSnapshotRequest request = new DeleteSnapshotRequest();
// tag::delete-snapshot-execute-listener
ActionListener<DeleteSnapshotResponse> listener =
new ActionListener<DeleteSnapshotResponse>() {
ActionListener<AcknowledgedResponse> listener =
new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(DeleteSnapshotResponse deleteSnapshotResponse) {
public void onResponse(AcknowledgedResponse deleteSnapshotResponse) {
// <1>
}

View File

@ -23,9 +23,9 @@ import org.apache.http.util.EntityUtils;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.LatchedActionListener;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptResponse;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ESRestHighLevelClientTestCase;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.Response;
@ -154,7 +154,7 @@ public class StoredScriptsDocumentationIT extends ESRestHighLevelClientTestCase
// end::delete-stored-script-request-timeout
// tag::delete-stored-script-execute
DeleteStoredScriptResponse deleteResponse = client.deleteScript(deleteRequest, RequestOptions.DEFAULT);
AcknowledgedResponse deleteResponse = client.deleteScript(deleteRequest, RequestOptions.DEFAULT);
// end::delete-stored-script-execute
// tag::delete-stored-script-response
@ -164,10 +164,10 @@ public class StoredScriptsDocumentationIT extends ESRestHighLevelClientTestCase
putStoredScript("calculate-score", scriptSource);
// tag::delete-stored-script-execute-listener
ActionListener<DeleteStoredScriptResponse> listener =
new ActionListener<DeleteStoredScriptResponse>() {
ActionListener<AcknowledgedResponse> listener =
new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(DeleteStoredScriptResponse response) {
public void onResponse(AcknowledgedResponse response) {
// <1>
}

View File

@ -20,9 +20,9 @@
package org.elasticsearch.repositories.url;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
@ -120,7 +120,7 @@ public class URLSnapshotRestoreTests extends ESIntegTestCase {
assertThat(getSnapshotsResponse.getSnapshots().size(), equalTo(1));
logger.info("--> delete snapshot");
DeleteSnapshotResponse deleteSnapshotResponse = client.admin().cluster().prepareDeleteSnapshot("test-repo", "test-snap").get();
AcknowledgedResponse deleteSnapshotResponse = client.admin().cluster().prepareDeleteSnapshot("test-repo", "test-snap").get();
assertAcked(deleteSnapshotResponse);
logger.info("--> list available shapshot again, no snapshots should be returned");

View File

@ -19,8 +19,8 @@
package org.elasticsearch.index.mapper.size;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.plugin.mapper.MapperSizePlugin;
@ -62,7 +62,7 @@ public class SizeMappingIT extends ESIntegTestCase {
XContentBuilder updateMappingBuilder =
jsonBuilder().startObject().startObject("properties").startObject("otherField").field("type", "text")
.endObject().endObject().endObject();
PutMappingResponse putMappingResponse =
AcknowledgedResponse putMappingResponse =
client().admin().indices().preparePutMapping(index).setType(type).setSource(updateMappingBuilder).get();
assertAcked(putMappingResponse);
@ -84,7 +84,7 @@ public class SizeMappingIT extends ESIntegTestCase {
// update some field in the mapping
XContentBuilder updateMappingBuilder =
jsonBuilder().startObject().startObject("_size").field("enabled", false).endObject().endObject();
PutMappingResponse putMappingResponse =
AcknowledgedResponse putMappingResponse =
client().admin().indices().preparePutMapping(index).setType(type).setSource(updateMappingBuilder).get();
assertAcked(putMappingResponse);

View File

@ -19,9 +19,9 @@
package org.elasticsearch.repositories.hdfs;
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.bootstrap.JavaVersion;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterState;
@ -48,7 +48,7 @@ public class HdfsTests extends ESSingleNodeTestCase {
assumeFalse("https://github.com/elastic/elasticsearch/issues/31498", JavaVersion.current().equals(JavaVersion.parse("11")));
Client client = client();
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
AcknowledgedResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
.setType("hdfs")
.setSettings(Settings.builder()
.put("uri", "hdfs:///")

View File

@ -20,11 +20,12 @@
package org.elasticsearch.action.admin.cluster.repositories.delete;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
/**
* Unregister repository action
*/
public class DeleteRepositoryAction extends Action<DeleteRepositoryResponse> {
public class DeleteRepositoryAction extends Action<AcknowledgedResponse> {
public static final DeleteRepositoryAction INSTANCE = new DeleteRepositoryAction();
public static final String NAME = "cluster:admin/repository/delete";
@ -34,8 +35,8 @@ public class DeleteRepositoryAction extends Action<DeleteRepositoryResponse> {
}
@Override
public DeleteRepositoryResponse newResponse() {
return new DeleteRepositoryResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -20,12 +20,13 @@
package org.elasticsearch.action.admin.cluster.repositories.delete;
import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ElasticsearchClient;
/**
* Builder for unregister repository request
*/
public class DeleteRepositoryRequestBuilder extends AcknowledgedRequestBuilder<DeleteRepositoryRequest, DeleteRepositoryResponse, DeleteRepositoryRequestBuilder> {
public class DeleteRepositoryRequestBuilder extends AcknowledgedRequestBuilder<DeleteRepositoryRequest, AcknowledgedResponse, DeleteRepositoryRequestBuilder> {
/**
* Constructs unregister repository request builder

View File

@ -1,40 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.cluster.repositories.delete;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.xcontent.XContentParser;
/**
* Unregister repository response
*/
public class DeleteRepositoryResponse extends AcknowledgedResponse {
DeleteRepositoryResponse() {
}
DeleteRepositoryResponse(boolean acknowledged) {
super(acknowledged);
}
public static DeleteRepositoryResponse fromXContent(XContentParser parser) {
return new DeleteRepositoryResponse(parseAcknowledged(parser));
}
}

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.admin.cluster.repositories.delete;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ack.ClusterStateUpdateResponse;
@ -37,7 +38,7 @@ import org.elasticsearch.transport.TransportService;
/**
* Transport action for unregister repository operation
*/
public class TransportDeleteRepositoryAction extends TransportMasterNodeAction<DeleteRepositoryRequest, DeleteRepositoryResponse> {
public class TransportDeleteRepositoryAction extends TransportMasterNodeAction<DeleteRepositoryRequest, AcknowledgedResponse> {
private final RepositoriesService repositoriesService;
@ -55,8 +56,8 @@ public class TransportDeleteRepositoryAction extends TransportMasterNodeAction<D
}
@Override
protected DeleteRepositoryResponse newResponse() {
return new DeleteRepositoryResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
@ -65,14 +66,14 @@ public class TransportDeleteRepositoryAction extends TransportMasterNodeAction<D
}
@Override
protected void masterOperation(final DeleteRepositoryRequest request, ClusterState state, final ActionListener<DeleteRepositoryResponse> listener) {
protected void masterOperation(final DeleteRepositoryRequest request, ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
repositoriesService.unregisterRepository(
new RepositoriesService.UnregisterRepositoryRequest("delete_repository [" + request.name() + "]", request.name())
.masterNodeTimeout(request.masterNodeTimeout()).ackTimeout(request.timeout()),
new ActionListener<ClusterStateUpdateResponse>() {
@Override
public void onResponse(ClusterStateUpdateResponse unregisterRepositoryResponse) {
listener.onResponse(new DeleteRepositoryResponse(unregisterRepositoryResponse.isAcknowledged()));
listener.onResponse(new AcknowledgedResponse(unregisterRepositoryResponse.isAcknowledged()));
}
@Override

View File

@ -20,11 +20,12 @@
package org.elasticsearch.action.admin.cluster.repositories.put;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
/**
* Register repository action
*/
public class PutRepositoryAction extends Action<PutRepositoryResponse> {
public class PutRepositoryAction extends Action<AcknowledgedResponse> {
public static final PutRepositoryAction INSTANCE = new PutRepositoryAction();
public static final String NAME = "cluster:admin/repository/put";
@ -34,8 +35,8 @@ public class PutRepositoryAction extends Action<PutRepositoryResponse> {
}
@Override
public PutRepositoryResponse newResponse() {
return new PutRepositoryResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -20,6 +20,7 @@
package org.elasticsearch.action.admin.cluster.repositories.put;
import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ElasticsearchClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentType;
@ -29,7 +30,7 @@ import java.util.Map;
/**
* Register repository request builder
*/
public class PutRepositoryRequestBuilder extends AcknowledgedRequestBuilder<PutRepositoryRequest, PutRepositoryResponse, PutRepositoryRequestBuilder> {
public class PutRepositoryRequestBuilder extends AcknowledgedRequestBuilder<PutRepositoryRequest, AcknowledgedResponse, PutRepositoryRequestBuilder> {
/**
* Constructs register repository request

View File

@ -1,40 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.cluster.repositories.put;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.xcontent.XContentParser;
/**
* Register repository response
*/
public class PutRepositoryResponse extends AcknowledgedResponse {
PutRepositoryResponse() {
}
PutRepositoryResponse(boolean acknowledged) {
super(acknowledged);
}
public static PutRepositoryResponse fromXContent(XContentParser parser) {
return new PutRepositoryResponse(parseAcknowledged(parser));
}
}

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.admin.cluster.repositories.put;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ack.ClusterStateUpdateResponse;
@ -37,7 +38,7 @@ import org.elasticsearch.transport.TransportService;
/**
* Transport action for register repository operation
*/
public class TransportPutRepositoryAction extends TransportMasterNodeAction<PutRepositoryRequest, PutRepositoryResponse> {
public class TransportPutRepositoryAction extends TransportMasterNodeAction<PutRepositoryRequest, AcknowledgedResponse> {
private final RepositoriesService repositoriesService;
@ -55,8 +56,8 @@ public class TransportPutRepositoryAction extends TransportMasterNodeAction<PutR
}
@Override
protected PutRepositoryResponse newResponse() {
return new PutRepositoryResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
@ -65,7 +66,7 @@ public class TransportPutRepositoryAction extends TransportMasterNodeAction<PutR
}
@Override
protected void masterOperation(final PutRepositoryRequest request, ClusterState state, final ActionListener<PutRepositoryResponse> listener) {
protected void masterOperation(final PutRepositoryRequest request, ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
repositoriesService.registerRepository(
new RepositoriesService.RegisterRepositoryRequest("put_repository [" + request.name() + "]",
@ -76,7 +77,7 @@ public class TransportPutRepositoryAction extends TransportMasterNodeAction<PutR
@Override
public void onResponse(ClusterStateUpdateResponse response) {
listener.onResponse(new PutRepositoryResponse(response.isAcknowledged()));
listener.onResponse(new AcknowledgedResponse(response.isAcknowledged()));
}
@Override

View File

@ -20,11 +20,12 @@
package org.elasticsearch.action.admin.cluster.snapshots.delete;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
/**
* Delete snapshot action
*/
public class DeleteSnapshotAction extends Action<DeleteSnapshotResponse> {
public class DeleteSnapshotAction extends Action<AcknowledgedResponse> {
public static final DeleteSnapshotAction INSTANCE = new DeleteSnapshotAction();
public static final String NAME = "cluster:admin/snapshot/delete";
@ -34,8 +35,8 @@ public class DeleteSnapshotAction extends Action<DeleteSnapshotResponse> {
}
@Override
public DeleteSnapshotResponse newResponse() {
return new DeleteSnapshotResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -19,13 +19,14 @@
package org.elasticsearch.action.admin.cluster.snapshots.delete;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
import org.elasticsearch.client.ElasticsearchClient;
/**
* Delete snapshot request builder
*/
public class DeleteSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder<DeleteSnapshotRequest, DeleteSnapshotResponse, DeleteSnapshotRequestBuilder> {
public class DeleteSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder<DeleteSnapshotRequest, AcknowledgedResponse, DeleteSnapshotRequestBuilder> {
/**
* Constructs delete snapshot request builder

View File

@ -1,41 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.cluster.snapshots.delete;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.xcontent.XContentParser;
/**
* Delete snapshot response
*/
public class DeleteSnapshotResponse extends AcknowledgedResponse {
DeleteSnapshotResponse() {
}
DeleteSnapshotResponse(boolean acknowledged) {
super(acknowledged);
}
public static DeleteSnapshotResponse fromXContent(XContentParser parser) {
return new DeleteSnapshotResponse(parseAcknowledged(parser));
}
}

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.admin.cluster.snapshots.delete;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
@ -36,7 +37,7 @@ import org.elasticsearch.transport.TransportService;
/**
* Transport action for delete snapshot operation
*/
public class TransportDeleteSnapshotAction extends TransportMasterNodeAction<DeleteSnapshotRequest, DeleteSnapshotResponse> {
public class TransportDeleteSnapshotAction extends TransportMasterNodeAction<DeleteSnapshotRequest, AcknowledgedResponse> {
private final SnapshotsService snapshotsService;
@Inject
@ -53,8 +54,8 @@ public class TransportDeleteSnapshotAction extends TransportMasterNodeAction<Del
}
@Override
protected DeleteSnapshotResponse newResponse() {
return new DeleteSnapshotResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
@ -64,11 +65,11 @@ public class TransportDeleteSnapshotAction extends TransportMasterNodeAction<Del
}
@Override
protected void masterOperation(final DeleteSnapshotRequest request, ClusterState state, final ActionListener<DeleteSnapshotResponse> listener) {
protected void masterOperation(final DeleteSnapshotRequest request, ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
snapshotsService.deleteSnapshot(request.repository(), request.snapshot(), new SnapshotsService.DeleteSnapshotListener() {
@Override
public void onResponse() {
listener.onResponse(new DeleteSnapshotResponse(true));
listener.onResponse(new AcknowledgedResponse(true));
}
@Override

View File

@ -20,8 +20,9 @@
package org.elasticsearch.action.admin.cluster.storedscripts;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class DeleteStoredScriptAction extends Action<DeleteStoredScriptResponse> {
public class DeleteStoredScriptAction extends Action<AcknowledgedResponse> {
public static final DeleteStoredScriptAction INSTANCE = new DeleteStoredScriptAction();
public static final String NAME = "cluster:admin/script/delete";
@ -31,7 +32,7 @@ public class DeleteStoredScriptAction extends Action<DeleteStoredScriptResponse>
}
@Override
public DeleteStoredScriptResponse newResponse() {
return new DeleteStoredScriptResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -20,10 +20,11 @@
package org.elasticsearch.action.admin.cluster.storedscripts;
import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ElasticsearchClient;
public class DeleteStoredScriptRequestBuilder extends AcknowledgedRequestBuilder<DeleteStoredScriptRequest,
DeleteStoredScriptResponse, DeleteStoredScriptRequestBuilder> {
AcknowledgedResponse, DeleteStoredScriptRequestBuilder> {
public DeleteStoredScriptRequestBuilder(ElasticsearchClient client, DeleteStoredScriptAction action) {
super(client, action, new DeleteStoredScriptRequest());

View File

@ -1,37 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.cluster.storedscripts;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.xcontent.XContentParser;
public class DeleteStoredScriptResponse extends AcknowledgedResponse {
DeleteStoredScriptResponse() {
}
public DeleteStoredScriptResponse(boolean acknowledged) {
super(acknowledged);
}
public static DeleteStoredScriptResponse fromXContent(XContentParser parser) {
return new DeleteStoredScriptResponse(parseAcknowledged(parser));
}
}

View File

@ -20,9 +20,10 @@
package org.elasticsearch.action.admin.cluster.storedscripts;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class PutStoredScriptAction extends Action<PutStoredScriptResponse> {
public class PutStoredScriptAction extends Action<AcknowledgedResponse> {
public static final PutStoredScriptAction INSTANCE = new PutStoredScriptAction();
public static final String NAME = "cluster:admin/script/put";
@ -34,7 +35,7 @@ public class PutStoredScriptAction extends Action<PutStoredScriptResponse> {
@Override
public PutStoredScriptResponse newResponse() {
return new PutStoredScriptResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -20,12 +20,13 @@
package org.elasticsearch.action.admin.cluster.storedscripts;
import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ElasticsearchClient;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.xcontent.XContentType;
public class PutStoredScriptRequestBuilder extends AcknowledgedRequestBuilder<PutStoredScriptRequest,
PutStoredScriptResponse, PutStoredScriptRequestBuilder> {
AcknowledgedResponse, PutStoredScriptRequestBuilder> {
public PutStoredScriptRequestBuilder(ElasticsearchClient client, PutStoredScriptAction action) {
super(client, action, new PutStoredScriptRequest());

View File

@ -1,33 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.cluster.storedscripts;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class PutStoredScriptResponse extends AcknowledgedResponse {
PutStoredScriptResponse() {
}
public PutStoredScriptResponse(boolean acknowledged) {
super(acknowledged);
}
}

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.admin.cluster.storedscripts;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
@ -33,8 +34,7 @@ import org.elasticsearch.script.ScriptService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
public class TransportDeleteStoredScriptAction extends TransportMasterNodeAction<DeleteStoredScriptRequest,
DeleteStoredScriptResponse> {
public class TransportDeleteStoredScriptAction extends TransportMasterNodeAction<DeleteStoredScriptRequest, AcknowledgedResponse> {
private final ScriptService scriptService;
@ -53,13 +53,13 @@ public class TransportDeleteStoredScriptAction extends TransportMasterNodeAction
}
@Override
protected DeleteStoredScriptResponse newResponse() {
return new DeleteStoredScriptResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
protected void masterOperation(DeleteStoredScriptRequest request, ClusterState state,
ActionListener<DeleteStoredScriptResponse> listener) throws Exception {
ActionListener<AcknowledgedResponse> listener) throws Exception {
scriptService.deleteStoredScript(clusterService, request, listener);
}

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.admin.cluster.storedscripts;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
@ -33,7 +34,7 @@ import org.elasticsearch.script.ScriptService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
public class TransportPutStoredScriptAction extends TransportMasterNodeAction<PutStoredScriptRequest, PutStoredScriptResponse> {
public class TransportPutStoredScriptAction extends TransportMasterNodeAction<PutStoredScriptRequest, AcknowledgedResponse> {
private final ScriptService scriptService;
@ -52,13 +53,13 @@ public class TransportPutStoredScriptAction extends TransportMasterNodeAction<Pu
}
@Override
protected PutStoredScriptResponse newResponse() {
return new PutStoredScriptResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
protected void masterOperation(PutStoredScriptRequest request, ClusterState state,
ActionListener<PutStoredScriptResponse> listener) throws Exception {
ActionListener<AcknowledgedResponse> listener) throws Exception {
scriptService.putStoredScript(clusterService, request, listener);
}

View File

@ -20,8 +20,9 @@
package org.elasticsearch.action.admin.indices.alias;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class IndicesAliasesAction extends Action<IndicesAliasesResponse> {
public class IndicesAliasesAction extends Action<AcknowledgedResponse> {
public static final IndicesAliasesAction INSTANCE = new IndicesAliasesAction();
public static final String NAME = "indices:admin/aliases";
@ -31,7 +32,7 @@ public class IndicesAliasesAction extends Action<IndicesAliasesResponse> {
}
@Override
public IndicesAliasesResponse newResponse() {
return new IndicesAliasesResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.admin.indices.alias;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ElasticsearchClient;
import org.elasticsearch.index.query.QueryBuilder;
@ -30,7 +31,7 @@ import java.util.Map;
* Builder for request to modify many aliases at once.
*/
public class IndicesAliasesRequestBuilder
extends AcknowledgedRequestBuilder<IndicesAliasesRequest, IndicesAliasesResponse, IndicesAliasesRequestBuilder> {
extends AcknowledgedRequestBuilder<IndicesAliasesRequest, AcknowledgedResponse, IndicesAliasesRequestBuilder> {
public IndicesAliasesRequestBuilder(ElasticsearchClient client, IndicesAliasesAction action) {
super(client, action, new IndicesAliasesRequest());

View File

@ -1,47 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.alias;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
import org.elasticsearch.common.xcontent.XContentParser;
/**
* A response for a add/remove alias action.
*/
public class IndicesAliasesResponse extends AcknowledgedResponse {
private static final ConstructingObjectParser<IndicesAliasesResponse, Void> PARSER = new ConstructingObjectParser<>("indices_aliases",
true, args -> new IndicesAliasesResponse((boolean) args[0]));
static {
declareAcknowledgedField(PARSER);
}
IndicesAliasesResponse() {
}
IndicesAliasesResponse(boolean acknowledged) {
super(acknowledged);
}
public static IndicesAliasesResponse fromXContent(XContentParser parser) {
return new IndicesAliasesResponse(parseAcknowledged(parser));
}
}

View File

@ -23,6 +23,7 @@ import com.carrotsearch.hppc.cursors.ObjectCursor;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ack.ClusterStateUpdateResponse;
@ -52,7 +53,7 @@ import static java.util.Collections.unmodifiableList;
/**
* Add/remove aliases action
*/
public class TransportIndicesAliasesAction extends TransportMasterNodeAction<IndicesAliasesRequest, IndicesAliasesResponse> {
public class TransportIndicesAliasesAction extends TransportMasterNodeAction<IndicesAliasesRequest, AcknowledgedResponse> {
private final MetaDataIndexAliasesService indexAliasesService;
@ -71,8 +72,8 @@ public class TransportIndicesAliasesAction extends TransportMasterNodeAction<Ind
}
@Override
protected IndicesAliasesResponse newResponse() {
return new IndicesAliasesResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
@ -85,7 +86,7 @@ public class TransportIndicesAliasesAction extends TransportMasterNodeAction<Ind
}
@Override
protected void masterOperation(final IndicesAliasesRequest request, final ClusterState state, final ActionListener<IndicesAliasesResponse> listener) {
protected void masterOperation(final IndicesAliasesRequest request, final ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
//Expand the indices names
List<AliasActions> actions = request.aliasActions();
@ -127,7 +128,7 @@ public class TransportIndicesAliasesAction extends TransportMasterNodeAction<Ind
indexAliasesService.indicesAliases(updateRequest, new ActionListener<ClusterStateUpdateResponse>() {
@Override
public void onResponse(ClusterStateUpdateResponse response) {
listener.onResponse(new IndicesAliasesResponse(response.isAcknowledged()));
listener.onResponse(new AcknowledgedResponse(response.isAcknowledged()));
}
@Override

View File

@ -20,8 +20,9 @@
package org.elasticsearch.action.admin.indices.close;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class CloseIndexAction extends Action<CloseIndexResponse> {
public class CloseIndexAction extends Action<AcknowledgedResponse> {
public static final CloseIndexAction INSTANCE = new CloseIndexAction();
public static final String NAME = "indices:admin/close";
@ -31,7 +32,7 @@ public class CloseIndexAction extends Action<CloseIndexResponse> {
}
@Override
public CloseIndexResponse newResponse() {
return new CloseIndexResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -21,12 +21,14 @@ package org.elasticsearch.action.admin.indices.close;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ElasticsearchClient;
/**
* Builder for close index request
*/
public class CloseIndexRequestBuilder extends AcknowledgedRequestBuilder<CloseIndexRequest, CloseIndexResponse, CloseIndexRequestBuilder> {
public class CloseIndexRequestBuilder
extends AcknowledgedRequestBuilder<CloseIndexRequest, AcknowledgedResponse, CloseIndexRequestBuilder> {
public CloseIndexRequestBuilder(ElasticsearchClient client, CloseIndexAction action) {
super(client, action, new CloseIndexRequest());

View File

@ -1,39 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.close;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.xcontent.XContentParser;
/**
* A response for a close index action.
*/
public class CloseIndexResponse extends AcknowledgedResponse {
CloseIndexResponse() {
}
CloseIndexResponse(boolean acknowledged) {
super(acknowledged);
}
public static CloseIndexResponse fromXContent(XContentParser parser) {
return new CloseIndexResponse(parseAcknowledged(parser));
}
}

View File

@ -23,6 +23,7 @@ import org.apache.logging.log4j.message.ParameterizedMessage;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.DestructiveOperations;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ack.ClusterStateUpdateResponse;
@ -44,7 +45,7 @@ import org.elasticsearch.transport.TransportService;
/**
* Close index action
*/
public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIndexRequest, CloseIndexResponse> {
public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIndexRequest, AcknowledgedResponse> {
private final MetaDataIndexStateService indexStateService;
private final DestructiveOperations destructiveOperations;
@ -75,12 +76,12 @@ public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIn
}
@Override
protected CloseIndexResponse newResponse() {
return new CloseIndexResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
protected void doExecute(Task task, CloseIndexRequest request, ActionListener<CloseIndexResponse> listener) {
protected void doExecute(Task task, CloseIndexRequest request, ActionListener<AcknowledgedResponse> listener) {
destructiveOperations.failDestructive(request.indices());
if (closeIndexEnabled == false) {
throw new IllegalStateException("closing indices is disabled - set [" + CLUSTER_INDICES_CLOSE_ENABLE_SETTING.getKey() + ": true] to enable it. NOTE: closed indices still consume a significant amount of diskspace");
@ -94,10 +95,10 @@ public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIn
}
@Override
protected void masterOperation(final CloseIndexRequest request, final ClusterState state, final ActionListener<CloseIndexResponse> listener) {
protected void masterOperation(final CloseIndexRequest request, final ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
final Index[] concreteIndices = indexNameExpressionResolver.concreteIndices(state, request);
if (concreteIndices == null || concreteIndices.length == 0) {
listener.onResponse(new CloseIndexResponse(true));
listener.onResponse(new AcknowledgedResponse(true));
return;
}
CloseIndexClusterStateUpdateRequest updateRequest = new CloseIndexClusterStateUpdateRequest()
@ -108,7 +109,7 @@ public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIn
@Override
public void onResponse(ClusterStateUpdateResponse response) {
listener.onResponse(new CloseIndexResponse(response.isAcknowledged()));
listener.onResponse(new AcknowledgedResponse(response.isAcknowledged()));
}
@Override

View File

@ -20,8 +20,9 @@
package org.elasticsearch.action.admin.indices.delete;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class DeleteIndexAction extends Action<DeleteIndexResponse> {
public class DeleteIndexAction extends Action<AcknowledgedResponse> {
public static final DeleteIndexAction INSTANCE = new DeleteIndexAction();
public static final String NAME = "indices:admin/delete";
@ -31,7 +32,7 @@ public class DeleteIndexAction extends Action<DeleteIndexResponse> {
}
@Override
public DeleteIndexResponse newResponse() {
return new DeleteIndexResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -21,9 +21,10 @@ package org.elasticsearch.action.admin.indices.delete;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ElasticsearchClient;
public class DeleteIndexRequestBuilder extends AcknowledgedRequestBuilder<DeleteIndexRequest, DeleteIndexResponse, DeleteIndexRequestBuilder> {
public class DeleteIndexRequestBuilder extends AcknowledgedRequestBuilder<DeleteIndexRequest, AcknowledgedResponse, DeleteIndexRequestBuilder> {
public DeleteIndexRequestBuilder(ElasticsearchClient client, DeleteIndexAction action, String... indices) {
super(client, action, new DeleteIndexRequest(indices));

View File

@ -1,40 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.delete;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.xcontent.XContentParser;
/**
* A response for a delete index action.
*/
public class DeleteIndexResponse extends AcknowledgedResponse {
DeleteIndexResponse() {
}
DeleteIndexResponse(boolean acknowledged) {
super(acknowledged);
}
public static DeleteIndexResponse fromXContent(XContentParser parser) {
return new DeleteIndexResponse(parseAcknowledged(parser));
}
}

View File

@ -23,6 +23,7 @@ import org.apache.logging.log4j.message.ParameterizedMessage;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.DestructiveOperations;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ack.ClusterStateUpdateResponse;
@ -44,7 +45,7 @@ import java.util.Set;
/**
* Delete index action.
*/
public class TransportDeleteIndexAction extends TransportMasterNodeAction<DeleteIndexRequest, DeleteIndexResponse> {
public class TransportDeleteIndexAction extends TransportMasterNodeAction<DeleteIndexRequest, AcknowledgedResponse> {
private final MetaDataDeleteIndexService deleteIndexService;
private final DestructiveOperations destructiveOperations;
@ -64,12 +65,12 @@ public class TransportDeleteIndexAction extends TransportMasterNodeAction<Delete
}
@Override
protected DeleteIndexResponse newResponse() {
return new DeleteIndexResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
protected void doExecute(Task task, DeleteIndexRequest request, ActionListener<DeleteIndexResponse> listener) {
protected void doExecute(Task task, DeleteIndexRequest request, ActionListener<AcknowledgedResponse> listener) {
destructiveOperations.failDestructive(request.indices());
super.doExecute(task, request, listener);
}
@ -80,10 +81,10 @@ public class TransportDeleteIndexAction extends TransportMasterNodeAction<Delete
}
@Override
protected void masterOperation(final DeleteIndexRequest request, final ClusterState state, final ActionListener<DeleteIndexResponse> listener) {
protected void masterOperation(final DeleteIndexRequest request, final ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
final Set<Index> concreteIndices = new HashSet<>(Arrays.asList(indexNameExpressionResolver.concreteIndices(state, request)));
if (concreteIndices.isEmpty()) {
listener.onResponse(new DeleteIndexResponse(true));
listener.onResponse(new AcknowledgedResponse(true));
return;
}
@ -95,7 +96,7 @@ public class TransportDeleteIndexAction extends TransportMasterNodeAction<Delete
@Override
public void onResponse(ClusterStateUpdateResponse response) {
listener.onResponse(new DeleteIndexResponse(response.isAcknowledged()));
listener.onResponse(new AcknowledgedResponse(response.isAcknowledged()));
}
@Override

View File

@ -20,8 +20,9 @@
package org.elasticsearch.action.admin.indices.mapping.put;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class PutMappingAction extends Action<PutMappingResponse> {
public class PutMappingAction extends Action<AcknowledgedResponse> {
public static final PutMappingAction INSTANCE = new PutMappingAction();
public static final String NAME = "indices:admin/mapping/put";
@ -31,7 +32,7 @@ public class PutMappingAction extends Action<PutMappingResponse> {
}
@Override
public PutMappingResponse newResponse() {
return new PutMappingResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -27,6 +27,7 @@ import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.AcknowledgedRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
@ -57,7 +58,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
*
* @see org.elasticsearch.client.Requests#putMappingRequest(String...)
* @see org.elasticsearch.client.IndicesAdminClient#putMapping(PutMappingRequest)
* @see PutMappingResponse
* @see AcknowledgedResponse
*/
public class PutMappingRequest extends AcknowledgedRequest<PutMappingRequest> implements IndicesRequest.Replaceable, ToXContentObject {

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.admin.indices.mapping.put;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ElasticsearchClient;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentType;
@ -31,7 +32,8 @@ import java.util.Map;
/**
* Builder for a put mapping request
*/
public class PutMappingRequestBuilder extends AcknowledgedRequestBuilder<PutMappingRequest, PutMappingResponse, PutMappingRequestBuilder> {
public class PutMappingRequestBuilder
extends AcknowledgedRequestBuilder<PutMappingRequest, AcknowledgedResponse, PutMappingRequestBuilder> {
public PutMappingRequestBuilder(ElasticsearchClient client, PutMappingAction action) {
super(client, action, new PutMappingRequest());

View File

@ -1,40 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.mapping.put;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.xcontent.XContentParser;
/**
* The response of put mapping operation.
*/
public class PutMappingResponse extends AcknowledgedResponse {
protected PutMappingResponse() {
}
protected PutMappingResponse(boolean acknowledged) {
super(acknowledged);
}
public static PutMappingResponse fromXContent(XContentParser parser) {
return new PutMappingResponse(parseAcknowledged(parser));
}
}

View File

@ -22,6 +22,7 @@ package org.elasticsearch.action.admin.indices.mapping.put;
import org.apache.logging.log4j.message.ParameterizedMessage;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ack.ClusterStateUpdateResponse;
@ -40,7 +41,7 @@ import org.elasticsearch.transport.TransportService;
/**
* Put mapping action.
*/
public class TransportPutMappingAction extends TransportMasterNodeAction<PutMappingRequest, PutMappingResponse> {
public class TransportPutMappingAction extends TransportMasterNodeAction<PutMappingRequest, AcknowledgedResponse> {
private final MetaDataMappingService metaDataMappingService;
@ -59,8 +60,8 @@ public class TransportPutMappingAction extends TransportMasterNodeAction<PutMapp
}
@Override
protected PutMappingResponse newResponse() {
return new PutMappingResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
@ -75,7 +76,7 @@ public class TransportPutMappingAction extends TransportMasterNodeAction<PutMapp
}
@Override
protected void masterOperation(final PutMappingRequest request, final ClusterState state, final ActionListener<PutMappingResponse> listener) {
protected void masterOperation(final PutMappingRequest request, final ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
try {
final Index[] concreteIndices = request.getConcreteIndex() == null ? indexNameExpressionResolver.concreteIndices(state, request) : new Index[] {request.getConcreteIndex()};
PutMappingClusterStateUpdateRequest updateRequest = new PutMappingClusterStateUpdateRequest()
@ -87,7 +88,7 @@ public class TransportPutMappingAction extends TransportMasterNodeAction<PutMapp
@Override
public void onResponse(ClusterStateUpdateResponse response) {
listener.onResponse(new PutMappingResponse(response.isAcknowledged()));
listener.onResponse(new AcknowledgedResponse(response.isAcknowledged()));
}
@Override

View File

@ -22,6 +22,7 @@ package org.elasticsearch.action.admin.indices.settings.put;
import org.apache.logging.log4j.message.ParameterizedMessage;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ack.ClusterStateUpdateResponse;
@ -37,7 +38,7 @@ import org.elasticsearch.index.Index;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
public class TransportUpdateSettingsAction extends TransportMasterNodeAction<UpdateSettingsRequest, UpdateSettingsResponse> {
public class TransportUpdateSettingsAction extends TransportMasterNodeAction<UpdateSettingsRequest, AcknowledgedResponse> {
private final MetaDataUpdateSettingsService updateSettingsService;
@ -71,12 +72,12 @@ public class TransportUpdateSettingsAction extends TransportMasterNodeAction<Upd
}
@Override
protected UpdateSettingsResponse newResponse() {
return new UpdateSettingsResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
protected void masterOperation(final UpdateSettingsRequest request, final ClusterState state, final ActionListener<UpdateSettingsResponse> listener) {
protected void masterOperation(final UpdateSettingsRequest request, final ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
final Index[] concreteIndices = indexNameExpressionResolver.concreteIndices(state, request);
UpdateSettingsClusterStateUpdateRequest clusterStateUpdateRequest = new UpdateSettingsClusterStateUpdateRequest()
.indices(concreteIndices)
@ -88,7 +89,7 @@ public class TransportUpdateSettingsAction extends TransportMasterNodeAction<Upd
updateSettingsService.updateSettings(clusterStateUpdateRequest, new ActionListener<ClusterStateUpdateResponse>() {
@Override
public void onResponse(ClusterStateUpdateResponse response) {
listener.onResponse(new UpdateSettingsResponse(response.isAcknowledged()));
listener.onResponse(new AcknowledgedResponse(response.isAcknowledged()));
}
@Override

View File

@ -20,8 +20,9 @@
package org.elasticsearch.action.admin.indices.settings.put;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class UpdateSettingsAction extends Action<UpdateSettingsResponse> {
public class UpdateSettingsAction extends Action<AcknowledgedResponse> {
public static final UpdateSettingsAction INSTANCE = new UpdateSettingsAction();
public static final String NAME = "indices:admin/settings/update";
@ -31,7 +32,7 @@ public class UpdateSettingsAction extends Action<UpdateSettingsResponse> {
}
@Override
public UpdateSettingsResponse newResponse() {
return new UpdateSettingsResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.admin.indices.settings.put;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ElasticsearchClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentType;
@ -30,7 +31,7 @@ import java.util.Map;
/**
* Builder for an update index settings request
*/
public class UpdateSettingsRequestBuilder extends AcknowledgedRequestBuilder<UpdateSettingsRequest, UpdateSettingsResponse, UpdateSettingsRequestBuilder> {
public class UpdateSettingsRequestBuilder extends AcknowledgedRequestBuilder<UpdateSettingsRequest, AcknowledgedResponse, UpdateSettingsRequestBuilder> {
public UpdateSettingsRequestBuilder(ElasticsearchClient client, UpdateSettingsAction action, String... indices) {
super(client, action, new UpdateSettingsRequest(indices));

View File

@ -1,40 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.settings.put;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.xcontent.XContentParser;
/**
* A response for an update index settings action
*/
public class UpdateSettingsResponse extends AcknowledgedResponse {
UpdateSettingsResponse() {
}
UpdateSettingsResponse(boolean acknowledged) {
super(acknowledged);
}
public static UpdateSettingsResponse fromXContent(XContentParser parser) {
return new UpdateSettingsResponse(parseAcknowledged(parser));
}
}

View File

@ -20,8 +20,9 @@
package org.elasticsearch.action.admin.indices.template.delete;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class DeleteIndexTemplateAction extends Action<DeleteIndexTemplateResponse> {
public class DeleteIndexTemplateAction extends Action<AcknowledgedResponse> {
public static final DeleteIndexTemplateAction INSTANCE = new DeleteIndexTemplateAction();
public static final String NAME = "indices:admin/template/delete";
@ -31,7 +32,7 @@ public class DeleteIndexTemplateAction extends Action<DeleteIndexTemplateRespons
}
@Override
public DeleteIndexTemplateResponse newResponse() {
return new DeleteIndexTemplateResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -18,10 +18,11 @@
*/
package org.elasticsearch.action.admin.indices.template.delete;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
import org.elasticsearch.client.ElasticsearchClient;
public class DeleteIndexTemplateRequestBuilder extends MasterNodeOperationRequestBuilder<DeleteIndexTemplateRequest, DeleteIndexTemplateResponse, DeleteIndexTemplateRequestBuilder> {
public class DeleteIndexTemplateRequestBuilder extends MasterNodeOperationRequestBuilder<DeleteIndexTemplateRequest, AcknowledgedResponse, DeleteIndexTemplateRequestBuilder> {
public DeleteIndexTemplateRequestBuilder(ElasticsearchClient client, DeleteIndexTemplateAction action) {
super(client, action, new DeleteIndexTemplateRequest());

View File

@ -1,34 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.template.delete;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
/**
* A response for a delete index template.
*/
public class DeleteIndexTemplateResponse extends AcknowledgedResponse {
DeleteIndexTemplateResponse() {
}
protected DeleteIndexTemplateResponse(boolean acknowledged) {
super(acknowledged);
}
}

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.admin.indices.template.delete;
import org.apache.logging.log4j.message.ParameterizedMessage;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
@ -36,7 +37,7 @@ import org.elasticsearch.transport.TransportService;
/**
* Delete index action.
*/
public class TransportDeleteIndexTemplateAction extends TransportMasterNodeAction<DeleteIndexTemplateRequest, DeleteIndexTemplateResponse> {
public class TransportDeleteIndexTemplateAction extends TransportMasterNodeAction<DeleteIndexTemplateRequest, AcknowledgedResponse> {
private final MetaDataIndexTemplateService indexTemplateService;
@ -55,8 +56,8 @@ public class TransportDeleteIndexTemplateAction extends TransportMasterNodeActio
}
@Override
protected DeleteIndexTemplateResponse newResponse() {
return new DeleteIndexTemplateResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
@ -65,11 +66,11 @@ public class TransportDeleteIndexTemplateAction extends TransportMasterNodeActio
}
@Override
protected void masterOperation(final DeleteIndexTemplateRequest request, final ClusterState state, final ActionListener<DeleteIndexTemplateResponse> listener) {
protected void masterOperation(final DeleteIndexTemplateRequest request, final ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
indexTemplateService.removeTemplates(new MetaDataIndexTemplateService.RemoveRequest(request.name()).masterTimeout(request.masterNodeTimeout()), new MetaDataIndexTemplateService.RemoveListener() {
@Override
public void onResponse(MetaDataIndexTemplateService.RemoveResponse response) {
listener.onResponse(new DeleteIndexTemplateResponse(response.acknowledged()));
listener.onResponse(new AcknowledgedResponse(response.acknowledged()));
}
@Override

View File

@ -20,8 +20,9 @@
package org.elasticsearch.action.admin.indices.template.put;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class PutIndexTemplateAction extends Action<PutIndexTemplateResponse> {
public class PutIndexTemplateAction extends Action<AcknowledgedResponse> {
public static final PutIndexTemplateAction INSTANCE = new PutIndexTemplateAction();
public static final String NAME = "indices:admin/template/put";
@ -31,7 +32,7 @@ public class PutIndexTemplateAction extends Action<PutIndexTemplateResponse> {
}
@Override
public PutIndexTemplateResponse newResponse() {
return new PutIndexTemplateResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -19,6 +19,7 @@
package org.elasticsearch.action.admin.indices.template.put;
import org.elasticsearch.action.admin.indices.alias.Alias;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.MasterNodeOperationRequestBuilder;
import org.elasticsearch.client.ElasticsearchClient;
import org.elasticsearch.common.bytes.BytesReference;
@ -31,7 +32,7 @@ import java.util.List;
import java.util.Map;
public class PutIndexTemplateRequestBuilder
extends MasterNodeOperationRequestBuilder<PutIndexTemplateRequest, PutIndexTemplateResponse, PutIndexTemplateRequestBuilder> {
extends MasterNodeOperationRequestBuilder<PutIndexTemplateRequest, AcknowledgedResponse, PutIndexTemplateRequestBuilder> {
public PutIndexTemplateRequestBuilder(ElasticsearchClient client, PutIndexTemplateAction action) {
super(client, action, new PutIndexTemplateRequest());

View File

@ -1,39 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.template.put;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.xcontent.XContentParser;
/**
* A response for a put index template action.
*/
public class PutIndexTemplateResponse extends AcknowledgedResponse {
protected PutIndexTemplateResponse() {
}
protected PutIndexTemplateResponse(boolean acknowledged) {
super(acknowledged);
}
public static PutIndexTemplateResponse fromXContent(XContentParser parser) {
return new PutIndexTemplateResponse(parseAcknowledged(parser));
}
}

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.admin.indices.template.put;
import org.apache.logging.log4j.message.ParameterizedMessage;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
@ -38,7 +39,7 @@ import org.elasticsearch.transport.TransportService;
/**
* Put index template action.
*/
public class TransportPutIndexTemplateAction extends TransportMasterNodeAction<PutIndexTemplateRequest, PutIndexTemplateResponse> {
public class TransportPutIndexTemplateAction extends TransportMasterNodeAction<PutIndexTemplateRequest, AcknowledgedResponse> {
private final MetaDataIndexTemplateService indexTemplateService;
private final IndexScopedSettings indexScopedSettings;
@ -59,8 +60,8 @@ public class TransportPutIndexTemplateAction extends TransportMasterNodeAction<P
}
@Override
protected PutIndexTemplateResponse newResponse() {
return new PutIndexTemplateResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
@ -69,7 +70,7 @@ public class TransportPutIndexTemplateAction extends TransportMasterNodeAction<P
}
@Override
protected void masterOperation(final PutIndexTemplateRequest request, final ClusterState state, final ActionListener<PutIndexTemplateResponse> listener) {
protected void masterOperation(final PutIndexTemplateRequest request, final ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
String cause = request.cause();
if (cause.length() == 0) {
cause = "api";
@ -91,7 +92,7 @@ public class TransportPutIndexTemplateAction extends TransportMasterNodeAction<P
new MetaDataIndexTemplateService.PutListener() {
@Override
public void onResponse(MetaDataIndexTemplateService.PutResponse response) {
listener.onResponse(new PutIndexTemplateResponse(response.acknowledged()));
listener.onResponse(new AcknowledgedResponse(response.acknowledged()));
}
@Override

View File

@ -25,6 +25,7 @@ import org.elasticsearch.action.PrimaryMissingActionException;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.DefaultShardOperationFailedException;
import org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeAction;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException;
@ -205,9 +206,9 @@ public class TransportUpgradeAction extends TransportBroadcastByNodeAction<Upgra
private void updateSettings(final UpgradeResponse upgradeResponse, final ActionListener<UpgradeResponse> listener) {
UpgradeSettingsRequest upgradeSettingsRequest = new UpgradeSettingsRequest(upgradeResponse.versions());
client.executeLocally(UpgradeSettingsAction.INSTANCE, upgradeSettingsRequest, new ActionListener<UpgradeSettingsResponse>() {
client.executeLocally(UpgradeSettingsAction.INSTANCE, upgradeSettingsRequest, new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(UpgradeSettingsResponse updateSettingsResponse) {
public void onResponse(AcknowledgedResponse updateSettingsResponse) {
listener.onResponse(upgradeResponse);
}

View File

@ -22,6 +22,7 @@ package org.elasticsearch.action.admin.indices.upgrade.post;
import org.apache.logging.log4j.message.ParameterizedMessage;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ack.ClusterStateUpdateResponse;
@ -35,7 +36,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
public class TransportUpgradeSettingsAction extends TransportMasterNodeAction<UpgradeSettingsRequest, UpgradeSettingsResponse> {
public class TransportUpgradeSettingsAction extends TransportMasterNodeAction<UpgradeSettingsRequest, AcknowledgedResponse> {
private final MetaDataUpdateSettingsService updateSettingsService;
@ -58,12 +59,12 @@ public class TransportUpgradeSettingsAction extends TransportMasterNodeAction<Up
}
@Override
protected UpgradeSettingsResponse newResponse() {
return new UpgradeSettingsResponse();
protected AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
@Override
protected void masterOperation(final UpgradeSettingsRequest request, final ClusterState state, final ActionListener<UpgradeSettingsResponse> listener) {
protected void masterOperation(final UpgradeSettingsRequest request, final ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
UpgradeSettingsClusterStateUpdateRequest clusterStateUpdateRequest = new UpgradeSettingsClusterStateUpdateRequest()
.ackTimeout(request.timeout())
.versions(request.versions())
@ -72,7 +73,7 @@ public class TransportUpgradeSettingsAction extends TransportMasterNodeAction<Up
updateSettingsService.upgradeIndexSettings(clusterStateUpdateRequest, new ActionListener<ClusterStateUpdateResponse>() {
@Override
public void onResponse(ClusterStateUpdateResponse response) {
listener.onResponse(new UpgradeSettingsResponse(response.isAcknowledged()));
listener.onResponse(new AcknowledgedResponse(response.isAcknowledged()));
}
@Override

View File

@ -20,8 +20,9 @@
package org.elasticsearch.action.admin.indices.upgrade.post;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
public class UpgradeSettingsAction extends Action<UpgradeSettingsResponse> {
public class UpgradeSettingsAction extends Action<AcknowledgedResponse> {
public static final UpgradeSettingsAction INSTANCE = new UpgradeSettingsAction();
public static final String NAME = "internal:indices/admin/upgrade";
@ -31,7 +32,7 @@ public class UpgradeSettingsAction extends Action<UpgradeSettingsResponse> {
}
@Override
public UpgradeSettingsResponse newResponse() {
return new UpgradeSettingsResponse();
public AcknowledgedResponse newResponse() {
return new AcknowledgedResponse();
}
}

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.admin.indices.upgrade.post;
import org.elasticsearch.Version;
import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.ElasticsearchClient;
import org.elasticsearch.common.collect.Tuple;
@ -29,7 +30,7 @@ import java.util.Map;
/**
* Builder for an update index settings request
*/
public class UpgradeSettingsRequestBuilder extends AcknowledgedRequestBuilder<UpgradeSettingsRequest, UpgradeSettingsResponse, UpgradeSettingsRequestBuilder> {
public class UpgradeSettingsRequestBuilder extends AcknowledgedRequestBuilder<UpgradeSettingsRequest, AcknowledgedResponse, UpgradeSettingsRequestBuilder> {
public UpgradeSettingsRequestBuilder(ElasticsearchClient client, UpgradeSettingsAction action) {
super(client, action, new UpgradeSettingsRequest());

View File

@ -1,35 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.upgrade.post;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
/**
* A response for an update index settings action
*/
public class UpgradeSettingsResponse extends AcknowledgedResponse {
UpgradeSettingsResponse() {
}
UpgradeSettingsResponse(boolean acknowledged) {
super(acknowledged);
}
}

View File

@ -98,11 +98,6 @@ public class AcknowledgedResponse extends ActionResponse implements ToXContentOb
ObjectParser.ValueType.BOOLEAN);
}
@Deprecated
public static boolean parseAcknowledged(XContentParser parser) {
return ACKNOWLEDGED_FLAG_PARSER.apply(parser, null);
}
public static AcknowledgedResponse fromXContent(XContentParser parser) throws IOException {
return new AcknowledgedResponse(ACKNOWLEDGED_FLAG_PARSER.apply(parser, null));
}

View File

@ -51,13 +51,11 @@ import org.elasticsearch.action.admin.cluster.node.usage.NodesUsageRequestBuilde
import org.elasticsearch.action.admin.cluster.node.usage.NodesUsageResponse;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequestBuilder;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesRequest;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesRequestBuilder;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesResponse;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequestBuilder;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequestBuilder;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryResponse;
@ -75,7 +73,6 @@ import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotReq
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequestBuilder;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequestBuilder;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse;
@ -93,13 +90,11 @@ import org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequestBuilder;
import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequestBuilder;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptResponse;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequestBuilder;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptResponse;
import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequestBuilder;
import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptResponse;
import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksRequest;
import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksRequestBuilder;
import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksResponse;
@ -416,12 +411,12 @@ public interface ClusterAdminClient extends ElasticsearchClient {
/**
* Registers a snapshot repository.
*/
ActionFuture<PutRepositoryResponse> putRepository(PutRepositoryRequest request);
ActionFuture<AcknowledgedResponse> putRepository(PutRepositoryRequest request);
/**
* Registers a snapshot repository.
*/
void putRepository(PutRepositoryRequest request, ActionListener<PutRepositoryResponse> listener);
void putRepository(PutRepositoryRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Registers a snapshot repository.
@ -431,12 +426,12 @@ public interface ClusterAdminClient extends ElasticsearchClient {
/**
* Unregisters a repository.
*/
ActionFuture<DeleteRepositoryResponse> deleteRepository(DeleteRepositoryRequest request);
ActionFuture<AcknowledgedResponse> deleteRepository(DeleteRepositoryRequest request);
/**
* Unregisters a repository.
*/
void deleteRepository(DeleteRepositoryRequest request, ActionListener<DeleteRepositoryResponse> listener);
void deleteRepository(DeleteRepositoryRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Unregisters a repository.
@ -506,12 +501,12 @@ public interface ClusterAdminClient extends ElasticsearchClient {
/**
* Delete snapshot.
*/
ActionFuture<DeleteSnapshotResponse> deleteSnapshot(DeleteSnapshotRequest request);
ActionFuture<AcknowledgedResponse> deleteSnapshot(DeleteSnapshotRequest request);
/**
* Delete snapshot.
*/
void deleteSnapshot(DeleteSnapshotRequest request, ActionListener<DeleteSnapshotResponse> listener);
void deleteSnapshot(DeleteSnapshotRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Delete snapshot.
@ -672,12 +667,12 @@ public interface ClusterAdminClient extends ElasticsearchClient {
/**
* Delete a script from the cluster state
*/
void deleteStoredScript(DeleteStoredScriptRequest request, ActionListener<DeleteStoredScriptResponse> listener);
void deleteStoredScript(DeleteStoredScriptRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Delete a script from the cluster state
*/
ActionFuture<DeleteStoredScriptResponse> deleteStoredScript(DeleteStoredScriptRequest request);
ActionFuture<AcknowledgedResponse> deleteStoredScript(DeleteStoredScriptRequest request);
/**
* Delete a script from the cluster state
@ -692,12 +687,12 @@ public interface ClusterAdminClient extends ElasticsearchClient {
/**
* Store a script in the cluster state
*/
void putStoredScript(PutStoredScriptRequest request, ActionListener<PutStoredScriptResponse> listener);
void putStoredScript(PutStoredScriptRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Store a script in the cluster state
*/
ActionFuture<PutStoredScriptResponse> putStoredScript(PutStoredScriptRequest request);
ActionFuture<AcknowledgedResponse> putStoredScript(PutStoredScriptRequest request);
/**
* Get a script from the cluster state

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequestBuilder;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistResponse;
import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest;
@ -37,13 +36,11 @@ import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheReque
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse;
import org.elasticsearch.action.admin.indices.close.CloseIndexRequest;
import org.elasticsearch.action.admin.indices.close.CloseIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.close.CloseIndexResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest;
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequestBuilder;
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse;
@ -70,7 +67,6 @@ import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequestBuil
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest;
import org.elasticsearch.action.admin.indices.open.OpenIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.open.OpenIndexResponse;
@ -91,7 +87,6 @@ import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequestBui
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequestBuilder;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse;
import org.elasticsearch.action.admin.indices.shards.IndicesShardStoreRequestBuilder;
import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresRequest;
import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresResponse;
@ -103,13 +98,11 @@ import org.elasticsearch.action.admin.indices.stats.IndicesStatsRequestBuilder;
import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequestBuilder;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateResponse;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequest;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequestBuilder;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequestBuilder;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateResponse;
import org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusRequest;
import org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusRequestBuilder;
import org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusResponse;
@ -119,6 +112,7 @@ import org.elasticsearch.action.admin.indices.upgrade.post.UpgradeResponse;
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequest;
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequestBuilder;
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.Nullable;
/**
@ -281,7 +275,7 @@ public interface IndicesAdminClient extends ElasticsearchClient {
* @return The result future
* @see org.elasticsearch.client.Requests#deleteIndexRequest(String)
*/
ActionFuture<DeleteIndexResponse> delete(DeleteIndexRequest request);
ActionFuture<AcknowledgedResponse> delete(DeleteIndexRequest request);
/**
* Deletes an index based on the index name.
@ -290,7 +284,7 @@ public interface IndicesAdminClient extends ElasticsearchClient {
* @param listener A listener to be notified with a result
* @see org.elasticsearch.client.Requests#deleteIndexRequest(String)
*/
void delete(DeleteIndexRequest request, ActionListener<DeleteIndexResponse> listener);
void delete(DeleteIndexRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Deletes an index based on the index name.
@ -306,7 +300,7 @@ public interface IndicesAdminClient extends ElasticsearchClient {
* @return The result future
* @see org.elasticsearch.client.Requests#closeIndexRequest(String)
*/
ActionFuture<CloseIndexResponse> close(CloseIndexRequest request);
ActionFuture<AcknowledgedResponse> close(CloseIndexRequest request);
/**
* Closes an index based on the index name.
@ -315,7 +309,7 @@ public interface IndicesAdminClient extends ElasticsearchClient {
* @param listener A listener to be notified with a result
* @see org.elasticsearch.client.Requests#closeIndexRequest(String)
*/
void close(CloseIndexRequest request, ActionListener<CloseIndexResponse> listener);
void close(CloseIndexRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Closes one or more indices based on their index name.
@ -524,7 +518,7 @@ public interface IndicesAdminClient extends ElasticsearchClient {
* @return A result future
* @see org.elasticsearch.client.Requests#putMappingRequest(String...)
*/
ActionFuture<PutMappingResponse> putMapping(PutMappingRequest request);
ActionFuture<AcknowledgedResponse> putMapping(PutMappingRequest request);
/**
* Add mapping definition for a type into one or more indices.
@ -533,7 +527,7 @@ public interface IndicesAdminClient extends ElasticsearchClient {
* @param listener A listener to be notified with a result
* @see org.elasticsearch.client.Requests#putMappingRequest(String...)
*/
void putMapping(PutMappingRequest request, ActionListener<PutMappingResponse> listener);
void putMapping(PutMappingRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Add mapping definition for a type into one or more indices.
@ -547,7 +541,7 @@ public interface IndicesAdminClient extends ElasticsearchClient {
* @return The result future
* @see Requests#indexAliasesRequest()
*/
ActionFuture<IndicesAliasesResponse> aliases(IndicesAliasesRequest request);
ActionFuture<AcknowledgedResponse> aliases(IndicesAliasesRequest request);
/**
* Allows to add/remove aliases from indices.
@ -556,7 +550,7 @@ public interface IndicesAdminClient extends ElasticsearchClient {
* @param listener A listener to be notified with a result
* @see Requests#indexAliasesRequest()
*/
void aliases(IndicesAliasesRequest request, ActionListener<IndicesAliasesResponse> listener);
void aliases(IndicesAliasesRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Allows to add/remove aliases from indices.
@ -652,7 +646,7 @@ public interface IndicesAdminClient extends ElasticsearchClient {
* @param request the update settings request
* @return The result future
*/
ActionFuture<UpdateSettingsResponse> updateSettings(UpdateSettingsRequest request);
ActionFuture<AcknowledgedResponse> updateSettings(UpdateSettingsRequest request);
/**
* Updates settings of one or more indices.
@ -660,7 +654,7 @@ public interface IndicesAdminClient extends ElasticsearchClient {
* @param request the update settings request
* @param listener A listener to be notified with the response
*/
void updateSettings(UpdateSettingsRequest request, ActionListener<UpdateSettingsResponse> listener);
void updateSettings(UpdateSettingsRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Update indices settings.
@ -701,12 +695,12 @@ public interface IndicesAdminClient extends ElasticsearchClient {
/**
* Puts an index template.
*/
ActionFuture<PutIndexTemplateResponse> putTemplate(PutIndexTemplateRequest request);
ActionFuture<AcknowledgedResponse> putTemplate(PutIndexTemplateRequest request);
/**
* Puts an index template.
*/
void putTemplate(PutIndexTemplateRequest request, ActionListener<PutIndexTemplateResponse> listener);
void putTemplate(PutIndexTemplateRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Puts an index template.
@ -718,12 +712,12 @@ public interface IndicesAdminClient extends ElasticsearchClient {
/**
* Deletes index template.
*/
ActionFuture<DeleteIndexTemplateResponse> deleteTemplate(DeleteIndexTemplateRequest request);
ActionFuture<AcknowledgedResponse> deleteTemplate(DeleteIndexTemplateRequest request);
/**
* Deletes an index template.
*/
void deleteTemplate(DeleteIndexTemplateRequest request, ActionListener<DeleteIndexTemplateResponse> listener);
void deleteTemplate(DeleteIndexTemplateRequest request, ActionListener<AcknowledgedResponse> listener);
/**
* Deletes an index template.

View File

@ -65,7 +65,6 @@ import org.elasticsearch.action.admin.cluster.node.usage.NodesUsageResponse;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryAction;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequestBuilder;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryResponse;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesAction;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesRequest;
import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesRequestBuilder;
@ -73,7 +72,6 @@ import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesRe
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryAction;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequestBuilder;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryAction;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequestBuilder;
@ -97,7 +95,6 @@ import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRes
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotAction;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequestBuilder;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsAction;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequestBuilder;
@ -121,7 +118,6 @@ import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptAction;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequestBuilder;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptResponse;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptAction;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequestBuilder;
@ -129,7 +125,6 @@ import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRespo
import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptAction;
import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequestBuilder;
import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptResponse;
import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksAction;
import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksRequest;
import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksRequestBuilder;
@ -137,7 +132,6 @@ import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksResponse;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesAction;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequestBuilder;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistAction;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistResponse;
@ -156,7 +150,6 @@ import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheRespo
import org.elasticsearch.action.admin.indices.close.CloseIndexAction;
import org.elasticsearch.action.admin.indices.close.CloseIndexRequest;
import org.elasticsearch.action.admin.indices.close.CloseIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.close.CloseIndexResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexAction;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
@ -164,7 +157,6 @@ import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexAction;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsAction;
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest;
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequestBuilder;
@ -200,7 +192,6 @@ import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingAction;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.admin.indices.open.OpenIndexAction;
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest;
import org.elasticsearch.action.admin.indices.open.OpenIndexRequestBuilder;
@ -228,7 +219,6 @@ import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsAction;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequestBuilder;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse;
import org.elasticsearch.action.admin.indices.shards.IndicesShardStoreRequestBuilder;
import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresAction;
import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresRequest;
@ -244,7 +234,6 @@ import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateAction;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequestBuilder;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateResponse;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesAction;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequest;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequestBuilder;
@ -252,7 +241,6 @@ import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResp
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateAction;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequestBuilder;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateResponse;
import org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusAction;
import org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusRequest;
import org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusRequestBuilder;
@ -939,12 +927,12 @@ public abstract class AbstractClient extends AbstractComponent implements Client
}
@Override
public ActionFuture<PutRepositoryResponse> putRepository(PutRepositoryRequest request) {
public ActionFuture<AcknowledgedResponse> putRepository(PutRepositoryRequest request) {
return execute(PutRepositoryAction.INSTANCE, request);
}
@Override
public void putRepository(PutRepositoryRequest request, ActionListener<PutRepositoryResponse> listener) {
public void putRepository(PutRepositoryRequest request, ActionListener<AcknowledgedResponse> listener) {
execute(PutRepositoryAction.INSTANCE, request, listener);
}
@ -985,12 +973,12 @@ public abstract class AbstractClient extends AbstractComponent implements Client
@Override
public ActionFuture<DeleteSnapshotResponse> deleteSnapshot(DeleteSnapshotRequest request) {
public ActionFuture<AcknowledgedResponse> deleteSnapshot(DeleteSnapshotRequest request) {
return execute(DeleteSnapshotAction.INSTANCE, request);
}
@Override
public void deleteSnapshot(DeleteSnapshotRequest request, ActionListener<DeleteSnapshotResponse> listener) {
public void deleteSnapshot(DeleteSnapshotRequest request, ActionListener<AcknowledgedResponse> listener) {
execute(DeleteSnapshotAction.INSTANCE, request, listener);
}
@ -1001,12 +989,12 @@ public abstract class AbstractClient extends AbstractComponent implements Client
@Override
public ActionFuture<DeleteRepositoryResponse> deleteRepository(DeleteRepositoryRequest request) {
public ActionFuture<AcknowledgedResponse> deleteRepository(DeleteRepositoryRequest request) {
return execute(DeleteRepositoryAction.INSTANCE, request);
}
@Override
public void deleteRepository(DeleteRepositoryRequest request, ActionListener<DeleteRepositoryResponse> listener) {
public void deleteRepository(DeleteRepositoryRequest request, ActionListener<AcknowledgedResponse> listener) {
execute(DeleteRepositoryAction.INSTANCE, request, listener);
}
@ -1197,23 +1185,23 @@ public abstract class AbstractClient extends AbstractComponent implements Client
}
@Override
public void putStoredScript(final PutStoredScriptRequest request, ActionListener<PutStoredScriptResponse> listener){
public void putStoredScript(final PutStoredScriptRequest request, ActionListener<AcknowledgedResponse> listener){
execute(PutStoredScriptAction.INSTANCE, request, listener);
}
@Override
public ActionFuture<PutStoredScriptResponse> putStoredScript(final PutStoredScriptRequest request){
public ActionFuture<AcknowledgedResponse> putStoredScript(final PutStoredScriptRequest request){
return execute(PutStoredScriptAction.INSTANCE, request);
}
@Override
public void deleteStoredScript(DeleteStoredScriptRequest request, ActionListener<DeleteStoredScriptResponse> listener){
public void deleteStoredScript(DeleteStoredScriptRequest request, ActionListener<AcknowledgedResponse> listener){
execute(DeleteStoredScriptAction.INSTANCE, request, listener);
}
@Override
public ActionFuture<DeleteStoredScriptResponse> deleteStoredScript(DeleteStoredScriptRequest request){
public ActionFuture<AcknowledgedResponse> deleteStoredScript(DeleteStoredScriptRequest request){
return execute(DeleteStoredScriptAction.INSTANCE, request);
}
@ -1284,12 +1272,12 @@ public abstract class AbstractClient extends AbstractComponent implements Client
}
@Override
public ActionFuture<IndicesAliasesResponse> aliases(final IndicesAliasesRequest request) {
public ActionFuture<AcknowledgedResponse> aliases(final IndicesAliasesRequest request) {
return execute(IndicesAliasesAction.INSTANCE, request);
}
@Override
public void aliases(final IndicesAliasesRequest request, final ActionListener<IndicesAliasesResponse> listener) {
public void aliases(final IndicesAliasesRequest request, final ActionListener<AcknowledgedResponse> listener) {
execute(IndicesAliasesAction.INSTANCE, request, listener);
}
@ -1374,12 +1362,12 @@ public abstract class AbstractClient extends AbstractComponent implements Client
}
@Override
public ActionFuture<DeleteIndexResponse> delete(final DeleteIndexRequest request) {
public ActionFuture<AcknowledgedResponse> delete(final DeleteIndexRequest request) {
return execute(DeleteIndexAction.INSTANCE, request);
}
@Override
public void delete(final DeleteIndexRequest request, final ActionListener<DeleteIndexResponse> listener) {
public void delete(final DeleteIndexRequest request, final ActionListener<AcknowledgedResponse> listener) {
execute(DeleteIndexAction.INSTANCE, request, listener);
}
@ -1389,12 +1377,12 @@ public abstract class AbstractClient extends AbstractComponent implements Client
}
@Override
public ActionFuture<CloseIndexResponse> close(final CloseIndexRequest request) {
public ActionFuture<AcknowledgedResponse> close(final CloseIndexRequest request) {
return execute(CloseIndexAction.INSTANCE, request);
}
@Override
public void close(final CloseIndexRequest request, final ActionListener<CloseIndexResponse> listener) {
public void close(final CloseIndexRequest request, final ActionListener<AcknowledgedResponse> listener) {
execute(CloseIndexAction.INSTANCE, request, listener);
}
@ -1479,12 +1467,12 @@ public abstract class AbstractClient extends AbstractComponent implements Client
}
@Override
public ActionFuture<PutMappingResponse> putMapping(final PutMappingRequest request) {
public ActionFuture<AcknowledgedResponse> putMapping(final PutMappingRequest request) {
return execute(PutMappingAction.INSTANCE, request);
}
@Override
public void putMapping(final PutMappingRequest request, final ActionListener<PutMappingResponse> listener) {
public void putMapping(final PutMappingRequest request, final ActionListener<AcknowledgedResponse> listener) {
execute(PutMappingAction.INSTANCE, request, listener);
}
@ -1614,12 +1602,12 @@ public abstract class AbstractClient extends AbstractComponent implements Client
}
@Override
public ActionFuture<UpdateSettingsResponse> updateSettings(final UpdateSettingsRequest request) {
public ActionFuture<AcknowledgedResponse> updateSettings(final UpdateSettingsRequest request) {
return execute(UpdateSettingsAction.INSTANCE, request);
}
@Override
public void updateSettings(final UpdateSettingsRequest request, final ActionListener<UpdateSettingsResponse> listener) {
public void updateSettings(final UpdateSettingsRequest request, final ActionListener<AcknowledgedResponse> listener) {
execute(UpdateSettingsAction.INSTANCE, request, listener);
}
@ -1654,12 +1642,12 @@ public abstract class AbstractClient extends AbstractComponent implements Client
}
@Override
public ActionFuture<PutIndexTemplateResponse> putTemplate(final PutIndexTemplateRequest request) {
public ActionFuture<AcknowledgedResponse> putTemplate(final PutIndexTemplateRequest request) {
return execute(PutIndexTemplateAction.INSTANCE, request);
}
@Override
public void putTemplate(final PutIndexTemplateRequest request, final ActionListener<PutIndexTemplateResponse> listener) {
public void putTemplate(final PutIndexTemplateRequest request, final ActionListener<AcknowledgedResponse> listener) {
execute(PutIndexTemplateAction.INSTANCE, request, listener);
}
@ -1684,12 +1672,12 @@ public abstract class AbstractClient extends AbstractComponent implements Client
}
@Override
public ActionFuture<DeleteIndexTemplateResponse> deleteTemplate(final DeleteIndexTemplateRequest request) {
public ActionFuture<AcknowledgedResponse> deleteTemplate(final DeleteIndexTemplateRequest request) {
return execute(DeleteIndexTemplateAction.INSTANCE, request);
}
@Override
public void deleteTemplate(final DeleteIndexTemplateRequest request, final ActionListener<DeleteIndexTemplateResponse> listener) {
public void deleteTemplate(final DeleteIndexTemplateRequest request, final ActionListener<AcknowledgedResponse> listener) {
execute(DeleteIndexTemplateAction.INSTANCE, request, listener);
}

View File

@ -24,9 +24,8 @@ import org.apache.logging.log4j.message.ParameterizedMessage;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateResponse;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterChangedEvent;
import org.elasticsearch.cluster.ClusterState;
@ -147,9 +146,9 @@ public class TemplateUpgradeService extends AbstractComponent implements Cluster
PutIndexTemplateRequest request =
new PutIndexTemplateRequest(change.getKey()).source(change.getValue(), XContentType.JSON);
request.masterNodeTimeout(TimeValue.timeValueMinutes(1));
client.admin().indices().putTemplate(request, new ActionListener<PutIndexTemplateResponse>() {
client.admin().indices().putTemplate(request, new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(PutIndexTemplateResponse response) {
public void onResponse(AcknowledgedResponse response) {
if (response.isAcknowledged() == false) {
anyUpgradeFailed.set(true);
logger.warn("Error updating template [{}], request was not acknowledged", change.getKey());
@ -169,9 +168,9 @@ public class TemplateUpgradeService extends AbstractComponent implements Cluster
for (String template : deletions) {
DeleteIndexTemplateRequest request = new DeleteIndexTemplateRequest(template);
request.masterNodeTimeout(TimeValue.timeValueMinutes(1));
client.admin().indices().deleteTemplate(request, new ActionListener<DeleteIndexTemplateResponse>() {
client.admin().indices().deleteTemplate(request, new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(DeleteIndexTemplateResponse response) {
public void onResponse(AcknowledgedResponse response) {
if (response.isAcknowledged() == false) {
anyUpgradeFailed.set(true);
logger.warn("Error deleting template [{}], request was not acknowledged", template);

View File

@ -19,14 +19,12 @@
package org.elasticsearch.script;
import org.elasticsearch.core.internal.io.IOUtils;
import org.elasticsearch.ResourceNotFoundException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptResponse;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.cluster.AckedClusterStateUpdateTask;
import org.elasticsearch.cluster.ClusterChangedEvent;
import org.elasticsearch.cluster.ClusterState;
@ -46,6 +44,7 @@ import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.core.internal.io.IOUtils;
import java.io.Closeable;
import java.io.IOException;
@ -417,7 +416,7 @@ public class ScriptService extends AbstractComponent implements Closeable, Clust
}
public void putStoredScript(ClusterService clusterService, PutStoredScriptRequest request,
ActionListener<PutStoredScriptResponse> listener) {
ActionListener<AcknowledgedResponse> listener) {
int max = SCRIPT_MAX_SIZE_IN_BYTES.get(settings);
if (request.content().length() > max) {
@ -454,11 +453,11 @@ public class ScriptService extends AbstractComponent implements Closeable, Clust
}
clusterService.submitStateUpdateTask("put-script-" + request.id(),
new AckedClusterStateUpdateTask<PutStoredScriptResponse>(request, listener) {
new AckedClusterStateUpdateTask<AcknowledgedResponse>(request, listener) {
@Override
protected PutStoredScriptResponse newResponse(boolean acknowledged) {
return new PutStoredScriptResponse(acknowledged);
protected AcknowledgedResponse newResponse(boolean acknowledged) {
return new AcknowledgedResponse(acknowledged);
}
@Override
@ -473,13 +472,13 @@ public class ScriptService extends AbstractComponent implements Closeable, Clust
}
public void deleteStoredScript(ClusterService clusterService, DeleteStoredScriptRequest request,
ActionListener<DeleteStoredScriptResponse> listener) {
ActionListener<AcknowledgedResponse> listener) {
clusterService.submitStateUpdateTask("delete-script-" + request.id(),
new AckedClusterStateUpdateTask<DeleteStoredScriptResponse>(request, listener) {
new AckedClusterStateUpdateTask<AcknowledgedResponse>(request, listener) {
@Override
protected DeleteStoredScriptResponse newResponse(boolean acknowledged) {
return new DeleteStoredScriptResponse(acknowledged);
protected AcknowledgedResponse newResponse(boolean acknowledged) {
return new AcknowledgedResponse(acknowledged);
}
@Override

View File

@ -25,9 +25,9 @@ import org.elasticsearch.ResourceAlreadyExistsException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.Requests;
import org.elasticsearch.cluster.ClusterState;
@ -113,9 +113,9 @@ public class TaskResultsService extends AbstractComponent {
// The index already exists but doesn't have our mapping
client.admin().indices().preparePutMapping(TASK_INDEX).setType(TASK_TYPE)
.setSource(taskResultIndexMapping(), XContentType.JSON)
.execute(new ActionListener<PutMappingResponse>() {
.execute(new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(PutMappingResponse putMappingResponse) {
public void onResponse(AcknowledgedResponse putMappingResponse) {
doStoreResult(taskResult, listener);
}

View File

@ -1,40 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.cluster.repositories.delete;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
public class DeleteRepositoryResponseTests extends AbstractStreamableXContentTestCase<DeleteRepositoryResponse> {
@Override
protected DeleteRepositoryResponse doParseInstance(XContentParser parser) {
return DeleteRepositoryResponse.fromXContent(parser);
}
@Override
protected DeleteRepositoryResponse createBlankInstance() {
return new DeleteRepositoryResponse();
}
@Override
protected DeleteRepositoryResponse createTestInstance() {
return new DeleteRepositoryResponse(randomBoolean());
}
}

View File

@ -1,45 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.cluster.repositories.put;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
import java.io.IOException;
import static org.elasticsearch.test.ESTestCase.randomBoolean;
public class PutRepositoryResponseTests extends AbstractStreamableXContentTestCase<PutRepositoryResponse> {
@Override
protected PutRepositoryResponse doParseInstance(XContentParser parser) throws IOException {
return PutRepositoryResponse.fromXContent(parser);
}
@Override
protected PutRepositoryResponse createBlankInstance() {
return new PutRepositoryResponse();
}
@Override
protected PutRepositoryResponse createTestInstance() {
return new PutRepositoryResponse(randomBoolean());
}
}

View File

@ -1,41 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.cluster.snapshots.delete;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
public class DeleteSnapshotResponseTests extends AbstractStreamableXContentTestCase<DeleteSnapshotResponse> {
@Override
protected DeleteSnapshotResponse doParseInstance(XContentParser parser) {
return DeleteSnapshotResponse.fromXContent(parser);
}
@Override
protected DeleteSnapshotResponse createBlankInstance() {
return new DeleteSnapshotResponse();
}
@Override
protected DeleteSnapshotResponse createTestInstance() {
return new DeleteSnapshotResponse(randomBoolean());
}
}

View File

@ -1,46 +0,0 @@
package org.elasticsearch.action.admin.cluster.storedscripts;/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
import java.io.IOException;
public class DeleteStoredScriptResponseTests extends AbstractStreamableXContentTestCase<DeleteStoredScriptResponse> {
@Override
protected DeleteStoredScriptResponse doParseInstance(XContentParser parser) throws IOException {
return DeleteStoredScriptResponse.fromXContent(parser);
}
@Override
protected DeleteStoredScriptResponse createBlankInstance() {
return new DeleteStoredScriptResponse();
}
@Override
protected DeleteStoredScriptResponse createTestInstance() {
return new DeleteStoredScriptResponse(randomBoolean());
}
@Override
protected DeleteStoredScriptResponse mutateInstance(DeleteStoredScriptResponse instance) throws IOException {
return new DeleteStoredScriptResponse(instance.isAcknowledged() == false);
}
}

View File

@ -1,46 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.alias;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
public class IndicesAliasesResponseTests extends AbstractStreamableXContentTestCase<IndicesAliasesResponse> {
@Override
protected IndicesAliasesResponse doParseInstance(XContentParser parser) {
return IndicesAliasesResponse.fromXContent(parser);
}
@Override
protected IndicesAliasesResponse createTestInstance() {
return new IndicesAliasesResponse(randomBoolean());
}
@Override
protected IndicesAliasesResponse createBlankInstance() {
return new IndicesAliasesResponse();
}
@Override
protected IndicesAliasesResponse mutateInstance(IndicesAliasesResponse response) {
return new IndicesAliasesResponse(response.isAcknowledged() == false);
}
}

View File

@ -1,46 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.close;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
public class CloseIndexResponseTests extends AbstractStreamableXContentTestCase<CloseIndexResponse> {
@Override
protected CloseIndexResponse doParseInstance(XContentParser parser) {
return CloseIndexResponse.fromXContent(parser);
}
@Override
protected CloseIndexResponse createTestInstance() {
return new CloseIndexResponse(randomBoolean());
}
@Override
protected CloseIndexResponse createBlankInstance() {
return new CloseIndexResponse();
}
@Override
protected CloseIndexResponse mutateInstance(CloseIndexResponse response) {
return new CloseIndexResponse(response.isAcknowledged() == false);
}
}

View File

@ -24,10 +24,10 @@ import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.UnavailableShardsException;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.cluster.metadata.MetaData;
@ -207,9 +207,9 @@ public class CreateIndexIT extends ESIntegTestCase {
synchronized (indexVersionLock) { // not necessarily needed here but for completeness we lock here too
indexVersion.incrementAndGet();
}
client().admin().indices().prepareDelete("test").execute(new ActionListener<DeleteIndexResponse>() { // this happens async!!!
client().admin().indices().prepareDelete("test").execute(new ActionListener<AcknowledgedResponse>() { // this happens async!!!
@Override
public void onResponse(DeleteIndexResponse deleteIndexResponse) {
public void onResponse(AcknowledgedResponse deleteIndexResponse) {
Thread thread = new Thread() {
@Override
public void run() {

View File

@ -1,53 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.delete;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
public class DeleteIndexResponseTests extends AbstractStreamableXContentTestCase<DeleteIndexResponse> {
public void testToXContent() {
DeleteIndexResponse response = new DeleteIndexResponse(true);
String output = Strings.toString(response);
assertEquals("{\"acknowledged\":true}", output);
}
@Override
protected DeleteIndexResponse doParseInstance(XContentParser parser) {
return DeleteIndexResponse.fromXContent(parser);
}
@Override
protected DeleteIndexResponse createTestInstance() {
return new DeleteIndexResponse(randomBoolean());
}
@Override
protected DeleteIndexResponse createBlankInstance() {
return new DeleteIndexResponse();
}
@Override
protected DeleteIndexResponse mutateInstance(DeleteIndexResponse response) {
return new DeleteIndexResponse(response.isAcknowledged() == false);
}
}

View File

@ -1,53 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.mapping.put;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
public class PutMappingResponseTests extends AbstractStreamableXContentTestCase<PutMappingResponse> {
public void testToXContent() {
PutMappingResponse response = new PutMappingResponse(true);
String output = Strings.toString(response);
assertEquals("{\"acknowledged\":true}", output);
}
@Override
protected PutMappingResponse doParseInstance(XContentParser parser) {
return PutMappingResponse.fromXContent(parser);
}
@Override
protected PutMappingResponse createTestInstance() {
return new PutMappingResponse(randomBoolean());
}
@Override
protected PutMappingResponse createBlankInstance() {
return new PutMappingResponse();
}
@Override
protected PutMappingResponse mutateInstance(PutMappingResponse response) {
return new PutMappingResponse(response.isAcknowledged() == false);
}
}

View File

@ -1,46 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.settings.put;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
public class UpdateSettingsResponseTests extends AbstractStreamableXContentTestCase<UpdateSettingsResponse> {
@Override
protected UpdateSettingsResponse doParseInstance(XContentParser parser) {
return UpdateSettingsResponse.fromXContent(parser);
}
@Override
protected UpdateSettingsResponse createTestInstance() {
return new UpdateSettingsResponse(randomBoolean());
}
@Override
protected UpdateSettingsResponse createBlankInstance() {
return new UpdateSettingsResponse();
}
@Override
protected UpdateSettingsResponse mutateInstance(UpdateSettingsResponse response) {
return new UpdateSettingsResponse(response.isAcknowledged() == false);
}
}

View File

@ -1,45 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action.admin.indices.template.put;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase;
public class PutIndexTemplateResponseTests extends AbstractStreamableXContentTestCase<PutIndexTemplateResponse> {
@Override
protected PutIndexTemplateResponse doParseInstance(XContentParser parser) {
return PutIndexTemplateResponse.fromXContent(parser);
}
@Override
protected PutIndexTemplateResponse createTestInstance() {
return new PutIndexTemplateResponse(randomBoolean());
}
@Override
protected PutIndexTemplateResponse createBlankInstance() {
return new PutIndexTemplateResponse();
}
@Override
protected PutIndexTemplateResponse mutateInstance(PutIndexTemplateResponse response) {
return new PutIndexTemplateResponse(response.isAcknowledged() == false);
}
}

View File

@ -22,9 +22,9 @@ package org.elasticsearch.blocks;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequestBuilder;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.cluster.block.ClusterBlockException;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.settings.Settings;
@ -147,7 +147,7 @@ public class SimpleBlocksIT extends ESIntegTestCase {
UpdateSettingsRequestBuilder settingsRequest = client().admin().indices().prepareUpdateSettings(index);
settingsRequest.setSettings(newSettings);
UpdateSettingsResponse settingsResponse = settingsRequest.execute().actionGet();
AcknowledgedResponse settingsResponse = settingsRequest.execute().actionGet();
assertThat(settingsResponse, notNullValue());
}
}

View File

@ -22,9 +22,9 @@ package org.elasticsearch.cluster.ack;
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse;
import org.elasticsearch.action.admin.indices.close.CloseIndexResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.open.OpenIndexResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.routing.IndexRoutingTable;
@ -163,7 +163,7 @@ public class AckClusterUpdateSettingsIT extends ESIntegTestCase {
createIndex("test");
ensureGreen();
removePublishTimeout();
CloseIndexResponse closeIndexResponse = client().admin().indices().prepareClose("test").execute().actionGet();
AcknowledgedResponse closeIndexResponse = client().admin().indices().prepareClose("test").execute().actionGet();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
OpenIndexResponse openIndexResponse = client().admin().indices().prepareOpen("test").setTimeout("0s").get();

View File

@ -21,11 +21,8 @@ package org.elasticsearch.cluster.ack;
import org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteResponse;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse;
import org.elasticsearch.action.admin.indices.close.CloseIndexResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.AliasMetaData;
@ -79,7 +76,7 @@ public class AckIT extends ESIntegTestCase {
public void testUpdateSettingsNoAcknowledgement() {
createIndex("test");
UpdateSettingsResponse updateSettingsResponse = client().admin().indices().prepareUpdateSettings("test").setTimeout("0s")
AcknowledgedResponse updateSettingsResponse = client().admin().indices().prepareUpdateSettings("test").setTimeout("0s")
.setSettings(Settings.builder().put("refresh_interval", 9999, TimeUnit.MILLISECONDS)).get();
assertThat(updateSettingsResponse.isAcknowledged(), equalTo(false));
}
@ -229,7 +226,7 @@ public class AckIT extends ESIntegTestCase {
public void testIndicesAliasesNoAcknowledgement() {
createIndex("test");
IndicesAliasesResponse indicesAliasesResponse = client().admin().indices().prepareAliases().addAlias("test", "alias").setTimeout("0s").get();
AcknowledgedResponse indicesAliasesResponse = client().admin().indices().prepareAliases().addAlias("test", "alias").setTimeout("0s").get();
assertThat(indicesAliasesResponse.isAcknowledged(), equalTo(false));
}
@ -249,7 +246,7 @@ public class AckIT extends ESIntegTestCase {
createIndex("test");
ensureGreen();
CloseIndexResponse closeIndexResponse = client().admin().indices().prepareClose("test").setTimeout("0s").get();
AcknowledgedResponse closeIndexResponse = client().admin().indices().prepareClose("test").setTimeout("0s").get();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(false));
}
@ -282,7 +279,7 @@ public class AckIT extends ESIntegTestCase {
createIndex("test");
ensureGreen();
PutMappingResponse putMappingResponse = client().admin().indices().preparePutMapping("test").setType("test").setSource("field", "type=keyword").setTimeout("0s").get();
AcknowledgedResponse putMappingResponse = client().admin().indices().preparePutMapping("test").setType("test").setSource("field", "type=keyword").setTimeout("0s").get();
assertThat(putMappingResponse.isAcknowledged(), equalTo(false));
}

View File

@ -22,9 +22,8 @@ package org.elasticsearch.cluster.metadata;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateResponse;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.AdminClient;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.IndicesAdminClient;
@ -171,8 +170,8 @@ public class TemplateUpgradeServiceTests extends ESTestCase {
int additionsCount = randomIntBetween(0, 5);
int deletionsCount = randomIntBetween(0, 3);
List<ActionListener<PutIndexTemplateResponse>> putTemplateListeners = new ArrayList<>();
List<ActionListener<DeleteIndexTemplateResponse>> deleteTemplateListeners = new ArrayList<>();
List<ActionListener<AcknowledgedResponse>> putTemplateListeners = new ArrayList<>();
List<ActionListener<AcknowledgedResponse>> deleteTemplateListeners = new ArrayList<>();
Client mockClient = mock(Client.class);
AdminClient mockAdminClient = mock(AdminClient.class);
@ -227,7 +226,7 @@ public class TemplateUpgradeServiceTests extends ESTestCase {
if (randomBoolean()) {
putTemplateListeners.get(i).onFailure(new RuntimeException("test - ignore"));
} else {
putTemplateListeners.get(i).onResponse(new PutIndexTemplateResponse(randomBoolean()) {
putTemplateListeners.get(i).onResponse(new AcknowledgedResponse(randomBoolean()) {
});
}
@ -240,7 +239,7 @@ public class TemplateUpgradeServiceTests extends ESTestCase {
assertThat(prevUpdatesInProgress - service.upgradesInProgress.get(), equalTo(1));
} else {
int prevUpdatesInProgress = service.upgradesInProgress.get();
deleteTemplateListeners.get(i).onResponse(new DeleteIndexTemplateResponse(randomBoolean()) {
deleteTemplateListeners.get(i).onResponse(new AcknowledgedResponse(randomBoolean()) {
});
assertThat(prevUpdatesInProgress - service.upgradesInProgress.get(), equalTo(1));
@ -256,9 +255,9 @@ public class TemplateUpgradeServiceTests extends ESTestCase {
@SuppressWarnings("unchecked")
public void testClusterStateUpdate() throws InterruptedException {
final AtomicReference<ActionListener<PutIndexTemplateResponse>> addedListener = new AtomicReference<>();
final AtomicReference<ActionListener<PutIndexTemplateResponse>> changedListener = new AtomicReference<>();
final AtomicReference<ActionListener<DeleteIndexTemplateResponse>> removedListener = new AtomicReference<>();
final AtomicReference<ActionListener<AcknowledgedResponse>> addedListener = new AtomicReference<>();
final AtomicReference<ActionListener<AcknowledgedResponse>> changedListener = new AtomicReference<>();
final AtomicReference<ActionListener<AcknowledgedResponse>> removedListener = new AtomicReference<>();
final Semaphore updateInvocation = new Semaphore(0);
final Semaphore calculateInvocation = new Semaphore(0);
final Semaphore changedInvocation = new Semaphore(0);
@ -373,11 +372,11 @@ public class TemplateUpgradeServiceTests extends ESTestCase {
assertThat(updateInvocation.availablePermits(), equalTo(0));
assertThat(finishInvocation.availablePermits(), equalTo(0));
addedListener.getAndSet(null).onResponse(new PutIndexTemplateResponse(true) {
addedListener.getAndSet(null).onResponse(new AcknowledgedResponse(true) {
});
changedListener.getAndSet(null).onResponse(new PutIndexTemplateResponse(true) {
changedListener.getAndSet(null).onResponse(new AcknowledgedResponse(true) {
});
removedListener.getAndSet(null).onResponse(new DeleteIndexTemplateResponse(true) {
removedListener.getAndSet(null).onResponse(new AcknowledgedResponse(true) {
});
// 3 upgrades should be completed, in addition to the final calculate

View File

@ -21,7 +21,7 @@ package org.elasticsearch.indexlifecycle;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.health.ClusterHealthStatus;
import org.elasticsearch.cluster.routing.RoutingNode;
@ -191,7 +191,7 @@ public class IndexLifecycleActionIT extends ESIntegTestCase {
logger.info("Deleting index [test]");
// last, lets delete the index
DeleteIndexResponse deleteIndexResponse = client().admin().indices().prepareDelete("test").execute().actionGet();
AcknowledgedResponse deleteIndexResponse = client().admin().indices().prepareDelete("test").execute().actionGet();
assertThat(deleteIndexResponse.isAcknowledged(), equalTo(true));
clusterState = client().admin().cluster().prepareState().get().getState();

View File

@ -19,7 +19,6 @@
package org.elasticsearch.indices;
import org.elasticsearch.action.ActionRequestBuilder;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequestBuilder;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequestBuilder;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder;
@ -41,6 +40,7 @@ import org.elasticsearch.action.search.MultiSearchResponse;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.Property;
@ -269,7 +269,7 @@ public class IndicesOptionsIntegrationIT extends ESIntegTestCase {
ensureGreen("test1");
waitForRelocation();
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("dummy-repo")
AcknowledgedResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("dummy-repo")
.setType("fs").setSettings(Settings.builder().put("location", randomRepoPath())).get();
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
client().admin().cluster().prepareCreateSnapshot("dummy-repo", "snap1").setWaitForCompletion(true).get();
@ -394,7 +394,7 @@ public class IndicesOptionsIntegrationIT extends ESIntegTestCase {
ensureGreen("foobar");
waitForRelocation();
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("dummy-repo")
AcknowledgedResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("dummy-repo")
.setType("fs").setSettings(Settings.builder().put("location", randomRepoPath())).get();
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
client().admin().cluster().prepareCreateSnapshot("dummy-repo", "snap1").setWaitForCompletion(true).get();

View File

@ -21,10 +21,10 @@ package org.elasticsearch.indices.mapping;
import org.elasticsearch.Version;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.cluster.metadata.MappingMetaData;
@ -115,7 +115,7 @@ public class UpdateMappingIntegrationIT extends ESIntegTestCase {
.execute().actionGet();
client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForGreenStatus().execute().actionGet();
PutMappingResponse putMappingResponse = client().admin().indices().preparePutMapping("test").setType("_doc")
AcknowledgedResponse putMappingResponse = client().admin().indices().preparePutMapping("test").setType("_doc")
.setSource("{\"properties\":{\"date\":{\"type\":\"integer\"}}}", XContentType.JSON)
.execute().actionGet();
@ -135,7 +135,7 @@ public class UpdateMappingIntegrationIT extends ESIntegTestCase {
).execute().actionGet();
client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForGreenStatus().execute().actionGet();
PutMappingResponse putMappingResponse = client().admin().indices().preparePutMapping("test").setType("_doc")
AcknowledgedResponse putMappingResponse = client().admin().indices().preparePutMapping("test").setType("_doc")
.setSource("{\"properties\":{\"date\":{\"type\":\"integer\"}}}", XContentType.JSON)
.execute().actionGet();
@ -192,7 +192,7 @@ public class UpdateMappingIntegrationIT extends ESIntegTestCase {
.execute().actionGet();
client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForGreenStatus().execute().actionGet();
PutMappingResponse putMappingResponse = client().admin().indices().preparePutMapping("test").setType("type")
AcknowledgedResponse putMappingResponse = client().admin().indices().preparePutMapping("test").setType("type")
.setSource("{\"type\":{\"properties\":{\"body\":{\"type\":\"text\"}}}}", XContentType.JSON)
.execute().actionGet();
@ -218,7 +218,7 @@ public class UpdateMappingIntegrationIT extends ESIntegTestCase {
logger.info("Emptying _default_ mappings");
// now remove it
PutMappingResponse putResponse = client().admin().indices().preparePutMapping("test").setType(MapperService.DEFAULT_MAPPING).setSource(
AcknowledgedResponse putResponse = client().admin().indices().preparePutMapping("test").setType(MapperService.DEFAULT_MAPPING).setSource(
JsonXContent.contentBuilder().startObject().startObject(MapperService.DEFAULT_MAPPING)
.endObject().endObject()
).get();
@ -291,7 +291,7 @@ public class UpdateMappingIntegrationIT extends ESIntegTestCase {
String typeName = "type";
String fieldName = Thread.currentThread().getName() + "_" + i;
PutMappingResponse response = client1.admin().indices().preparePutMapping(indexName).setType(typeName).setSource(
AcknowledgedResponse response = client1.admin().indices().preparePutMapping(indexName).setType(typeName).setSource(
JsonXContent.contentBuilder().startObject().startObject(typeName)
.startObject("properties").startObject(fieldName).field("type", "text").endObject().endObject()
.endObject().endObject()

View File

@ -22,12 +22,11 @@ package org.elasticsearch.indices.state;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse;
import org.elasticsearch.action.admin.indices.close.CloseIndexResponse;
import org.elasticsearch.action.admin.indices.open.OpenIndexResponse;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.Strings;
@ -63,7 +62,7 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(healthResponse.isTimedOut(), equalTo(false));
CloseIndexResponse closeIndexResponse = client.admin().indices().prepareClose("test1").execute().actionGet();
AcknowledgedResponse closeIndexResponse = client.admin().indices().prepareClose("test1").execute().actionGet();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsClosed("test1");
@ -102,7 +101,7 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
createIndex("test1");
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(healthResponse.isTimedOut(), equalTo(false));
CloseIndexResponse closeIndexResponse = client.admin().indices().prepareClose("test1", "test2")
AcknowledgedResponse closeIndexResponse = client.admin().indices().prepareClose("test1", "test2")
.setIndicesOptions(IndicesOptions.lenientExpandOpen()).execute().actionGet();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsClosed("test1");
@ -136,9 +135,9 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(healthResponse.isTimedOut(), equalTo(false));
CloseIndexResponse closeIndexResponse1 = client.admin().indices().prepareClose("test1").execute().actionGet();
AcknowledgedResponse closeIndexResponse1 = client.admin().indices().prepareClose("test1").execute().actionGet();
assertThat(closeIndexResponse1.isAcknowledged(), equalTo(true));
CloseIndexResponse closeIndexResponse2 = client.admin().indices().prepareClose("test2").execute().actionGet();
AcknowledgedResponse closeIndexResponse2 = client.admin().indices().prepareClose("test2").execute().actionGet();
assertThat(closeIndexResponse2.isAcknowledged(), equalTo(true));
assertIndexIsClosed("test1", "test2");
assertIndexIsOpened("test3");
@ -158,7 +157,7 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(healthResponse.isTimedOut(), equalTo(false));
CloseIndexResponse closeIndexResponse = client.admin().indices().prepareClose("test*").execute().actionGet();
AcknowledgedResponse closeIndexResponse = client.admin().indices().prepareClose("test*").execute().actionGet();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsClosed("test1", "test2");
assertIndexIsOpened("a");
@ -175,7 +174,7 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(healthResponse.isTimedOut(), equalTo(false));
CloseIndexResponse closeIndexResponse = client.admin().indices().prepareClose("_all").execute().actionGet();
AcknowledgedResponse closeIndexResponse = client.admin().indices().prepareClose("_all").execute().actionGet();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsClosed("test1", "test2", "test3");
@ -191,7 +190,7 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(healthResponse.isTimedOut(), equalTo(false));
CloseIndexResponse closeIndexResponse = client.admin().indices().prepareClose("*").execute().actionGet();
AcknowledgedResponse closeIndexResponse = client.admin().indices().prepareClose("*").execute().actionGet();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsClosed("test1", "test2", "test3");
@ -249,7 +248,7 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
assertThat(healthResponse.isTimedOut(), equalTo(false));
//closing the index
CloseIndexResponse closeIndexResponse = client.admin().indices().prepareClose("test1").execute().actionGet();
AcknowledgedResponse closeIndexResponse = client.admin().indices().prepareClose("test1").execute().actionGet();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsClosed("test1");
@ -265,10 +264,10 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(healthResponse.isTimedOut(), equalTo(false));
IndicesAliasesResponse aliasesResponse = client.admin().indices().prepareAliases().addAlias("test1", "test1-alias").execute().actionGet();
AcknowledgedResponse aliasesResponse = client.admin().indices().prepareAliases().addAlias("test1", "test1-alias").execute().actionGet();
assertThat(aliasesResponse.isAcknowledged(), equalTo(true));
CloseIndexResponse closeIndexResponse = client.admin().indices().prepareClose("test1-alias").execute().actionGet();
AcknowledgedResponse closeIndexResponse = client.admin().indices().prepareClose("test1-alias").execute().actionGet();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsClosed("test1");
@ -284,12 +283,12 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
assertThat(healthResponse.isTimedOut(), equalTo(false));
IndicesAliasesResponse aliasesResponse1 = client.admin().indices().prepareAliases().addAlias("test1", "test-alias").execute().actionGet();
AcknowledgedResponse aliasesResponse1 = client.admin().indices().prepareAliases().addAlias("test1", "test-alias").execute().actionGet();
assertThat(aliasesResponse1.isAcknowledged(), equalTo(true));
IndicesAliasesResponse aliasesResponse2 = client.admin().indices().prepareAliases().addAlias("test2", "test-alias").execute().actionGet();
AcknowledgedResponse aliasesResponse2 = client.admin().indices().prepareAliases().addAlias("test2", "test-alias").execute().actionGet();
assertThat(aliasesResponse2.isAcknowledged(), equalTo(true));
CloseIndexResponse closeIndexResponse = client.admin().indices().prepareClose("test-alias").execute().actionGet();
AcknowledgedResponse closeIndexResponse = client.admin().indices().prepareClose("test-alias").execute().actionGet();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
assertIndexIsClosed("test1", "test2");
@ -380,7 +379,7 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
enableIndexBlock("test", blockSetting);
// Closing an index is not blocked
CloseIndexResponse closeIndexResponse = client().admin().indices().prepareClose("test").execute().actionGet();
AcknowledgedResponse closeIndexResponse = client().admin().indices().prepareClose("test").execute().actionGet();
assertAcked(closeIndexResponse);
assertIndexIsClosed("test");
@ -405,7 +404,7 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
}
}
CloseIndexResponse closeIndexResponse = client().admin().indices().prepareClose("test").execute().actionGet();
AcknowledgedResponse closeIndexResponse = client().admin().indices().prepareClose("test").execute().actionGet();
assertAcked(closeIndexResponse);
assertIndexIsClosed("test");

View File

@ -22,8 +22,8 @@ package org.elasticsearch.indices.state;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ClusterStateUpdateTask;
import org.elasticsearch.cluster.block.ClusterBlocks;
@ -235,9 +235,9 @@ public class RareClusterStateIT extends ESIntegTestCase {
// Add a new mapping...
final AtomicReference<Object> putMappingResponse = new AtomicReference<>();
client().admin().indices().preparePutMapping("index").setType("type").setSource("field", "type=long").execute(new ActionListener<PutMappingResponse>() {
client().admin().indices().preparePutMapping("index").setType("type").setSource("field", "type=long").execute(new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(PutMappingResponse response) {
public void onResponse(AcknowledgedResponse response) {
putMappingResponse.set(response);
}
@ -286,8 +286,8 @@ public class RareClusterStateIT extends ESIntegTestCase {
// Now make sure the indexing request finishes successfully
disruption.stopDisrupting();
assertBusy(() -> {
assertThat(putMappingResponse.get(), instanceOf(PutMappingResponse.class));
PutMappingResponse resp = (PutMappingResponse) putMappingResponse.get();
assertThat(putMappingResponse.get(), instanceOf(AcknowledgedResponse.class));
AcknowledgedResponse resp = (AcknowledgedResponse) putMappingResponse.get();
assertTrue(resp.isAcknowledged());
assertThat(docIndexResponse.get(), instanceOf(IndexResponse.class));
IndexResponse docResp = (IndexResponse) docIndexResponse.get();
@ -349,9 +349,9 @@ public class RareClusterStateIT extends ESIntegTestCase {
internalCluster().setDisruptionScheme(disruption);
disruption.startDisrupting();
final AtomicReference<Object> putMappingResponse = new AtomicReference<>();
client().admin().indices().preparePutMapping("index").setType("type").setSource("field", "type=long").execute(new ActionListener<PutMappingResponse>() {
client().admin().indices().preparePutMapping("index").setType("type").setSource("field", "type=long").execute(new ActionListener<AcknowledgedResponse>() {
@Override
public void onResponse(PutMappingResponse response) {
public void onResponse(AcknowledgedResponse response) {
putMappingResponse.set(response);
}
@ -397,8 +397,8 @@ public class RareClusterStateIT extends ESIntegTestCase {
// Now make sure the indexing request finishes successfully
disruption.stopDisrupting();
assertBusy(() -> {
assertThat(putMappingResponse.get(), instanceOf(PutMappingResponse.class));
PutMappingResponse resp = (PutMappingResponse) putMappingResponse.get();
assertThat(putMappingResponse.get(), instanceOf(AcknowledgedResponse.class));
AcknowledgedResponse resp = (AcknowledgedResponse) putMappingResponse.get();
assertTrue(resp.isAcknowledged());
assertThat(docIndexResponse.get(), instanceOf(IndexResponse.class));
IndexResponse docResp = (IndexResponse) docIndexResponse.get();

View File

@ -22,10 +22,10 @@ package org.elasticsearch.indices.state;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.action.admin.indices.close.CloseIndexResponse;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.open.OpenIndexResponse;
import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.cluster.health.ClusterHealthStatus;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.cluster.routing.ShardRoutingState;
@ -61,7 +61,7 @@ public class SimpleIndexStateIT extends ESIntegTestCase {
client().prepareIndex("test", "type1", "1").setSource("field1", "value1").get();
logger.info("--> closing test index...");
CloseIndexResponse closeIndexResponse = client().admin().indices().prepareClose("test").get();
AcknowledgedResponse closeIndexResponse = client().admin().indices().prepareClose("test").get();
assertThat(closeIndexResponse.isAcknowledged(), equalTo(true));
stateResponse = client().admin().cluster().prepareState().get();

View File

@ -19,8 +19,8 @@
package org.elasticsearch.repositories.blobstore;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.UUIDs;
import org.elasticsearch.common.settings.Settings;
@ -85,7 +85,7 @@ public class BlobStoreRepositoryTests extends ESSingleNodeTestCase {
final String repositoryName = "test-repo";
logger.info("--> creating repository");
PutRepositoryResponse putRepositoryResponse =
AcknowledgedResponse putRepositoryResponse =
client.admin().cluster().preparePutRepository(repositoryName)
.setType(REPO_TYPE)
.setSettings(Settings.builder().put(node().settings()).put("location", location))
@ -237,7 +237,7 @@ public class BlobStoreRepositoryTests extends ESSingleNodeTestCase {
final Path location = ESIntegTestCase.randomRepoPath(node().settings());
final String repositoryName = "test-repo";
PutRepositoryResponse putRepositoryResponse =
AcknowledgedResponse putRepositoryResponse =
client.admin().cluster().preparePutRepository(repositoryName)
.setType(REPO_TYPE)
.setSettings(Settings.builder().put(node().settings()).put("location", location))

View File

@ -23,13 +23,13 @@ import org.apache.lucene.analysis.TokenStreamToAutomaton;
import org.apache.lucene.search.suggest.document.ContextSuggestField;
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.admin.indices.segments.IndexShardSegments;
import org.elasticsearch.action.admin.indices.segments.ShardSegments;
import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.search.SearchPhaseExecutionException;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.FieldMemoryStats;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings;
@ -562,7 +562,7 @@ public class CompletionSuggestSearchIT extends ESIntegTestCase {
.setSource(jsonBuilder().startObject().field(FIELD, "Foo Fighters").endObject()).get();
ensureGreen(INDEX);
PutMappingResponse putMappingResponse = client().admin().indices().preparePutMapping(INDEX).setType(TYPE).setSource(jsonBuilder().startObject()
AcknowledgedResponse putMappingResponse = client().admin().indices().preparePutMapping(INDEX).setType(TYPE).setSource(jsonBuilder().startObject()
.startObject(TYPE).startObject("properties")
.startObject(FIELD)
.field("type", "text")
@ -742,7 +742,7 @@ public class CompletionSuggestSearchIT extends ESIntegTestCase {
.setSettings(Settings.builder().put("index.number_of_replicas", 0).put("index.number_of_shards", 2))
.execute().actionGet();
ensureGreen();
PutMappingResponse putMappingResponse = client().admin().indices().preparePutMapping(INDEX).setType(TYPE).setSource(jsonBuilder().startObject()
AcknowledgedResponse putMappingResponse = client().admin().indices().preparePutMapping(INDEX).setType(TYPE).setSource(jsonBuilder().startObject()
.startObject(TYPE).startObject("properties")
.startObject(FIELD)
.field("type", "completion").field("analyzer", "simple")

View File

@ -23,9 +23,7 @@ import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryResponse;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotStats;
@ -33,6 +31,7 @@ import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotStatus;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.AdminClient;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.node.NodeClient;
@ -180,7 +179,7 @@ public class DedicatedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTest
.getMetaData().persistentSettings().getAsInt(ElectMasterService.DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING.getKey(), -1), equalTo(2));
logger.info("--> create repository");
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
AcknowledgedResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
.setType("fs").setSettings(Settings.builder().put("location", randomRepoPath())).execute().actionGet();
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
@ -235,7 +234,7 @@ public class DedicatedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTest
});
logger.info("--> create repository");
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
AcknowledgedResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
.setType("fs").setSettings(Settings.builder().put("location", tempDir)).execute().actionGet();
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
@ -351,7 +350,7 @@ public class DedicatedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTest
logger.info("--> create repository");
logger.info("--> creating repository");
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
AcknowledgedResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
.setType("mock").setSettings(
Settings.builder()
.put("location", randomRepoPath())
@ -399,7 +398,7 @@ public class DedicatedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTest
logger.info("--> creating repository");
Path repo = randomRepoPath();
PutRepositoryResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
AcknowledgedResponse putRepositoryResponse = client.admin().cluster().preparePutRepository("test-repo")
.setType("mock").setSettings(
Settings.builder()
.put("location", repo)
@ -422,14 +421,14 @@ public class DedicatedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTest
logger.info("--> execution was blocked on node [{}], aborting snapshot", blockedNode);
ActionFuture<DeleteSnapshotResponse> deleteSnapshotResponseFuture = internalCluster().client(nodes.get(0)).admin().cluster().prepareDeleteSnapshot("test-repo", "test-snap").execute();
ActionFuture<AcknowledgedResponse> deleteSnapshotResponseFuture = internalCluster().client(nodes.get(0)).admin().cluster().prepareDeleteSnapshot("test-repo", "test-snap").execute();
// Make sure that abort makes some progress
Thread.sleep(100);
unblockNode("test-repo", blockedNode);
logger.info("--> stopping node [{}]", blockedNode);
stopNode(blockedNode);
try {
DeleteSnapshotResponse deleteSnapshotResponse = deleteSnapshotResponseFuture.actionGet();
AcknowledgedResponse deleteSnapshotResponse = deleteSnapshotResponseFuture.actionGet();
assertThat(deleteSnapshotResponse.isAcknowledged(), equalTo(true));
} catch (SnapshotMissingException ex) {
// When master node is closed during this test, it sometime manages to delete the snapshot files before
@ -496,7 +495,7 @@ public class DedicatedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTest
assertTrue(client().admin().indices().prepareExists("test-idx-none").get().isExists());
logger.info("--> creating repository");
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo")
AcknowledgedResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo")
.setType("fs").setSettings(Settings.builder().put("location", randomRepoPath())).execute().actionGet();
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
@ -603,7 +602,7 @@ public class DedicatedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTest
cluster().wipeIndices("_all");
logger.info("--> create repository");
PutRepositoryResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo")
AcknowledgedResponse putRepositoryResponse = client().admin().cluster().preparePutRepository("test-repo")
.setType("fs").setSettings(Settings.builder().put("location", randomRepoPath())).execute().actionGet();
assertThat(putRepositoryResponse.isAcknowledged(), equalTo(true));
int numberOfShards = 6;

View File

@ -20,7 +20,7 @@
package org.elasticsearch.snapshots;
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.plugins.Plugin;
@ -83,7 +83,7 @@ public class MinThreadsSnapshotRestoreIT extends AbstractSnapshotIntegTestCase {
String blockedNode = internalCluster().getMasterName();
((MockRepository)internalCluster().getInstance(RepositoriesService.class, blockedNode).repository(repo)).blockOnDataFiles(true);
logger.info("--> start deletion of first snapshot");
ActionFuture<DeleteSnapshotResponse> future =
ActionFuture<AcknowledgedResponse> future =
client().admin().cluster().prepareDeleteSnapshot(repo, snapshot2).execute();
logger.info("--> waiting for block to kick in on node [{}]", blockedNode);
waitForBlock(blockedNode, repo, TimeValue.timeValueSeconds(10));
@ -129,7 +129,7 @@ public class MinThreadsSnapshotRestoreIT extends AbstractSnapshotIntegTestCase {
String blockedNode = internalCluster().getMasterName();
((MockRepository)internalCluster().getInstance(RepositoriesService.class, blockedNode).repository(repo)).blockOnDataFiles(true);
logger.info("--> start deletion of snapshot");
ActionFuture<DeleteSnapshotResponse> future = client().admin().cluster().prepareDeleteSnapshot(repo, snapshot1).execute();
ActionFuture<AcknowledgedResponse> future = client().admin().cluster().prepareDeleteSnapshot(repo, snapshot1).execute();
logger.info("--> waiting for block to kick in on node [{}]", blockedNode);
waitForBlock(blockedNode, repo, TimeValue.timeValueSeconds(10));
@ -184,7 +184,7 @@ public class MinThreadsSnapshotRestoreIT extends AbstractSnapshotIntegTestCase {
String blockedNode = internalCluster().getMasterName();
((MockRepository)internalCluster().getInstance(RepositoriesService.class, blockedNode).repository(repo)).blockOnDataFiles(true);
logger.info("--> start deletion of snapshot");
ActionFuture<DeleteSnapshotResponse> future = client().admin().cluster().prepareDeleteSnapshot(repo, snapshot2).execute();
ActionFuture<AcknowledgedResponse> future = client().admin().cluster().prepareDeleteSnapshot(repo, snapshot2).execute();
logger.info("--> waiting for block to kick in on node [{}]", blockedNode);
waitForBlock(blockedNode, repo, TimeValue.timeValueSeconds(10));

Some files were not shown because too many files have changed in this diff Show More