Convert AcknowledgedRequest to Writeable.Reader (#44412) (#44454)

This commit adds constructors to AcknolwedgedRequest subclasses to
implement Writeable.Reader, and ensures all future subclasses implement
the same.

relates #34389
This commit is contained in:
Ryan Ernst 2019-07-17 11:17:36 -07:00 committed by GitHub
parent 65fcaecce1
commit 0755a13c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
109 changed files with 477 additions and 530 deletions

View File

@ -37,6 +37,11 @@ public class DeleteRepositoryRequest extends AcknowledgedRequest<DeleteRepositor
private String name; private String name;
public DeleteRepositoryRequest(StreamInput in) throws IOException {
super(in);
name = in.readString();
}
public DeleteRepositoryRequest() { public DeleteRepositoryRequest() {
} }
@ -77,12 +82,6 @@ public class DeleteRepositoryRequest extends AcknowledgedRequest<DeleteRepositor
return this.name; return this.name;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
name = in.readString();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -48,7 +48,7 @@ public class TransportDeleteRepositoryAction extends TransportMasterNodeAction<D
RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters, RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) { IndexNameExpressionResolver indexNameExpressionResolver) {
super(DeleteRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters, super(DeleteRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, DeleteRepositoryRequest::new); DeleteRepositoryRequest::new, indexNameExpressionResolver);
this.repositoriesService = repositoriesService; this.repositoriesService = repositoriesService;
} }

View File

@ -55,6 +55,14 @@ public class PutRepositoryRequest extends AcknowledgedRequest<PutRepositoryReque
private Settings settings = EMPTY_SETTINGS; private Settings settings = EMPTY_SETTINGS;
public PutRepositoryRequest(StreamInput in) throws IOException {
super(in);
name = in.readString();
type = in.readString();
settings = readSettingsFromStream(in);
verify = in.readBoolean();
}
public PutRepositoryRequest() { public PutRepositoryRequest() {
} }
@ -216,15 +224,6 @@ public class PutRepositoryRequest extends AcknowledgedRequest<PutRepositoryReque
return this; return this;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
name = in.readString();
type = in.readString();
settings = readSettingsFromStream(in);
verify = in.readBoolean();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -48,7 +48,7 @@ public class TransportPutRepositoryAction extends TransportMasterNodeAction<PutR
RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters, RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) { IndexNameExpressionResolver indexNameExpressionResolver) {
super(PutRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters, super(PutRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, PutRepositoryRequest::new); PutRepositoryRequest::new, indexNameExpressionResolver);
this.repositoriesService = repositoriesService; this.repositoriesService = repositoriesService;
} }

View File

@ -47,7 +47,7 @@ public class TransportVerifyRepositoryAction extends
RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters, RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) { IndexNameExpressionResolver indexNameExpressionResolver) {
super(VerifyRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters, super(VerifyRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, VerifyRepositoryRequest::new); VerifyRepositoryRequest::new, indexNameExpressionResolver);
this.repositoriesService = repositoriesService; this.repositoriesService = repositoriesService;
} }

View File

@ -37,6 +37,11 @@ public class VerifyRepositoryRequest extends AcknowledgedRequest<VerifyRepositor
private String name; private String name;
public VerifyRepositoryRequest(StreamInput in) throws IOException {
super(in);
name = in.readString();
}
public VerifyRepositoryRequest() { public VerifyRepositoryRequest() {
} }
@ -77,12 +82,6 @@ public class VerifyRepositoryRequest extends AcknowledgedRequest<VerifyRepositor
return this.name; return this.name;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
name = in.readString();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -38,6 +38,14 @@ public class ClusterRerouteRequest extends AcknowledgedRequest<ClusterRerouteReq
private boolean explain; private boolean explain;
private boolean retryFailed; private boolean retryFailed;
public ClusterRerouteRequest(StreamInput in) throws IOException {
super(in);
commands = AllocationCommands.readFrom(in);
dryRun = in.readBoolean();
explain = in.readBoolean();
retryFailed = in.readBoolean();
}
public ClusterRerouteRequest() { public ClusterRerouteRequest() {
} }
@ -121,15 +129,6 @@ public class ClusterRerouteRequest extends AcknowledgedRequest<ClusterRerouteReq
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
commands = AllocationCommands.readFrom(in);
dryRun = in.readBoolean();
explain = in.readBoolean();
retryFailed = in.readBoolean();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -65,7 +65,7 @@ public class TransportClusterRerouteAction extends TransportMasterNodeAction<Clu
ThreadPool threadPool, AllocationService allocationService, ActionFilters actionFilters, ThreadPool threadPool, AllocationService allocationService, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) { IndexNameExpressionResolver indexNameExpressionResolver) {
super(ClusterRerouteAction.NAME, transportService, clusterService, threadPool, actionFilters, super(ClusterRerouteAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, ClusterRerouteRequest::new); ClusterRerouteRequest::new, indexNameExpressionResolver);
this.allocationService = allocationService; this.allocationService = allocationService;
} }

View File

@ -61,6 +61,12 @@ public class ClusterUpdateSettingsRequest extends AcknowledgedRequest<ClusterUpd
private Settings transientSettings = EMPTY_SETTINGS; private Settings transientSettings = EMPTY_SETTINGS;
private Settings persistentSettings = EMPTY_SETTINGS; private Settings persistentSettings = EMPTY_SETTINGS;
public ClusterUpdateSettingsRequest(StreamInput in) throws IOException {
super(in);
transientSettings = readSettingsFromStream(in);
persistentSettings = readSettingsFromStream(in);
}
public ClusterUpdateSettingsRequest() { public ClusterUpdateSettingsRequest() {
} }
@ -157,13 +163,6 @@ public class ClusterUpdateSettingsRequest extends AcknowledgedRequest<ClusterUpd
return this; return this;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
transientSettings = readSettingsFromStream(in);
persistentSettings = readSettingsFromStream(in);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -55,7 +55,7 @@ public class TransportClusterUpdateSettingsAction extends
ThreadPool threadPool, AllocationService allocationService, ActionFilters actionFilters, ThreadPool threadPool, AllocationService allocationService, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver, ClusterSettings clusterSettings) { IndexNameExpressionResolver indexNameExpressionResolver, ClusterSettings clusterSettings) {
super(ClusterUpdateSettingsAction.NAME, false, transportService, clusterService, threadPool, actionFilters, super(ClusterUpdateSettingsAction.NAME, false, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, ClusterUpdateSettingsRequest::new); ClusterUpdateSettingsRequest::new, indexNameExpressionResolver);
this.allocationService = allocationService; this.allocationService = allocationService;
this.clusterSettings = clusterSettings; this.clusterSettings = clusterSettings;
} }

View File

@ -33,6 +33,15 @@ public class DeleteStoredScriptRequest extends AcknowledgedRequest<DeleteStoredS
private String id; private String id;
public DeleteStoredScriptRequest(StreamInput in) throws IOException {
super(in);
if (in.getVersion().before(Version.V_6_0_0_alpha2)) {
in.readString(); // read lang from previous versions
}
id = in.readString();
}
DeleteStoredScriptRequest() { DeleteStoredScriptRequest() {
super(); super();
} }
@ -66,17 +75,6 @@ public class DeleteStoredScriptRequest extends AcknowledgedRequest<DeleteStoredS
return this; return this;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
if (in.getVersion().before(Version.V_6_0_0_alpha2)) {
in.readString(); // read lang from previous versions
}
id = in.readString();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -44,6 +44,22 @@ public class PutStoredScriptRequest extends AcknowledgedRequest<PutStoredScriptR
private XContentType xContentType; private XContentType xContentType;
private StoredScriptSource source; private StoredScriptSource source;
public PutStoredScriptRequest(StreamInput in) throws IOException {
super(in);
if (in.getVersion().before(Version.V_6_0_0_alpha2)) {
in.readString(); // read lang from previous versions
}
id = in.readOptionalString();
content = in.readBytesReference();
xContentType = in.readEnum(XContentType.class);
if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha2)) {
context = in.readOptionalString();
source = new StoredScriptSource(in);
} else {
source = StoredScriptSource.parse(content, xContentType == null ? XContentType.JSON : xContentType);
}
}
public PutStoredScriptRequest() { public PutStoredScriptRequest() {
super(); super();
} }
@ -114,24 +130,6 @@ public class PutStoredScriptRequest extends AcknowledgedRequest<PutStoredScriptR
return this; return this;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
if (in.getVersion().before(Version.V_6_0_0_alpha2)) {
in.readString(); // read lang from previous versions
}
id = in.readOptionalString();
content = in.readBytesReference();
xContentType = in.readEnum(XContentType.class);
if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha2)) {
context = in.readOptionalString();
source = new StoredScriptSource(in);
} else {
source = StoredScriptSource.parse(content, xContentType == null ? XContentType.JSON : xContentType);
}
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -45,7 +45,7 @@ public class TransportDeleteStoredScriptAction extends TransportMasterNodeAction
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
ScriptService scriptService) { ScriptService scriptService) {
super(DeleteStoredScriptAction.NAME, transportService, clusterService, threadPool, actionFilters, super(DeleteStoredScriptAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, DeleteStoredScriptRequest::new); DeleteStoredScriptRequest::new, indexNameExpressionResolver);
this.scriptService = scriptService; this.scriptService = scriptService;
} }

