Remove BWC serialization logic for pre 2.2 nodes (#19810)

This change removes all pre 2.2 logic from InternalSearchResponse serialization. It's unneeded in 5.0 since we require full cluster restart
This commit is contained in:
Simon Willnauer 2016-08-04 22:47:39 +02:00 committed by GitHub
parent 1e587406d8
commit e08f11dabc
1 changed files with 2 additions and 17 deletions

View File

@ -136,14 +136,8 @@ public class InternalSearchResponse implements Streamable, ToXContent {
suggest = Suggest.readSuggest(in);
}
timedOut = in.readBoolean();
terminatedEarly = in.readOptionalBoolean();
if (in.getVersion().onOrAfter(Version.V_2_2_0) && in.readBoolean()) {
profileResults = new SearchProfileShardResults(in);
} else {
profileResults = null;
}
profileResults = in.readOptionalWriteable(SearchProfileShardResults::new);
}
@Override
@ -162,16 +156,7 @@ public class InternalSearchResponse implements Streamable, ToXContent {
suggest.writeTo(out);
}
out.writeBoolean(timedOut);
out.writeOptionalBoolean(terminatedEarly);
if (out.getVersion().onOrAfter(Version.V_2_2_0)) {
if (profileResults == null) {
out.writeBoolean(false);
} else {
out.writeBoolean(true);
profileResults.writeTo(out);
}
}
out.writeOptionalWriteable(profileResults);
}
}