Remove TODO in MaxAgeCondition serialization (#52794)

* Remove TODO in MaxAgeCondition serialization

This removes the TODO with a message for any future readers regarding the code in question.

Resolves #52505
This commit is contained in:
Lee Hinman 2020-02-25 15:46:50 -07:00 committed by Lee Hinman
parent 6669e53f08
commit 662f21fcea
1 changed files with 6 additions and 1 deletions

View File

@ -57,7 +57,12 @@ public class MaxAgeCondition extends Condition<TimeValue> {
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
//TODO here we should just use TimeValue#writeTo and same for de-serialization in the constructor, we lose information this way // While we technically could serialize this would out.writeTimeValue(...), that would
// require doing the song and dance around backwards compatibility for this value. Since
// in this case the deserialized version is not displayed to a user, it's okay to simply use
// milliseconds. It's possible to lose precision if someone were to say, specify 50
// nanoseconds, however, in that case, their max age is indistinguishable from 0
// milliseconds regardless.
out.writeLong(value.getMillis()); out.writeLong(value.getMillis());
} }