Skip to content

Commit

Permalink
Change version check from Version.CURRENT to Version.V_3_0_0
Browse files Browse the repository at this point in the history
Signed-off-by: Bhumika Saini <[email protected]>
  • Loading branch information
Bhumika Saini committed Oct 11, 2023
1 parent 86ba32a commit a0323f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public ReplicationStats(StreamInput in) throws IOException {
this.totalBytesBehind = in.readVLong();
this.maxReplicationLag = in.readVLong();
// TODO: change to V_2_11_0 on main after backport to 2.x
if (in.getVersion().onOrAfter(Version.CURRENT)) {
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
this.totalRejections = in.readVLong();
this.shardId = in.readOptionalWriteable(ShardId::new);
}
Expand All @@ -62,7 +62,6 @@ public void add(ReplicationStats other) {
maxBytesBehind = Math.max(other.maxBytesBehind, maxBytesBehind);
totalBytesBehind += other.totalBytesBehind;
maxReplicationLag = Math.max(other.maxReplicationLag, maxReplicationLag);
// TODO
if (this.shardId != other.shardId) {
totalRejections += other.totalRejections;
}
Expand Down Expand Up @@ -91,7 +90,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeVLong(totalBytesBehind);
out.writeVLong(maxReplicationLag);
// TODO: change to V_2_11_0 on main after backport to 2.x
if (out.getVersion().onOrAfter(Version.CURRENT)) {
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
out.writeVLong(totalRejections);
out.writeOptionalWriteable(shardId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public RemoteSegmentStats(StreamInput in) throws IOException {
totalUploadTime = in.readLong();
totalDownloadTime = in.readLong();
// TODO: change to V_2_11_0 on main after backport to 2.x
if (in.getVersion().onOrAfter(Version.CURRENT)) {
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
totalRejections = in.readVLong();
}
}
Expand Down Expand Up @@ -261,7 +261,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeLong(totalUploadTime);
out.writeLong(totalDownloadTime);
// TODO: change to V_2_11_0 on main after backport to 2.x
if (out.getVersion().onOrAfter(Version.CURRENT)) {
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
out.writeVLong(totalRejections);
}
}
Expand Down

0 comments on commit a0323f8

Please sign in to comment.