View File

@ -45,7 +45,7 @@ public class TransportPutStoredScriptAction extends TransportMasterNodeAction<Pu
ThreadPool threadPool, ActionFilters actionFilters, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver, ScriptService scriptService) { IndexNameExpressionResolver indexNameExpressionResolver, ScriptService scriptService) {
super(PutStoredScriptAction.NAME, transportService, clusterService, threadPool, actionFilters, super(PutStoredScriptAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, PutStoredScriptRequest::new); PutStoredScriptRequest::new, indexNameExpressionResolver);
this.scriptService = scriptService; this.scriptService = scriptService;
} }

View File

@ -70,6 +70,16 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
// expressions only against indices // expressions only against indices
private static final IndicesOptions INDICES_OPTIONS = IndicesOptions.fromOptions(false, false, true, false, true, false, true, false); private static final IndicesOptions INDICES_OPTIONS = IndicesOptions.fromOptions(false, false, true, false, true, false, true, false);
public IndicesAliasesRequest(StreamInput in) throws IOException {
super(in);
allAliasActions = in.readList(AliasActions::new);
if (in.getVersion().onOrAfter(Version.V_7_3_0)) {
origin = in.readOptionalString();
} else {
origin = null;
}
}
public IndicesAliasesRequest() { public IndicesAliasesRequest() {
} }
@ -571,17 +581,6 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
return validationException; return validationException;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
allAliasActions = in.readList(AliasActions::new);
if (in.getVersion().onOrAfter(Version.V_7_3_0)) {
origin = in.readOptionalString();
} else {
origin = null;
}
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -72,8 +72,8 @@ public class TransportIndicesAliasesAction extends TransportMasterNodeAction<Ind
final ActionFilters actionFilters, final ActionFilters actionFilters,
final IndexNameExpressionResolver indexNameExpressionResolver, final IndexNameExpressionResolver indexNameExpressionResolver,
final RequestValidators<IndicesAliasesRequest> requestValidators) { final RequestValidators<IndicesAliasesRequest> requestValidators) {
super(IndicesAliasesAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(IndicesAliasesAction.NAME, transportService, clusterService, threadPool, actionFilters, IndicesAliasesRequest::new,
IndicesAliasesRequest::new); indexNameExpressionResolver);
this.indexAliasesService = indexAliasesService; this.indexAliasesService = indexAliasesService;
this.requestValidators = Objects.requireNonNull(requestValidators); this.requestValidators = Objects.requireNonNull(requestValidators);
} }

View File

@ -42,6 +42,17 @@ public class CloseIndexRequest extends AcknowledgedRequest<CloseIndexRequest> im
private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen(); private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen();
private ActiveShardCount waitForActiveShards = ActiveShardCount.NONE; private ActiveShardCount waitForActiveShards = ActiveShardCount.NONE;
public CloseIndexRequest(StreamInput in) throws IOException {
super(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
if (in.getVersion().onOrAfter(Version.V_7_2_0)) {
waitForActiveShards = ActiveShardCount.readFrom(in);
} else {
waitForActiveShards = ActiveShardCount.NONE;
}
}
public CloseIndexRequest() { public CloseIndexRequest() {
} }
@ -113,18 +124,6 @@ public class CloseIndexRequest extends AcknowledgedRequest<CloseIndexRequest> im
return this; return this;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
if (in.getVersion().onOrAfter(Version.V_7_2_0)) {
waitForActiveShards = ActiveShardCount.readFrom(in);
} else {
waitForActiveShards = ActiveShardCount.NONE;
}
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -60,8 +60,8 @@ public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIn
ThreadPool threadPool, MetaDataIndexStateService indexStateService, ThreadPool threadPool, MetaDataIndexStateService indexStateService,
ClusterSettings clusterSettings, ActionFilters actionFilters, ClusterSettings clusterSettings, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver, DestructiveOperations destructiveOperations) { IndexNameExpressionResolver indexNameExpressionResolver, DestructiveOperations destructiveOperations) {
super(CloseIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(CloseIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, CloseIndexRequest::new,
CloseIndexRequest::new); indexNameExpressionResolver);
this.indexStateService = indexStateService; this.indexStateService = indexStateService;
this.destructiveOperations = destructiveOperations; this.destructiveOperations = destructiveOperations;
this.closeIndexEnabled = CLUSTER_INDICES_CLOSE_ENABLE_SETTING.get(settings); this.closeIndexEnabled = CLUSTER_INDICES_CLOSE_ENABLE_SETTING.get(settings);

View File

@ -88,6 +88,39 @@ public class CreateIndexRequest extends AcknowledgedRequest<CreateIndexRequest>
private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT; private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT;
public CreateIndexRequest(StreamInput in) throws IOException {
super(in);
cause = in.readString();
index = in.readString();
settings = readSettingsFromStream(in);
int size = in.readVInt();
for (int i = 0; i < size; i++) {
final String type = in.readString();
String source = in.readString();
if (in.getVersion().before(Version.V_6_0_0_alpha1)) { // TODO change to 5.3.0 after backport
// we do not know the content type that comes from earlier versions so we autodetect and convert
source = XContentHelper.convertToJson(new BytesArray(source), false, false, XContentFactory.xContentType(source));
}
mappings.put(type, source);
}
if (in.getVersion().before(Version.V_6_5_0)) {
// This used to be the size of custom metadata classes
int customSize = in.readVInt();
assert customSize == 0 : "unexpected custom metadata when none is supported";
if (customSize > 0) {
throw new IllegalStateException("unexpected custom metadata when none is supported");
}
}
int aliasesSize = in.readVInt();
for (int i = 0; i < aliasesSize; i++) {
aliases.add(Alias.read(in));
}
if (in.getVersion().before(Version.V_7_0_0)) {
in.readBoolean(); // updateAllTypes
}
waitForActiveShards = ActiveShardCount.readFrom(in);
}
public CreateIndexRequest() { public CreateIndexRequest() {
} }
@ -430,42 +463,7 @@ public class CreateIndexRequest extends AcknowledgedRequest<CreateIndexRequest>
public CreateIndexRequest waitForActiveShards(final int waitForActiveShards) { public CreateIndexRequest waitForActiveShards(final int waitForActiveShards) {
return waitForActiveShards(ActiveShardCount.from(waitForActiveShards)); return waitForActiveShards(ActiveShardCount.from(waitForActiveShards));
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
cause = in.readString();
index = in.readString();
settings = readSettingsFromStream(in);
int size = in.readVInt();
for (int i = 0; i < size; i++) {
final String type = in.readString();
String source = in.readString();
if (in.getVersion().before(Version.V_6_0_0_alpha1)) { // TODO change to 5.3.0 after backport
// we do not know the content type that comes from earlier versions so we autodetect and convert
source = XContentHelper.convertToJson(new BytesArray(source), false, false, XContentFactory.xContentType(source));
}
mappings.put(type, source);
}
if (in.getVersion().before(Version.V_6_5_0)) {
// This used to be the size of custom metadata classes
int customSize = in.readVInt();
assert customSize == 0 : "unexpected custom metadata when none is supported";
if (customSize > 0) {
throw new IllegalStateException("unexpected custom metadata when none is supported");
}
}
int aliasesSize = in.readVInt();
for (int i = 0; i < aliasesSize; i++) {
aliases.add(Alias.read(in));
}
if (in.getVersion().before(Version.V_7_0_0)) {
in.readBoolean(); // updateAllTypes
}
waitForActiveShards = ActiveShardCount.readFrom(in);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -46,8 +46,8 @@ public class TransportCreateIndexAction extends TransportMasterNodeAction<Create
public TransportCreateIndexAction(TransportService transportService, ClusterService clusterService, public TransportCreateIndexAction(TransportService transportService, ClusterService clusterService,
ThreadPool threadPool, MetaDataCreateIndexService createIndexService, ThreadPool threadPool, MetaDataCreateIndexService createIndexService,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) { ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
super(CreateIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(CreateIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, CreateIndexRequest::new,
CreateIndexRequest::new); indexNameExpressionResolver);
this.createIndexService = createIndexService; this.createIndexService = createIndexService;
} }

View File

@ -40,6 +40,12 @@ public class DeleteIndexRequest extends AcknowledgedRequest<DeleteIndexRequest>
// Delete index should work by default on both open and closed indices. // Delete index should work by default on both open and closed indices.
private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, true, true, false, false, true, false); private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, true, true, false, false, true, false);
public DeleteIndexRequest(StreamInput in) throws IOException {
super(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
}
public DeleteIndexRequest() { public DeleteIndexRequest() {
} }
@ -94,13 +100,6 @@ public class DeleteIndexRequest extends AcknowledgedRequest<DeleteIndexRequest>
return indices; return indices;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -56,8 +56,8 @@ public class TransportDeleteIndexAction extends TransportMasterNodeAction<Delete
MetaDataDeleteIndexService deleteIndexService, ActionFilters actionFilters, MetaDataDeleteIndexService deleteIndexService, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver, IndexNameExpressionResolver indexNameExpressionResolver,
DestructiveOperations destructiveOperations) { DestructiveOperations destructiveOperations) {
super(DeleteIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(DeleteIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, DeleteIndexRequest::new,
DeleteIndexRequest::new); indexNameExpressionResolver );
this.deleteIndexService = deleteIndexService; this.deleteIndexService = deleteIndexService;
this.destructiveOperations = destructiveOperations; this.destructiveOperations = destructiveOperations;
} }

