|
@@ -8,6 +8,7 @@
|
|
|
*/
|
|
|
package org.elasticsearch.datastreams.options.action;
|
|
|
|
|
|
+import org.elasticsearch.TransportVersions;
|
|
|
import org.elasticsearch.action.ActionRequestValidationException;
|
|
|
import org.elasticsearch.action.ActionResponse;
|
|
|
import org.elasticsearch.action.ActionType;
|
|
@@ -54,7 +55,6 @@ public class GetDataStreamOptionsAction {
|
|
|
IndicesOptions.GatekeeperOptions.builder().allowAliasToMultipleIndices(false).allowClosedIndices(true).allowSelectors(false)
|
|
|
)
|
|
|
.build();
|
|
|
- private boolean includeDefaults = false;
|
|
|
|
|
|
public Request(TimeValue masterNodeTimeout, String[] names) {
|
|
|
super(masterNodeTimeout);
|
|
@@ -64,7 +64,6 @@ public class GetDataStreamOptionsAction {
|
|
|
public Request(TimeValue masterNodeTimeout, String[] names, boolean includeDefaults) {
|
|
|
super(masterNodeTimeout);
|
|
|
this.names = names;
|
|
|
- this.includeDefaults = includeDefaults;
|
|
|
}
|
|
|
|
|
|
public String[] getNames() {
|
|
@@ -80,7 +79,9 @@ public class GetDataStreamOptionsAction {
|
|
|
super(in);
|
|
|
this.names = in.readOptionalStringArray();
|
|
|
this.indicesOptions = IndicesOptions.readIndicesOptions(in);
|
|
|
- this.includeDefaults = in.readBoolean();
|
|
|
+ if (in.getTransportVersion().before(TransportVersions.DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19)) {
|
|
|
+ in.readBoolean();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -88,7 +89,9 @@ public class GetDataStreamOptionsAction {
|
|
|
super.writeTo(out);
|
|
|
out.writeOptionalStringArray(names);
|
|
|
indicesOptions.writeIndicesOptions(out);
|
|
|
- out.writeBoolean(includeDefaults);
|
|
|
+ if (out.getTransportVersion().before(TransportVersions.DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19)) {
|
|
|
+ out.writeBoolean(false);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -96,14 +99,12 @@ public class GetDataStreamOptionsAction {
|
|
|
if (this == o) return true;
|
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
|
Request request = (Request) o;
|
|
|
- return Arrays.equals(names, request.names)
|
|
|
- && indicesOptions.equals(request.indicesOptions)
|
|
|
- && includeDefaults == request.includeDefaults;
|
|
|
+ return Arrays.equals(names, request.names) && indicesOptions.equals(request.indicesOptions);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int hashCode() {
|
|
|
- int result = Objects.hash(indicesOptions, includeDefaults);
|
|
|
+ int result = Objects.hash(indicesOptions);
|
|
|
result = 31 * result + Arrays.hashCode(names);
|
|
|
return result;
|
|
|
}
|
|
@@ -118,10 +119,6 @@ public class GetDataStreamOptionsAction {
|
|
|
return indicesOptions;
|
|
|
}
|
|
|
|
|
|
- public boolean includeDefaults() {
|
|
|
- return includeDefaults;
|
|
|
- }
|
|
|
-
|
|
|
public Request indicesOptions(IndicesOptions indicesOptions) {
|
|
|
this.indicesOptions = indicesOptions;
|
|
|
return this;
|
|
@@ -137,11 +134,6 @@ public class GetDataStreamOptionsAction {
|
|
|
this.names = indices;
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
- public Request includeDefaults(boolean includeDefaults) {
|
|
|
- this.includeDefaults = includeDefaults;
|
|
|
- return this;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static class Response extends ActionResponse implements ChunkedToXContentObject {
|