@@ -237,12 +237,12 @@ public DeviceStats(StreamInput in) throws IOException {
237
237
previousSectorsRead = in .readLong ();
238
238
currentSectorsWritten = in .readLong ();
239
239
previousSectorsWritten = in .readLong ();
240
- if (in .getVersion ().onOrAfter (Version .V_8_0_0 )) {
240
+ if (in .getVersion ().onOrAfter (Version .V_7_14_0 )) {
241
241
currentIOTime = in .readLong ();
242
242
previousIOTime = in .readLong ();
243
243
} else {
244
- currentIOTime = 0 ;
245
- previousIOTime = 0 ;
244
+ currentIOTime = - 1 ;
245
+ previousIOTime = - 1 ;
246
246
}
247
247
}
248
248
@@ -259,7 +259,7 @@ public void writeTo(StreamOutput out) throws IOException {
259
259
out .writeLong (previousSectorsRead );
260
260
out .writeLong (currentSectorsWritten );
261
261
out .writeLong (previousSectorsWritten );
262
- if (out .getVersion ().onOrAfter (Version .V_8_0_0 )) {
262
+ if (out .getVersion ().onOrAfter (Version .V_7_14_0 )) {
263
263
out .writeLong (currentIOTime );
264
264
out .writeLong (previousIOTime );
265
265
}
@@ -370,10 +370,10 @@ public IoStats(StreamInput in) throws IOException {
370
370
this .totalWriteOperations = in .readLong ();
371
371
this .totalReadKilobytes = in .readLong ();
372
372
this .totalWriteKilobytes = in .readLong ();
373
- if (in .getVersion ().onOrAfter (Version .V_8_0_0 )) {
373
+ if (in .getVersion ().onOrAfter (Version .V_7_14_0 )) {
374
374
this .totalIOTimeInMillis = in .readLong ();
375
375
} else {
376
- this .totalIOTimeInMillis = 0 ;
376
+ this .totalIOTimeInMillis = - 1 ;
377
377
}
378
378
}
379
379
@@ -388,7 +388,7 @@ public void writeTo(StreamOutput out) throws IOException {
388
388
out .writeLong (totalWriteOperations );
389
389
out .writeLong (totalReadKilobytes );
390
390
out .writeLong (totalWriteKilobytes );
391
- if (out .getVersion ().onOrAfter (Version .V_8_0_0 )) {
391
+ if (out .getVersion ().onOrAfter (Version .V_7_14_0 )) {
392
392
out .writeLong (totalIOTimeInMillis );
393
393
}
394
394
}
0 commit comments