Skip to content

Commit

Permalink
Change required version for Get Settings transport API changes to 6.4.0
Browse files Browse the repository at this point in the history
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
Thomas Callahan authored and Thomas Callahan committed May 17, 2018
1 parent a8b4a98 commit 654d525
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 654d525

Please sign in to comment.