Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -59,7 +60,6 @@ public static class Request extends LocalClusterStateRequest implements IndicesR
IndicesOptions.GatekeeperOptions.builder().allowAliasToMultipleIndices(false).allowClosedIndices(true).allowSelectors(false)
)
.build();
private boolean includeDefaults = false;

public Request(TimeValue masterNodeTimeout, String[] names) {
super(masterNodeTimeout);
Expand All @@ -69,7 +69,6 @@ public Request(TimeValue masterNodeTimeout, String[] names) {
public Request(TimeValue masterNodeTimeout, String[] names, boolean includeDefaults) {
super(masterNodeTimeout);
this.names = names;
this.includeDefaults = includeDefaults;
}

public String[] getNames() {
Expand All @@ -95,22 +94,23 @@ public Request(StreamInput in) throws IOException {
super(in);
this.names = in.readOptionalStringArray();
this.indicesOptions = IndicesOptions.readIndicesOptions(in);
this.includeDefaults = in.readBoolean();
// This boolean was removed in 8.19
if (in.getTransportVersion().isPatchFrom(TransportVersions.DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19) == false) {
in.readBoolean();
}
}

@Override
public boolean equals(Object o) {
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;
}
Expand All @@ -125,10 +125,6 @@ public IndicesOptions indicesOptions() {
return indicesOptions;
}

public boolean includeDefaults() {
return includeDefaults;
}

public Request indicesOptions(IndicesOptions indicesOptions) {
this.indicesOptions = indicesOptions;
return this;
Expand All @@ -144,11 +140,6 @@ public IndicesRequest indices(String... indices) {
this.names = indices;
return this;
}

public Request includeDefaults(boolean includeDefaults) {
this.includeDefaults = includeDefaults;
return this;
}
}

public static class Response extends ActionResponse implements ChunkedToXContentObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli
RestUtils.getMasterNodeTimeout(request),
Strings.splitStringByCommaToArray(request.param("name"))
);
getDataStreamOptionsRequest.includeDefaults(request.paramAsBoolean("include_defaults", false));
getDataStreamOptionsRequest.indicesOptions(IndicesOptions.fromRequest(request, getDataStreamOptionsRequest.indicesOptions()));
return channel -> new RestCancellableNodeClient(client, request.getHttpChannel()).execute(
GetDataStreamOptionsAction.INSTANCE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
"default":"open",
"description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)"
},
"include_defaults":{
"type":"boolean",
"description":"Return all relevant default configurations for the data stream (default: false)"
},
"master_timeout":{
"type":"time",
"description":"Specify timeout for connection to master"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ static TransportVersion def(int id) {
public static final TransportVersion ML_INFERENCE_SAGEMAKER_CHAT_COMPLETION_8_19 = def(8_841_0_37);
public static final TransportVersion ML_INFERENCE_VERTEXAI_CHATCOMPLETION_ADDED_8_19 = def(8_841_0_38);
public static final TransportVersion INFERENCE_CUSTOM_SERVICE_ADDED_8_19 = def(8_841_0_39);
public static final TransportVersion DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19 = def(8_841_0_40);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is only a backport version because we do not serialise this request anymore in 9.x.

public static final TransportVersion V_9_0_0 = def(9_000_0_09);
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_1 = def(9_000_0_10);
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_2 = def(9_000_0_11);
Expand Down