View File

@ -77,6 +77,23 @@ public class PutMappingRequest extends AcknowledgedRequest<PutMappingRequest> im
private Index concreteIndex; private Index concreteIndex;
public PutMappingRequest(StreamInput in) throws IOException {
super(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
type = in.readOptionalString();
source = in.readString();
if (in.getVersion().before(Version.V_7_0_0)) {
in.readBoolean(); // updateAllTypes
}
concreteIndex = in.readOptionalWriteable(Index::new);
if (in.getVersion().onOrAfter(Version.V_6_7_0)) {
origin = in.readOptionalString();
} else {
origin = null;
}
}
public PutMappingRequest() { public PutMappingRequest() {
} }
@ -300,24 +317,6 @@ public class PutMappingRequest extends AcknowledgedRequest<PutMappingRequest> im
} }
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
type = in.readOptionalString();
source = in.readString();
if (in.getVersion().before(Version.V_7_0_0)) {
in.readBoolean(); // updateAllTypes
}
concreteIndex = in.readOptionalWriteable(Index::new);
if (in.getVersion().onOrAfter(Version.V_6_7_0)) {
origin = in.readOptionalString();
} else {
origin = null;
}
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -60,8 +60,8 @@ public class TransportPutMappingAction extends TransportMasterNodeAction<PutMapp
final ActionFilters actionFilters, final ActionFilters actionFilters,
final IndexNameExpressionResolver indexNameExpressionResolver, final IndexNameExpressionResolver indexNameExpressionResolver,
final RequestValidators<PutMappingRequest> requestValidators) { final RequestValidators<PutMappingRequest> requestValidators) {
super(PutMappingAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(PutMappingAction.NAME, transportService, clusterService, threadPool, actionFilters, PutMappingRequest::new,
PutMappingRequest::new); indexNameExpressionResolver);
this.metaDataMappingService = metaDataMappingService; this.metaDataMappingService = metaDataMappingService;
this.requestValidators = Objects.requireNonNull(requestValidators); this.requestValidators = Objects.requireNonNull(requestValidators);
} }

View File

@ -42,6 +42,15 @@ public class OpenIndexRequest extends AcknowledgedRequest<OpenIndexRequest> impl
private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, false, true); private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, false, true);
private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT; private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT;
public OpenIndexRequest(StreamInput in) throws IOException {
super(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
if (in.getVersion().onOrAfter(Version.V_6_1_0)) {
waitForActiveShards = ActiveShardCount.readFrom(in);
}
}
public OpenIndexRequest() { public OpenIndexRequest() {
} }
@ -136,16 +145,6 @@ public class OpenIndexRequest extends AcknowledgedRequest<OpenIndexRequest> impl
return waitForActiveShards(ActiveShardCount.from(waitForActiveShards)); return waitForActiveShards(ActiveShardCount.from(waitForActiveShards));
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
if (in.getVersion().onOrAfter(Version.V_6_1_0)) {
waitForActiveShards = ActiveShardCount.readFrom(in);
}
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -53,8 +53,8 @@ public class TransportOpenIndexAction extends TransportMasterNodeAction<OpenInde
ThreadPool threadPool, MetaDataIndexStateService indexStateService, ThreadPool threadPool, MetaDataIndexStateService indexStateService,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
DestructiveOperations destructiveOperations) { DestructiveOperations destructiveOperations) {
super(OpenIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(OpenIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, OpenIndexRequest::new,
OpenIndexRequest::new); indexNameExpressionResolver);
this.indexStateService = indexStateService; this.indexStateService = indexStateService;
this.destructiveOperations = destructiveOperations; this.destructiveOperations = destructiveOperations;
} }

View File

