Skip to content

Commit

Permalink
[Remote Store] Update version check for Remote Translog Store upload …
Browse files Browse the repository at this point in the history
…flow stats in nodes stats API (opensearch-project#9754)

Signed-off-by: Bhumika Saini <[email protected]>
Signed-off-by: Ivan Brusic <[email protected]>
  • Loading branch information
Bhumika Saini authored and brusic committed Sep 25, 2023
1 parent 410b57d commit 796b372
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ public TranslogStats(StreamInput in) throws IOException {
uncommittedOperations = in.readVInt();
uncommittedSizeInBytes = in.readVLong();
earliestLastModifiedAge = in.readVLong();
// TODO: remoteTranslogStats = in.getVersion().onOrAfter(Version.V_2_10_0) ? in.readOptionalWriteable(RemoteTranslogStats::new) :
// new RemoteTranslogStats();
remoteTranslogStats = in.getVersion().onOrAfter(Version.CURRENT)
remoteTranslogStats = in.getVersion().onOrAfter(Version.V_2_10_0)
? in.readOptionalWriteable(RemoteTranslogStats::new)
: new RemoteTranslogStats();
}
Expand Down Expand Up @@ -184,8 +182,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(uncommittedOperations);
out.writeVLong(uncommittedSizeInBytes);
out.writeVLong(earliestLastModifiedAge);
// TODO: if (out.getVersion().onOrAfter(Version.V_2_10_0)) {
if (out.getVersion().onOrAfter(Version.CURRENT)) {
if (out.getVersion().onOrAfter(Version.V_2_10_0)) {
out.writeOptionalWriteable(remoteTranslogStats);
}
}
Expand Down

0 comments on commit 796b372

Please sign in to comment.