remove version checks

This commit is contained in:
Michael McCandless 2015-01-13 14:21:21 -05:00 committed by mikemccand
parent 1aad275c55
commit ff3e2cb569
2 changed files with 8 additions and 18 deletions

View File

@ -219,11 +219,10 @@ public class MergeStats implements Streamable, ToXContent {
current = in.readVLong();
currentNumDocs = in.readVLong();
currentSizeInBytes = in.readVLong();
if (in.getVersion().onOrAfter(Version.V_2_0_0)) {
totalStoppedTimeInMillis = in.readVLong();
totalThrottledTimeInMillis = in.readVLong();
totalBytesPerSecAutoThrottle = in.readVLong();
}
// Added in 2.0:
totalStoppedTimeInMillis = in.readVLong();
totalThrottledTimeInMillis = in.readVLong();
totalBytesPerSecAutoThrottle = in.readVLong();
}
@Override
@ -235,10 +234,9 @@ public class MergeStats implements Streamable, ToXContent {
out.writeVLong(current);
out.writeVLong(currentNumDocs);
out.writeVLong(currentSizeInBytes);
if (out.getVersion().onOrAfter(Version.V_2_0_0)) {
out.writeVLong(totalStoppedTimeInMillis);
out.writeVLong(totalThrottledTimeInMillis);
out.writeVLong(totalBytesPerSecAutoThrottle);
}
// Added in 2.0:
out.writeVLong(totalStoppedTimeInMillis);
out.writeVLong(totalThrottledTimeInMillis);
out.writeVLong(totalBytesPerSecAutoThrottle);
}
}

View File

@ -78,19 +78,11 @@ public class StoreStats implements Streamable, ToXContent {
@Override
public void readFrom(StreamInput in) throws IOException {
sizeInBytes = in.readVLong();
if (in.getVersion().before(Version.V_2_0_0)) {
// Ignore throttleTimeInNanos
in.readVLong();
}
}
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeVLong(sizeInBytes);
if (out.getVersion().before(Version.V_2_0_0)) {
// Send dummy throttleTimeInNanos
out.writeVLong(0);
}
}
@Override