@ -96,6 +96,19 @@ public class RolloverRequest extends AcknowledgedRequest<RolloverRequest> implem
//the index name "_na_" is never read back, what matters are settings, mappings and aliases //the index name "_na_" is never read back, what matters are settings, mappings and aliases
private CreateIndexRequest createIndexRequest = new CreateIndexRequest("_na_"); private CreateIndexRequest createIndexRequest = new CreateIndexRequest("_na_");
public RolloverRequest(StreamInput in) throws IOException {
super(in);
alias = in.readString();
newIndexName = in.readOptionalString();
dryRun = in.readBoolean();
int size = in.readVInt();
for (int i = 0; i < size; i++) {
Condition<?> condition = in.readNamedWriteable(Condition.class);
this.conditions.put(condition.name, condition);
}
createIndexRequest = new CreateIndexRequest(in);
}
RolloverRequest() {} RolloverRequest() {}
public RolloverRequest(String alias, String newIndexName) { public RolloverRequest(String alias, String newIndexName) {
@ -112,21 +125,6 @@ public class RolloverRequest extends AcknowledgedRequest<RolloverRequest> implem
return validationException; return validationException;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
alias = in.readString();
newIndexName = in.readOptionalString();
dryRun = in.readBoolean();
int size = in.readVInt();
for (int i = 0; i < size; i++) {
Condition<?> condition = in.readNamedWriteable(Condition.class);
this.conditions.put(condition.name, condition);
}
createIndexRequest = new CreateIndexRequest();
createIndexRequest.readFrom(in);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -80,8 +80,8 @@ public class TransportRolloverAction extends TransportMasterNodeAction<RolloverR
ThreadPool threadPool, MetaDataCreateIndexService createIndexService, ThreadPool threadPool, MetaDataCreateIndexService createIndexService,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
MetaDataIndexAliasesService indexAliasesService, Client client) { MetaDataIndexAliasesService indexAliasesService, Client client) {
super(RolloverAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(RolloverAction.NAME, transportService, clusterService, threadPool, actionFilters, RolloverRequest::new,
RolloverRequest::new); indexNameExpressionResolver);
this.createIndexService = createIndexService; this.createIndexService = createIndexService;
this.indexAliasesService = indexAliasesService; this.indexAliasesService = indexAliasesService;
this.client = client; this.client = client;

View File

@ -48,8 +48,8 @@ public class TransportUpdateSettingsAction extends TransportMasterNodeAction<Upd
public TransportUpdateSettingsAction(TransportService transportService, ClusterService clusterService, public TransportUpdateSettingsAction(TransportService transportService, ClusterService clusterService,
ThreadPool threadPool, MetaDataUpdateSettingsService updateSettingsService, ThreadPool threadPool, MetaDataUpdateSettingsService updateSettingsService,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) { ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
super(UpdateSettingsAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(UpdateSettingsAction.NAME, transportService, clusterService, threadPool, actionFilters, UpdateSettingsRequest::new,
UpdateSettingsRequest::new); indexNameExpressionResolver);
this.updateSettingsService = updateSettingsService; this.updateSettingsService = updateSettingsService;
} }

View File

@ -56,6 +56,14 @@ public class UpdateSettingsRequest extends AcknowledgedRequest<UpdateSettingsReq
private Settings settings = EMPTY_SETTINGS; private Settings settings = EMPTY_SETTINGS;
private boolean preserveExisting = false; private boolean preserveExisting = false;
public UpdateSettingsRequest(StreamInput in) throws IOException {
super(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
settings = readSettingsFromStream(in);
preserveExisting = in.readBoolean();
}
public UpdateSettingsRequest() { public UpdateSettingsRequest() {
} }
@ -166,15 +174,6 @@ public class UpdateSettingsRequest extends AcknowledgedRequest<UpdateSettingsReq
return this; return this;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
settings = readSettingsFromStream(in);
preserveExisting = in.readBoolean();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -58,6 +58,22 @@ public class ResizeRequest extends AcknowledgedRequest<ResizeRequest> implements
private ResizeType type = ResizeType.SHRINK; private ResizeType type = ResizeType.SHRINK;
private Boolean copySettings = true; private Boolean copySettings = true;
public ResizeRequest(StreamInput in) throws IOException {
super(in);
targetIndexRequest = new CreateIndexRequest(in);
sourceIndex = in.readString();
if (in.getVersion().onOrAfter(ResizeAction.COMPATIBILITY_VERSION)) {
type = in.readEnum(ResizeType.class);
} else {
type = ResizeType.SHRINK; // BWC this used to be shrink only
}
if (in.getVersion().before(Version.V_6_4_0)) {
copySettings = null;
} else {
copySettings = in.readOptionalBoolean();
}
}
ResizeRequest() {} ResizeRequest() {}
public ResizeRequest(String targetIndex, String sourceIndex) { public ResizeRequest(String targetIndex, String sourceIndex) {
@ -88,24 +104,6 @@ public class ResizeRequest extends AcknowledgedRequest<ResizeRequest> implements
this.sourceIndex = index; this.sourceIndex = index;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
targetIndexRequest = new CreateIndexRequest();
targetIndexRequest.readFrom(in);
sourceIndex = in.readString();
if (in.getVersion().onOrAfter(ResizeAction.COMPATIBILITY_VERSION)) {
type = in.readEnum(ResizeType.class);
} else {
type = ResizeType.SHRINK; // BWC this used to be shrink only
}
if (in.getVersion().before(Version.V_6_4_0)) {
copySettings = null;
} else {
copySettings = in.readOptionalBoolean();
}
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -69,8 +69,7 @@ public class TransportResizeAction extends TransportMasterNodeAction<ResizeReque
protected TransportResizeAction(String actionName, TransportService transportService, ClusterService clusterService, protected TransportResizeAction(String actionName, TransportService transportService, ClusterService clusterService,
ThreadPool threadPool, MetaDataCreateIndexService createIndexService, ThreadPool threadPool, MetaDataCreateIndexService createIndexService,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Client client) { ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Client client) {
super(actionName, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(actionName, transportService, clusterService, threadPool, actionFilters, ResizeRequest::new, indexNameExpressionResolver);
ResizeRequest::new);
this.createIndexService = createIndexService; this.createIndexService = createIndexService;
this.client = client; this.client = client;
} }

View File

@ -47,7 +47,7 @@ public class TransportUpgradeSettingsAction extends TransportMasterNodeAction<Up
ThreadPool threadPool, MetaDataUpdateSettingsService updateSettingsService, ThreadPool threadPool, MetaDataUpdateSettingsService updateSettingsService,
IndexNameExpressionResolver indexNameExpressionResolver, ActionFilters actionFilters) { IndexNameExpressionResolver indexNameExpressionResolver, ActionFilters actionFilters) {
super(UpgradeSettingsAction.NAME, transportService, clusterService, threadPool, actionFilters, super(UpgradeSettingsAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, UpgradeSettingsRequest::new); UpgradeSettingsRequest::new, indexNameExpressionResolver);
this.updateSettingsService = updateSettingsService; this.updateSettingsService = updateSettingsService;
} }

View File

@ -39,6 +39,18 @@ public class UpgradeSettingsRequest extends AcknowledgedRequest<UpgradeSettingsR
private Map<String, Tuple<Version, String>> versions; private Map<String, Tuple<Version, String>> versions;
public UpgradeSettingsRequest(StreamInput in) throws IOException {
super(in);
int size = in.readVInt();
versions = new HashMap<>();
for (int i=0; i<size; i++) {
String index = in.readString();
Version upgradeVersion = Version.readVersion(in);
String oldestLuceneSegment = in.readString();
versions.put(index, new Tuple<>(upgradeVersion, oldestLuceneSegment));
}
}
public UpgradeSettingsRequest() { public UpgradeSettingsRequest() {
} }
@ -74,20 +86,6 @@ public class UpgradeSettingsRequest extends AcknowledgedRequest<UpgradeSettingsR
return this; return this;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
int size = in.readVInt();
versions = new HashMap<>();
for (int i=0; i<size; i++) {
String index = in.readString();
Version upgradeVersion = Version.readVersion(in);
String oldestLuceneSegment = in.readString();
versions.put(index, new Tuple<>(upgradeVersion, oldestLuceneSegment));
}
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -39,6 +39,11 @@ public class DeletePipelineRequest extends AcknowledgedRequest<DeletePipelineReq
this.id = id; this.id = id;
} }
public DeletePipelineRequest(StreamInput in) throws IOException {
super(in);
id = in.readString();
}
DeletePipelineRequest() { DeletePipelineRequest() {
} }
@ -55,12 +60,6 @@ public class DeletePipelineRequest extends AcknowledgedRequest<DeletePipelineReq
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
id = in.readString();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -43,7 +43,7 @@ public class DeletePipelineTransportAction extends TransportMasterNodeAction<Del
public DeletePipelineTransportAction(ThreadPool threadPool, IngestService ingestService, TransportService transportService, public DeletePipelineTransportAction(ThreadPool threadPool, IngestService ingestService, TransportService transportService,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) { ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
super(DeletePipelineAction.NAME, transportService, ingestService.getClusterService(), super(DeletePipelineAction.NAME, transportService, ingestService.getClusterService(),
threadPool, actionFilters, indexNameExpressionResolver, DeletePipelineRequest::new); threadPool, actionFilters, DeletePipelineRequest::new, indexNameExpressionResolver);
this.ingestService = ingestService; this.ingestService = ingestService;
} }

View File

@ -46,6 +46,13 @@ public class PutPipelineRequest extends AcknowledgedRequest<PutPipelineRequest>
this.xContentType = Objects.requireNonNull(xContentType); this.xContentType = Objects.requireNonNull(xContentType);
} }
public PutPipelineRequest(StreamInput in) throws IOException {
super(in);
id = in.readString();
source = in.readBytesReference();
xContentType = in.readEnum(XContentType.class);
}
PutPipelineRequest() { PutPipelineRequest() {
} }
@ -66,14 +73,6 @@ public class PutPipelineRequest extends AcknowledgedRequest<PutPipelineRequest>
return xContentType; return xContentType;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
id = in.readString();
source = in.readBytesReference();
xContentType = in.readEnum(XContentType.class);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -53,7 +53,7 @@ public class PutPipelineTransportAction extends TransportMasterNodeAction<PutPip
IngestService ingestService, NodeClient client) { IngestService ingestService, NodeClient client) {
super( super(
PutPipelineAction.NAME, transportService, ingestService.getClusterService(), PutPipelineAction.NAME, transportService, ingestService.getClusterService(),
threadPool, actionFilters, indexNameExpressionResolver, PutPipelineRequest::new threadPool, actionFilters, PutPipelineRequest::new, indexNameExpressionResolver
); );
this.client = client; this.client = client;
this.ingestService = ingestService; this.ingestService = ingestService;

View File

@ -82,9 +82,8 @@ public abstract class AcknowledgedRequest<Request extends MasterNodeRequest<Requ
} }
@Override @Override
public void readFrom(StreamInput in) throws IOException { public final void readFrom(StreamInput in) throws IOException {
super.readFrom(in); throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
timeout = in.readTimeValue();
} }
@Override @Override

View File

@ -165,9 +165,7 @@ public class ClusterRerouteRequestTests extends ESTestCase {
try (BytesStreamOutput output = new BytesStreamOutput()) { try (BytesStreamOutput output = new BytesStreamOutput()) {
original.writeTo(output); original.writeTo(output);
try (StreamInput in = new NamedWriteableAwareStreamInput(output.bytes().streamInput(), namedWriteableRegistry)) { try (StreamInput in = new NamedWriteableAwareStreamInput(output.bytes().streamInput(), namedWriteableRegistry)) {
ClusterRerouteRequest copy = new ClusterRerouteRequest(); return new ClusterRerouteRequest(in);
copy.readFrom(in);
return copy;
} }
} }
} }

View File

