Skip to content

Commit

Permalink
Change required version for Get Settings transport API changes to 6.4…
Browse files Browse the repository at this point in the history
….0 (elastic#30706)

Get Settings API changes have now been backported to version 6.4, and
therefore the latest version must send and expect the extra fields when
communicating with 6.4+ code.

Relates elastic#29229 elastic#30494
  • Loading branch information
tomcallahan authored and ywelsch committed May 23, 2018
1 parent ce58162 commit 47280cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public GetSettingsRequest(StreamInput in) throws IOException {
indicesOptions = IndicesOptions.readIndicesOptions(in);
names = in.readStringArray();
humanReadable = in.readBoolean();
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (in.getVersion().onOrAfter(Version.V_6_4_0)) {
includeDefaults = in.readBoolean();
}
}
Expand All @@ -83,7 +83,7 @@ public void writeTo(StreamOutput out) throws IOException {
indicesOptions.writeIndicesOptions(out);
out.writeStringArray(names);
out.writeBoolean(humanReadable);
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
out.writeBoolean(includeDefaults);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void readFrom(StreamInput in) throws IOException {
}
ImmutableOpenMap.Builder<String, Settings> defaultSettingsBuilder = ImmutableOpenMap.builder();

if (in.getVersion().onOrAfter(org.elasticsearch.Version.V_7_0_0_alpha1)) {
if (in.getVersion().onOrAfter(org.elasticsearch.Version.V_6_4_0)) {
int defaultSettingsSize = in.readVInt();
for (int i = 0; i < defaultSettingsSize ; i++) {
defaultSettingsBuilder.put(in.readString(), Settings.readSettingsFromStream(in));
Expand All @@ -132,7 +132,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeString(cursor.key);
Settings.writeSettingsToStream(cursor.value, out);
}
if (out.getVersion().onOrAfter(org.elasticsearch.Version.V_7_0_0_alpha1)) {
if (out.getVersion().onOrAfter(org.elasticsearch.Version.V_6_4_0)) {
out.writeVInt(indexToDefaultSettings.size());
for (ObjectObjectCursor<String, Settings> cursor : indexToDefaultSettings) {
out.writeString(cursor.key);
Expand Down

0 comments on commit 47280cf

Please sign in to comment.