@ -68,8 +68,7 @@ public class ClusterRerouteTests extends ESAllocationTestCase {
NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(NetworkModule.getNamedWriteables()); NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(NetworkModule.getNamedWriteables());
StreamInput wrap = new NamedWriteableAwareStreamInput(bytes.streamInput(), StreamInput wrap = new NamedWriteableAwareStreamInput(bytes.streamInput(),
namedWriteableRegistry); namedWriteableRegistry);
ClusterRerouteRequest deserializedReq = new ClusterRerouteRequest(); ClusterRerouteRequest deserializedReq = new ClusterRerouteRequest(wrap);
deserializedReq.readFrom(wrap);
assertEquals(req.isRetryFailed(), deserializedReq.isRetryFailed()); assertEquals(req.isRetryFailed(), deserializedReq.isRetryFailed());
assertEquals(req.dryRun(), deserializedReq.dryRun()); assertEquals(req.dryRun(), deserializedReq.dryRun());

View File

@ -43,8 +43,7 @@ public class PutStoredScriptRequestTests extends ESTestCase {
storedScriptRequest.writeTo(output); storedScriptRequest.writeTo(output);
try (StreamInput in = output.bytes().streamInput()) { try (StreamInput in = output.bytes().streamInput()) {
PutStoredScriptRequest serialized = new PutStoredScriptRequest(); PutStoredScriptRequest serialized = new PutStoredScriptRequest(in);
serialized.readFrom(in);
assertEquals(XContentType.JSON, serialized.xContentType()); assertEquals(XContentType.JSON, serialized.xContentType());
assertEquals(storedScriptRequest.id(), serialized.id()); assertEquals(storedScriptRequest.id(), serialized.id());
assertEquals(storedScriptRequest.context(), serialized.context()); assertEquals(storedScriptRequest.context(), serialized.context());

View File

@ -37,9 +37,9 @@ public class CloseIndexRequestTests extends ESTestCase {
try (BytesStreamOutput out = new BytesStreamOutput()) { try (BytesStreamOutput out = new BytesStreamOutput()) {
request.writeTo(out); request.writeTo(out);
final CloseIndexRequest deserializedRequest = new CloseIndexRequest(); final CloseIndexRequest deserializedRequest;
try (StreamInput in = out.bytes().streamInput()) { try (StreamInput in = out.bytes().streamInput()) {
deserializedRequest.readFrom(in); deserializedRequest = new CloseIndexRequest(in);
} }
assertEquals(request.timeout(), deserializedRequest.timeout()); assertEquals(request.timeout(), deserializedRequest.timeout());
assertEquals(request.masterNodeTimeout(), deserializedRequest.masterNodeTimeout()); assertEquals(request.masterNodeTimeout(), deserializedRequest.masterNodeTimeout());
@ -75,10 +75,10 @@ public class CloseIndexRequestTests extends ESTestCase {
out.writeStringArray(sample.indices()); out.writeStringArray(sample.indices());
sample.indicesOptions().writeIndicesOptions(out); sample.indicesOptions().writeIndicesOptions(out);
final CloseIndexRequest deserializedRequest = new CloseIndexRequest(); final CloseIndexRequest deserializedRequest;
try (StreamInput in = out.bytes().streamInput()) { try (StreamInput in = out.bytes().streamInput()) {
in.setVersion(randomVersionBetween(random(), Version.V_6_4_0, VersionUtils.getPreviousVersion(Version.V_7_2_0))); in.setVersion(randomVersionBetween(random(), Version.V_6_4_0, VersionUtils.getPreviousVersion(Version.V_7_2_0)));
deserializedRequest.readFrom(in); deserializedRequest = new CloseIndexRequest(in);
} }
assertEquals(sample.getParentTask(), deserializedRequest.getParentTask()); assertEquals(sample.getParentTask(), deserializedRequest.getParentTask());
assertEquals(sample.masterNodeTimeout(), deserializedRequest.masterNodeTimeout()); assertEquals(sample.masterNodeTimeout(), deserializedRequest.masterNodeTimeout());

View File

@ -53,8 +53,7 @@ public class CreateIndexRequestTests extends ESTestCase {
request.writeTo(output); request.writeTo(output);
try (StreamInput in = output.bytes().streamInput()) { try (StreamInput in = output.bytes().streamInput()) {
CreateIndexRequest serialized = new CreateIndexRequest(); CreateIndexRequest serialized = new CreateIndexRequest(in);
serialized.readFrom(in);
assertEquals(request.index(), serialized.index()); assertEquals(request.index(), serialized.index());
assertEquals(mapping, serialized.mappings().get("my_type")); assertEquals(mapping, serialized.mappings().get("my_type"));
} }

View File

@ -124,8 +124,7 @@ public class RolloverRequestTests extends ESTestCase {
originalRequest.writeTo(out); originalRequest.writeTo(out);
BytesReference bytes = out.bytes(); BytesReference bytes = out.bytes();
try (StreamInput in = new NamedWriteableAwareStreamInput(bytes.streamInput(), writeableRegistry)) { try (StreamInput in = new NamedWriteableAwareStreamInput(bytes.streamInput(), writeableRegistry)) {
RolloverRequest cloneRequest = new RolloverRequest(); RolloverRequest cloneRequest = new RolloverRequest(in);
cloneRequest.readFrom(in);
assertThat(cloneRequest.getNewIndexName(), equalTo(originalRequest.getNewIndexName())); assertThat(cloneRequest.getNewIndexName(), equalTo(originalRequest.getNewIndexName()));
assertThat(cloneRequest.getAlias(), equalTo(originalRequest.getAlias())); assertThat(cloneRequest.getAlias(), equalTo(originalRequest.getAlias()));
for (Map.Entry<String, Condition<?>> entry : cloneRequest.getConditions().entrySet()) { for (Map.Entry<String, Condition<?>> entry : cloneRequest.getConditions().entrySet()) {

View File

@ -20,11 +20,12 @@
package org.elasticsearch.action.admin.indices.settings.put; package org.elasticsearch.action.admin.indices.settings.put;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.Settings.Builder; import org.elasticsearch.common.settings.Settings.Builder;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import java.util.ArrayList; import java.util.ArrayList;
@ -35,7 +36,7 @@ import java.util.Set;
import java.util.StringJoiner; import java.util.StringJoiner;
import java.util.function.Supplier; import java.util.function.Supplier;
public class UpdateSettingsRequestStreamableTests extends AbstractStreamableTestCase<UpdateSettingsRequest> { public class UpdateSettingsRequestSerializationTests extends AbstractWireSerializingTestCase<UpdateSettingsRequest> {
@Override @Override
protected UpdateSettingsRequest mutateInstance(UpdateSettingsRequest request) { protected UpdateSettingsRequest mutateInstance(UpdateSettingsRequest request) {
@ -60,8 +61,8 @@ public class UpdateSettingsRequestStreamableTests extends AbstractStreamableTest
} }
@Override @Override
protected UpdateSettingsRequest createBlankInstance() { protected Writeable.Reader<UpdateSettingsRequest> instanceReader() {
return new UpdateSettingsRequest(); return UpdateSettingsRequest::new;
} }
public static UpdateSettingsRequest createTestItem() { public static UpdateSettingsRequest createTestItem() {

View File

@ -32,7 +32,7 @@ public class UpdateSettingsRequestTests extends AbstractXContentTestCase<UpdateS
@Override @Override
protected UpdateSettingsRequest createTestInstance() { protected UpdateSettingsRequest createTestInstance() {
UpdateSettingsRequest testRequest = UpdateSettingsRequestStreamableTests.createTestItem(); UpdateSettingsRequest testRequest = UpdateSettingsRequestSerializationTests.createTestItem();
if (enclosedSettings) { if (enclosedSettings) {
UpdateSettingsRequest requestWithEnclosingSettings = new UpdateSettingsRequest(testRequest.settings()) { UpdateSettingsRequest requestWithEnclosingSettings = new UpdateSettingsRequest(testRequest.settings()) {
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {

View File

@ -42,8 +42,7 @@ public class PutPipelineRequestTests extends ESTestCase {
request.writeTo(output); request.writeTo(output);
StreamInput in = StreamInput.wrap(output.bytes().toBytesRef().bytes); StreamInput in = StreamInput.wrap(output.bytes().toBytesRef().bytes);
PutPipelineRequest serialized = new PutPipelineRequest(); PutPipelineRequest serialized = new PutPipelineRequest(in);
serialized.readFrom(in);
assertEquals(XContentType.JSON, serialized.getXContentType()); assertEquals(XContentType.JSON, serialized.getXContentType());
assertEquals("{}", serialized.getSource().utf8ToString()); assertEquals("{}", serialized.getSource().utf8ToString());
} }

View File

@ -16,6 +16,13 @@ public class PostStartBasicRequest extends AcknowledgedRequest<PostStartBasicReq
private boolean acknowledge = false; private boolean acknowledge = false;
public PostStartBasicRequest() {}
public PostStartBasicRequest(StreamInput in) throws IOException {
super(in);
acknowledge = in.readBoolean();
}
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
return null; return null;
@ -30,12 +37,6 @@ public class PostStartBasicRequest extends AcknowledgedRequest<PostStartBasicReq
return acknowledge; return acknowledge;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
acknowledge = in.readBoolean();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -21,6 +21,12 @@ public class PutLicenseRequest extends AcknowledgedRequest<PutLicenseRequest> {
private License license; private License license;
private boolean acknowledge = false; private boolean acknowledge = false;
public PutLicenseRequest(StreamInput in) throws IOException {
super(in);
license = License.readLicense(in);
acknowledge = in.readBoolean();
}
public PutLicenseRequest() { public PutLicenseRequest() {
} }
@ -61,13 +67,6 @@ public class PutLicenseRequest extends AcknowledgedRequest<PutLicenseRequest> {
return acknowledge; return acknowledge;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
license = License.readLicense(in);
acknowledge = in.readBoolean();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -33,7 +33,7 @@ public class TransportDeleteLicenseAction extends TransportMasterNodeAction<Dele
LicenseService licenseService, ThreadPool threadPool, ActionFilters actionFilters, LicenseService licenseService, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) { IndexNameExpressionResolver indexNameExpressionResolver) {
super(DeleteLicenseAction.NAME, transportService, clusterService, threadPool, actionFilters, super(DeleteLicenseAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, DeleteLicenseRequest::new); DeleteLicenseRequest::new, indexNameExpressionResolver);
this.licenseService = licenseService; this.licenseService = licenseService;
} }

View File

@ -29,7 +29,7 @@ public class TransportPostStartBasicAction extends TransportMasterNodeAction<Pos
LicenseService licenseService, ThreadPool threadPool, ActionFilters actionFilters, LicenseService licenseService, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) { IndexNameExpressionResolver indexNameExpressionResolver) {
super(PostStartBasicAction.NAME, transportService, clusterService, threadPool, actionFilters, super(PostStartBasicAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, PostStartBasicRequest::new); PostStartBasicRequest::new, indexNameExpressionResolver);
this.licenseService = licenseService; this.licenseService = licenseService;
} }

View File

@ -30,8 +30,8 @@ public class TransportPutLicenseAction extends TransportMasterNodeAction<PutLice
public TransportPutLicenseAction(TransportService transportService, ClusterService clusterService, public TransportPutLicenseAction(TransportService transportService, ClusterService clusterService,
LicenseService licenseService, ThreadPool threadPool, ActionFilters actionFilters, LicenseService licenseService, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) { IndexNameExpressionResolver indexNameExpressionResolver) {
super(PutLicenseAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(PutLicenseAction.NAME, transportService, clusterService, threadPool, actionFilters, PutLicenseRequest::new,
PutLicenseRequest::new); indexNameExpressionResolver);
this.licenseService = licenseService; this.licenseService = licenseService;
} }

View File

@ -7,10 +7,19 @@ package org.elasticsearch.protocol.xpack.license;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedRequest;
import org.elasticsearch.common.io.stream.StreamInput;
import java.io.IOException;
public class DeleteLicenseRequest extends AcknowledgedRequest<DeleteLicenseRequest> { public class DeleteLicenseRequest extends AcknowledgedRequest<DeleteLicenseRequest> {
public DeleteLicenseRequest() {}
public DeleteLicenseRequest(StreamInput in) throws IOException {
super(in);
}
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
return null; return null;

View File

@ -7,12 +7,20 @@ package org.elasticsearch.protocol.xpack.license;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedRequest;
import org.elasticsearch.common.io.stream.StreamInput;
import java.io.IOException;
public class PutLicenseRequest extends AcknowledgedRequest<PutLicenseRequest> { public class PutLicenseRequest extends AcknowledgedRequest<PutLicenseRequest> {
private String licenseDefinition; private String licenseDefinition;
private boolean acknowledge = false; private boolean acknowledge = false;
public PutLicenseRequest(StreamInput in) throws IOException {
super(in);
}
public PutLicenseRequest() { public PutLicenseRequest() {
} }

View File

@ -8,9 +8,17 @@ package org.elasticsearch.xpack.core.indexlifecycle;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedRequest;
import org.elasticsearch.common.io.stream.StreamInput;
import java.io.IOException;
public class StartILMRequest extends AcknowledgedRequest<StartILMRequest> { public class StartILMRequest extends AcknowledgedRequest<StartILMRequest> {
public StartILMRequest(StreamInput in) throws IOException {
super(in);
}
public StartILMRequest() { public StartILMRequest() {
} }

View File

@ -8,9 +8,17 @@ package org.elasticsearch.xpack.core.indexlifecycle;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.AcknowledgedRequest; import org.elasticsearch.action.support.master.AcknowledgedRequest;
import org.elasticsearch.common.io.stream.StreamInput;
import java.io.IOException;
public class StopILMRequest extends AcknowledgedRequest<StopILMRequest> { public class StopILMRequest extends AcknowledgedRequest<StopILMRequest> {
public StopILMRequest(StreamInput in) throws IOException {
super(in);
}
public StopILMRequest() { public StopILMRequest() {
} }

View File

@ -53,6 +53,11 @@ public class DeleteLifecycleAction extends ActionType<DeleteLifecycleAction.Resp
this.policyName = policyName; this.policyName = policyName;
} }
public Request(StreamInput in) throws IOException {
super(in);
policyName = in.readString();
}
public Request() { public Request() {
} }
@ -65,12 +70,6 @@ public class DeleteLifecycleAction extends ActionType<DeleteLifecycleAction.Resp
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
policyName = in.readString();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -109,6 +109,11 @@ public class GetLifecycleAction extends StreamableResponseActionType<GetLifecycl
this.policyNames = policyNames; this.policyNames = policyNames;
} }
public Request(StreamInput in) throws IOException {
super(in);
policyNames = in.readStringArray();
}
public Request() { public Request() {
policyNames = Strings.EMPTY_ARRAY; policyNames = Strings.EMPTY_ARRAY;
} }
@ -122,12 +127,6 @@ public class GetLifecycleAction extends StreamableResponseActionType<GetLifecycl
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
policyNames = in.readStringArray();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -92,6 +92,10 @@ public class GetStatusAction extends StreamableResponseActionType<GetStatusActio
public static class Request extends AcknowledgedRequest<Request> { public static class Request extends AcknowledgedRequest<Request> {
public Request(StreamInput in) throws IOException {
super(in);
}
public Request() { public Request() {
} }
@ -100,11 +104,6 @@ public class GetStatusAction extends StreamableResponseActionType<GetStatusActio
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -73,6 +73,13 @@ public class MoveToStepAction extends ActionType<MoveToStepAction.Response> {
this.nextStepKey = nextStepKey; this.nextStepKey = nextStepKey;
} }
public Request(StreamInput in) throws IOException {
super(in);
this.index = in.readString();
this.currentStepKey = new StepKey(in);
this.nextStepKey = new StepKey(in);
}
public Request() { public Request() {
} }
@ -97,14 +104,6 @@ public class MoveToStepAction extends ActionType<MoveToStepAction.Response> {
return PARSER.apply(parser, name); return PARSER.apply(parser, name);
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
this.index = in.readString();
this.currentStepKey = new StepKey(in);
this.nextStepKey = new StepKey(in);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -62,6 +62,11 @@ public class PutLifecycleAction extends ActionType<PutLifecycleAction.Response>
this.policy = policy; this.policy = policy;
} }
public Request(StreamInput in) throws IOException {
super(in);
policy = new LifecyclePolicy(in);
}
public Request() { public Request() {
} }
@ -86,12 +91,6 @@ public class PutLifecycleAction extends ActionType<PutLifecycleAction.Response>
return builder; return builder;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
policy = new LifecyclePolicy(in);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -114,6 +114,12 @@ public class RemoveIndexLifecyclePolicyAction extends StreamableResponseActionTy
private String[] indices; private String[] indices;
private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen(); private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen();
public Request(StreamInput in) throws IOException {
super(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
}
public Request() { public Request() {
} }
@ -148,13 +154,6 @@ public class RemoveIndexLifecyclePolicyAction extends StreamableResponseActionTy
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -54,6 +54,12 @@ public class RetryAction extends ActionType<RetryAction.Response> {
this.indices = indices; this.indices = indices;
} }
public Request(StreamInput in) throws IOException {
super(in);
this.indices = in.readStringArray();
this.indicesOptions = IndicesOptions.readIndicesOptions(in);
}
public Request() { public Request() {
} }
@ -83,13 +89,6 @@ public class RetryAction extends ActionType<RetryAction.Response> {
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
this.indices = in.readStringArray();
this.indicesOptions = IndicesOptions.readIndicesOptions(in);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -39,6 +39,11 @@ public class DeleteCalendarAction extends ActionType<AcknowledgedResponse> {
private String calendarId; private String calendarId;
public Request(StreamInput in) throws IOException {
super(in);
calendarId = in.readString();
}
public Request() { public Request() {
} }
@ -55,12 +60,6 @@ public class DeleteCalendarAction extends ActionType<AcknowledgedResponse> {
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
calendarId = in.readString();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -39,6 +39,12 @@ public class DeleteCalendarEventAction extends ActionType<AcknowledgedResponse>
private String calendarId; private String calendarId;
private String eventId; private String eventId;
public Request(StreamInput in) throws IOException {
super(in);
calendarId = in.readString();
eventId = in.readString();
}
public Request() { public Request() {
} }
@ -60,13 +66,6 @@ public class DeleteCalendarEventAction extends ActionType<AcknowledgedResponse>
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
calendarId = in.readString();
eventId = in.readString();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -74,11 +74,6 @@ public class DeleteDatafeedAction extends ActionType<AcknowledgedResponse> {
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -41,6 +41,11 @@ public class DeleteFilterAction extends ActionType<AcknowledgedResponse> {
private String filterId; private String filterId;
public Request(StreamInput in) throws IOException {
super(in);
filterId = in.readString();
}
public Request() { public Request() {
} }
@ -58,12 +63,6 @@ public class DeleteFilterAction extends ActionType<AcknowledgedResponse> {
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
filterId = in.readString();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -40,6 +40,13 @@ public class DeleteForecastAction extends ActionType<AcknowledgedResponse> {
private String forecastId; private String forecastId;
private boolean allowNoForecasts = true; private boolean allowNoForecasts = true;
public Request(StreamInput in) throws IOException {
super(in);
jobId = in.readString();
forecastId = in.readString();
allowNoForecasts = in.readBoolean();
}
public Request() { public Request() {
} }
@ -69,14 +76,6 @@ public class DeleteForecastAction extends ActionType<AcknowledgedResponse> {
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
jobId = in.readString();
forecastId = in.readString();
allowNoForecasts = in.readBoolean();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -98,11 +98,6 @@ public class DeleteJobAction extends ActionType<AcknowledgedResponse> {
return new JobDeletionTask(id, type, action, "delete-job-" + jobId, parentTaskId, headers); return new JobDeletionTask(id, type, action, "delete-job-" + jobId, parentTaskId, headers);
} }
@Override
public void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -60,11 +60,6 @@ public class PutDataFrameAnalyticsAction extends ActionType<PutDataFrameAnalytic
this.config = config; this.config = config;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -62,11 +62,6 @@ public class PutDatafeedAction extends ActionType<PutDatafeedAction.Response> {
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -86,11 +86,6 @@ public class PutJobAction extends ActionType<PutJobAction.Response> {
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -102,11 +102,6 @@ public class RevertModelSnapshotAction extends ActionType<RevertModelSnapshotAct
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -53,7 +53,8 @@ public class SetUpgradeModeAction extends ActionType<AcknowledgedResponse> {
} }
public Request(StreamInput in) throws IOException { public Request(StreamInput in) throws IOException {
readFrom(in); super(in);
this.enabled = in.readBoolean();
} }
public Request() { public Request() {
@ -68,12 +69,6 @@ public class SetUpgradeModeAction extends ActionType<AcknowledgedResponse> {
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
this.enabled = in.readBoolean();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -60,11 +60,6 @@ public class UpdateDatafeedAction extends ActionType<PutDatafeedAction.Response>
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -96,11 +96,6 @@ public class UpdateJobAction extends ActionType<PutJobAction.Response> {
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -49,6 +49,11 @@ public class PutRollupJobAction extends ActionType<AcknowledgedResponse> {
this.config = config; this.config = config;
} }
public Request(StreamInput in) throws IOException {
super(in);
this.config = new RollupJobConfig(in);
}
public Request() { public Request() {
} }
@ -65,12 +70,6 @@ public class PutRollupJobAction extends ActionType<AcknowledgedResponse> {
this.config = config; this.config = config;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
this.config = new RollupJobConfig(in);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -35,6 +35,11 @@ public class DeleteSnapshotLifecycleAction extends ActionType<DeleteSnapshotLife
private String lifecycleId; private String lifecycleId;
public Request(StreamInput in) throws IOException {
super(in);
lifecycleId = in.readString();
}
public Request() { } public Request() { }
public Request(String lifecycleId) { public Request(String lifecycleId) {
@ -50,12 +55,6 @@ public class DeleteSnapshotLifecycleAction extends ActionType<DeleteSnapshotLife
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
lifecycleId = in.readString();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -45,18 +45,17 @@ public class ExecuteSnapshotLifecycleAction extends ActionType<ExecuteSnapshotLi
this.lifecycleId = lifecycleId; this.lifecycleId = lifecycleId;
} }
public Request(StreamInput in) throws IOException {
super(in);
lifecycleId = in.readString();
}
public Request() { } public Request() { }
public String getLifecycleId() { public String getLifecycleId() {
return this.lifecycleId; return this.lifecycleId;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
lifecycleId = in.readString();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -44,6 +44,11 @@ public class GetSnapshotLifecycleAction extends ActionType<GetSnapshotLifecycleA
this.lifecycleIds = Objects.requireNonNull(lifecycleIds, "ids may not be null"); this.lifecycleIds = Objects.requireNonNull(lifecycleIds, "ids may not be null");
} }
public Request(StreamInput in) throws IOException {
super(in);
lifecycleIds = in.readStringArray();
}
public Request() { public Request() {
this.lifecycleIds = Strings.EMPTY_ARRAY; this.lifecycleIds = Strings.EMPTY_ARRAY;
} }
@ -57,12 +62,6 @@ public class GetSnapshotLifecycleAction extends ActionType<GetSnapshotLifecycleA
return null; return null;
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
lifecycleIds = in.readStringArray();
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -45,6 +45,12 @@ public class PutSnapshotLifecycleAction extends ActionType<PutSnapshotLifecycleA
this.lifecycle = lifecycle; this.lifecycle = lifecycle;
} }
public Request(StreamInput in) throws IOException {
super(in);
lifecycleId = in.readString();
lifecycle = new SnapshotLifecyclePolicy(in);
}
public Request() { } public Request() { }
public String getLifecycleId() { public String getLifecycleId() {
@ -59,13 +65,6 @@ public class PutSnapshotLifecycleAction extends ActionType<PutSnapshotLifecycleA
return new Request(lifecycleId, SnapshotLifecyclePolicy.parse(parser, lifecycleId)); return new Request(lifecycleId, SnapshotLifecyclePolicy.parse(parser, lifecycleId));
} }
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
lifecycleId = in.readString();
lifecycle = new SnapshotLifecyclePolicy(in);
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out); super.writeTo(out);

View File

@ -6,20 +6,21 @@
package org.elasticsearch.xpack.core.indexlifecycle; package org.elasticsearch.xpack.core.indexlifecycle;
import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
public class StartILMRequestTests extends AbstractStreamableTestCase<StartILMRequest> { public class StartILMRequestTests extends AbstractWireSerializingTestCase<StartILMRequest> {
@Override
protected StartILMRequest createBlankInstance() {
return new StartILMRequest();
}
@Override @Override
protected StartILMRequest createTestInstance() { protected StartILMRequest createTestInstance() {
return new StartILMRequest(); return new StartILMRequest();
} }
@Override
protected Writeable.Reader<StartILMRequest> instanceReader() {
return StartILMRequest::new;
}
public void testValidate() { public void testValidate() {
StartILMRequest request = createTestInstance(); StartILMRequest request = createTestInstance();
assertNull(request.validate()); assertNull(request.validate());

View File

@ -6,20 +6,21 @@
package org.elasticsearch.xpack.core.indexlifecycle; package org.elasticsearch.xpack.core.indexlifecycle;
import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
public class StopILMRequestTests extends AbstractStreamableTestCase<StopILMRequest> { public class StopILMRequestTests extends AbstractWireSerializingTestCase<StopILMRequest> {
@Override
protected StopILMRequest createBlankInstance() {
return new StopILMRequest();
}
@Override @Override
protected StopILMRequest createTestInstance() { protected StopILMRequest createTestInstance() {
return new StopILMRequest(); return new StopILMRequest();
} }
@Override
protected Writeable.Reader<StopILMRequest> instanceReader() {
return StopILMRequest::new;
}
public void testValidate() { public void testValidate() {
StopILMRequest request = createTestInstance(); StopILMRequest request = createTestInstance();
assertNull(request.validate()); assertNull(request.validate());

View File

@ -5,10 +5,11 @@
*/ */
package org.elasticsearch.xpack.core.indexlifecycle.action; package org.elasticsearch.xpack.core.indexlifecycle.action;
import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.core.indexlifecycle.action.DeleteLifecycleAction.Request; import org.elasticsearch.xpack.core.indexlifecycle.action.DeleteLifecycleAction.Request;
public class DeleteLifecycleRequestTests extends AbstractStreamableTestCase<DeleteLifecycleAction.Request> { public class DeleteLifecycleRequestTests extends AbstractWireSerializingTestCase<Request> {
@Override @Override
protected Request createTestInstance() { protected Request createTestInstance() {
@ -16,8 +17,8 @@ public class DeleteLifecycleRequestTests extends AbstractStreamableTestCase<Dele
} }
@Override @Override
protected Request createBlankInstance() { protected Writeable.Reader<Request> instanceReader() {
return new Request(); return Request::new;
} }
@Override @Override

View File

@ -5,12 +5,13 @@
*/ */
package org.elasticsearch.xpack.core.indexlifecycle.action; package org.elasticsearch.xpack.core.indexlifecycle.action;
import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.core.indexlifecycle.action.GetLifecycleAction.Request; import org.elasticsearch.xpack.core.indexlifecycle.action.GetLifecycleAction.Request;
import java.util.Arrays; import java.util.Arrays;
public class GetLifecycleRequestTests extends AbstractStreamableTestCase<GetLifecycleAction.Request> { public class GetLifecycleRequestTests extends AbstractWireSerializingTestCase<Request> {
@Override @Override
protected Request createTestInstance() { protected Request createTestInstance() {
@ -18,8 +19,8 @@ public class GetLifecycleRequestTests extends AbstractStreamableTestCase<GetLife
} }
@Override @Override
protected Request createBlankInstance() { protected Writeable.Reader<Request> instanceReader() {
return new Request(); return Request::new;
} }
@Override @Override

View File

@ -6,14 +6,15 @@
*/ */
package org.elasticsearch.xpack.core.indexlifecycle.action; package org.elasticsearch.xpack.core.indexlifecycle.action;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase; import org.elasticsearch.test.AbstractSerializingTestCase;
import org.elasticsearch.xpack.core.indexlifecycle.Step.StepKey; import org.elasticsearch.xpack.core.indexlifecycle.Step.StepKey;
import org.elasticsearch.xpack.core.indexlifecycle.StepKeyTests; import org.elasticsearch.xpack.core.indexlifecycle.StepKeyTests;
import org.elasticsearch.xpack.core.indexlifecycle.action.MoveToStepAction.Request; import org.elasticsearch.xpack.core.indexlifecycle.action.MoveToStepAction.Request;
import org.junit.Before; import org.junit.Before;
public class MoveToStepRequestTests extends AbstractStreamableXContentTestCase<Request> { public class MoveToStepRequestTests extends AbstractSerializingTestCase<Request> {
private String index; private String index;
private static final StepKeyTests stepKeyTests = new StepKeyTests(); private static final StepKeyTests stepKeyTests = new StepKeyTests();
@ -29,8 +30,8 @@ public class MoveToStepRequestTests extends AbstractStreamableXContentTestCase<R
} }
@Override @Override
protected Request createBlankInstance() { protected Writeable.Reader<Request> instanceReader() {
return new Request(); return Request::new;
} }
@Override @Override

View File

@ -8,9 +8,10 @@ package org.elasticsearch.xpack.core.indexlifecycle.action;
import org.elasticsearch.cluster.ClusterModule; import org.elasticsearch.cluster.ClusterModule;
import org.elasticsearch.common.ParseField; import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractStreamableXContentTestCase; import org.elasticsearch.test.AbstractSerializingTestCase;
import org.elasticsearch.xpack.core.indexlifecycle.AllocateAction; import org.elasticsearch.xpack.core.indexlifecycle.AllocateAction;
import org.elasticsearch.xpack.core.indexlifecycle.DeleteAction; import org.elasticsearch.xpack.core.indexlifecycle.DeleteAction;
import org.elasticsearch.xpack.core.indexlifecycle.ForceMergeAction; import org.elasticsearch.xpack.core.indexlifecycle.ForceMergeAction;
@ -32,7 +33,7 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
public class PutLifecycleRequestTests extends AbstractStreamableXContentTestCase<PutLifecycleAction.Request> { public class PutLifecycleRequestTests extends AbstractSerializingTestCase<Request> {
private String lifecycleName; private String lifecycleName;
@ -47,8 +48,8 @@ public class PutLifecycleRequestTests extends AbstractStreamableXContentTestCase
} }
@Override @Override
protected Request createBlankInstance() { protected Writeable.Reader<Request> instanceReader() {
return new Request(); return Request::new;
} }
@Override @Override

View File

@ -7,13 +7,14 @@
package org.elasticsearch.xpack.core.indexlifecycle.action; package org.elasticsearch.xpack.core.indexlifecycle.action;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.core.indexlifecycle.action.RemoveIndexLifecyclePolicyAction.Request; import org.elasticsearch.xpack.core.indexlifecycle.action.RemoveIndexLifecyclePolicyAction.Request;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
public class RemoveIndexLifecyclePolicyRequestTests extends AbstractStreamableTestCase<RemoveIndexLifecyclePolicyAction.Request> { public class RemoveIndexLifecyclePolicyRequestTests extends AbstractWireSerializingTestCase<Request> {
@Override @Override
protected Request createTestInstance() { protected Request createTestInstance() {
@ -30,10 +31,10 @@ public class RemoveIndexLifecyclePolicyRequestTests extends AbstractStreamableTe
} }
@Override @Override
protected Request createBlankInstance() { protected Writeable.Reader<Request> instanceReader() {
return new Request(); return Request::new;
} }
@Override @Override
protected Request mutateInstance(Request instance) throws IOException { protected Request mutateInstance(Request instance) throws IOException {
String[] indices = instance.indices(); String[] indices = instance.indices();

View File

@ -7,13 +7,14 @@
package org.elasticsearch.xpack.core.indexlifecycle.action; package org.elasticsearch.xpack.core.indexlifecycle.action;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.core.indexlifecycle.action.RetryAction.Request; import org.elasticsearch.xpack.core.indexlifecycle.action.RetryAction.Request;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
public class RetryRequestTests extends AbstractStreamableTestCase<Request> { public class RetryRequestTests extends AbstractWireSerializingTestCase<Request> {
@Override @Override
protected Request createTestInstance() { protected Request createTestInstance() {
@ -29,6 +30,11 @@ public class RetryRequestTests extends AbstractStreamableTestCase<Request> {
return request; return request;
} }
@Override
protected Writeable.Reader<Request> instanceReader() {
return Request::new;
}
@Override @Override
protected Request mutateInstance(Request instance) throws IOException { protected Request mutateInstance(Request instance) throws IOException {
String[] indices = instance.indices(); String[] indices = instance.indices();
@ -50,9 +56,4 @@ public class RetryRequestTests extends AbstractStreamableTestCase<Request> {
newRequest.indicesOptions(indicesOptions); newRequest.indicesOptions(indicesOptions);
return newRequest; return newRequest;
} }
@Override
protected Request createBlankInstance() {
return new Request();
}
} }

View File

@ -5,10 +5,11 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.core.ml.action.DeleteCalendarEventAction.Request; import org.elasticsearch.xpack.core.ml.action.DeleteCalendarEventAction.Request;
public class DeleteCalendarEventActionRequestTests extends AbstractStreamableTestCase<DeleteCalendarEventAction.Request> { public class DeleteCalendarEventActionRequestTests extends AbstractWireSerializingTestCase<Request> {
@Override @Override
protected Request createTestInstance() { protected Request createTestInstance() {
@ -16,7 +17,7 @@ public class DeleteCalendarEventActionRequestTests extends AbstractStreamableTes
} }
@Override @Override
protected Request createBlankInstance() { protected Writeable.Reader<Request> instanceReader() {
return new Request(); return Request::new;
} }
} }

View File

@ -59,8 +59,8 @@ public final class TransportFreezeIndexAction extends
IndexNameExpressionResolver indexNameExpressionResolver, IndexNameExpressionResolver indexNameExpressionResolver,
DestructiveOperations destructiveOperations, DestructiveOperations destructiveOperations,
TransportCloseIndexAction transportCloseIndexAction) { TransportCloseIndexAction transportCloseIndexAction) {
super(FreezeIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(FreezeIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, FreezeRequest::new,
FreezeRequest::new); indexNameExpressionResolver);
this.destructiveOperations = destructiveOperations; this.destructiveOperations = destructiveOperations;
this.indexStateService = indexStateService; this.indexStateService = indexStateService;
this.transportCloseIndexAction = transportCloseIndexAction; this.transportCloseIndexAction = transportCloseIndexAction;

View File

@ -45,7 +45,7 @@ public class TransportDeleteLifecycleAction extends TransportMasterNodeAction<Re
public TransportDeleteLifecycleAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool, public TransportDeleteLifecycleAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) { ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
super(DeleteLifecycleAction.NAME, transportService, clusterService, threadPool, actionFilters, super(DeleteLifecycleAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, Request::new); Request::new, indexNameExpressionResolver);
} }
@Override @Override

View File

@ -35,8 +35,8 @@ public class TransportGetLifecycleAction extends StreamableTransportMasterNodeAc
@Inject @Inject
public TransportGetLifecycleAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool, public TransportGetLifecycleAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) { ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
super(GetLifecycleAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(GetLifecycleAction.NAME, transportService, clusterService, threadPool, actionFilters, Request::new,
Request::new); indexNameExpressionResolver);
} }
@Override @Override

View File

@ -29,7 +29,7 @@ public class TransportGetStatusAction extends StreamableTransportMasterNodeActio
public TransportGetStatusAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool, public TransportGetStatusAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) { ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
super(GetStatusAction.NAME, transportService, clusterService, threadPool, actionFilters, super(GetStatusAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, Request::new); Request::new, indexNameExpressionResolver);
} }
@Override @Override

View File

@ -37,8 +37,8 @@ public class TransportMoveToStepAction extends TransportMasterNodeAction<Request
public TransportMoveToStepAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool, public TransportMoveToStepAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
IndexLifecycleService indexLifecycleService) { IndexLifecycleService indexLifecycleService) {
super(MoveToStepAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(MoveToStepAction.NAME, transportService, clusterService, threadPool, actionFilters, Request::new,
Request::new); indexNameExpressionResolver);
this.indexLifecycleService = indexLifecycleService; this.indexLifecycleService = indexLifecycleService;
} }

View File

@ -44,8 +44,8 @@ public class TransportPutLifecycleAction extends TransportMasterNodeAction<Reque
@Inject @Inject
public TransportPutLifecycleAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool, public TransportPutLifecycleAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) { ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
super(PutLifecycleAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(PutLifecycleAction.NAME, transportService, clusterService, threadPool, actionFilters, Request::new,
Request::new); indexNameExpressionResolver);
} }
@Override @Override

View File

@ -34,7 +34,7 @@ public class TransportRemoveIndexLifecyclePolicyAction extends StreamableTranspo
ThreadPool threadPool, ActionFilters actionFilters, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) { IndexNameExpressionResolver indexNameExpressionResolver) {
super(RemoveIndexLifecyclePolicyAction.NAME, transportService, clusterService, threadPool, actionFilters, super(RemoveIndexLifecyclePolicyAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, Request::new); Request::new, indexNameExpressionResolver);
} }
@Override @Override

View File

@ -37,8 +37,7 @@ public class TransportRetryAction extends TransportMasterNodeAction<Request, Res
public TransportRetryAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool, public TransportRetryAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
IndexLifecycleService indexLifecycleService) { IndexLifecycleService indexLifecycleService) {
super(RetryAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(RetryAction.NAME, transportService, clusterService, threadPool, actionFilters, Request::new, indexNameExpressionResolver);
Request::new);
this.indexLifecycleService = indexLifecycleService; this.indexLifecycleService = indexLifecycleService;
} }

View File

@ -32,8 +32,8 @@ public class TransportStartILMAction extends TransportMasterNodeAction<StartILMR
@Inject @Inject
public TransportStartILMAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool, public TransportStartILMAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) { ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
super(StartILMAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, super(StartILMAction.NAME, transportService, clusterService, threadPool, actionFilters, StartILMRequest::new,
StartILMRequest::new); indexNameExpressionResolver);
} }
@Override @Override

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