|
@@ -33,7 +33,7 @@ public class StoreStats implements Writeable, ToXContentFragment {
|
|
|
|
|
|
private long sizeInBytes;
|
|
|
private long totalDataSetSizeInBytes;
|
|
|
- private long reservedSize;
|
|
|
+ private long reservedSizeInBytes;
|
|
|
|
|
|
public StoreStats() {
|
|
|
|
|
@@ -47,9 +47,9 @@ public class StoreStats implements Writeable, ToXContentFragment {
|
|
|
totalDataSetSizeInBytes = sizeInBytes;
|
|
|
}
|
|
|
if (in.getTransportVersion().onOrAfter(RESERVED_BYTES_VERSION)) {
|
|
|
- reservedSize = in.readZLong();
|
|
|
+ reservedSizeInBytes = in.readZLong();
|
|
|
} else {
|
|
|
- reservedSize = UNKNOWN_RESERVED_BYTES;
|
|
|
+ reservedSizeInBytes = UNKNOWN_RESERVED_BYTES;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -63,7 +63,7 @@ public class StoreStats implements Writeable, ToXContentFragment {
|
|
|
assert reservedSize == UNKNOWN_RESERVED_BYTES || reservedSize >= 0 : reservedSize;
|
|
|
this.sizeInBytes = sizeInBytes;
|
|
|
this.totalDataSetSizeInBytes = totalDataSetSizeInBytes;
|
|
|
- this.reservedSize = reservedSize;
|
|
|
+ this.reservedSizeInBytes = reservedSize;
|
|
|
}
|
|
|
|
|
|
public void add(StoreStats stats) {
|
|
@@ -72,7 +72,7 @@ public class StoreStats implements Writeable, ToXContentFragment {
|
|
|
}
|
|
|
sizeInBytes += stats.sizeInBytes;
|
|
|
totalDataSetSizeInBytes += stats.totalDataSetSizeInBytes;
|
|
|
- reservedSize = ignoreIfUnknown(reservedSize) + ignoreIfUnknown(stats.reservedSize);
|
|
|
+ reservedSizeInBytes = ignoreIfUnknown(reservedSizeInBytes) + ignoreIfUnknown(stats.reservedSizeInBytes);
|
|
|
}
|
|
|
|
|
|
private static long ignoreIfUnknown(long reservedSize) {
|
|
@@ -83,28 +83,20 @@ public class StoreStats implements Writeable, ToXContentFragment {
|
|
|
return sizeInBytes;
|
|
|
}
|
|
|
|
|
|
- public long getSizeInBytes() {
|
|
|
- return sizeInBytes;
|
|
|
- }
|
|
|
-
|
|
|
public ByteSizeValue size() {
|
|
|
return ByteSizeValue.ofBytes(sizeInBytes);
|
|
|
}
|
|
|
|
|
|
- public ByteSizeValue getSize() {
|
|
|
- return size();
|
|
|
+ public long totalDataSetSizeInBytes() {
|
|
|
+ return totalDataSetSizeInBytes;
|
|
|
}
|
|
|
|
|
|
public ByteSizeValue totalDataSetSize() {
|
|
|
return ByteSizeValue.ofBytes(totalDataSetSizeInBytes);
|
|
|
}
|
|
|
|
|
|
- public ByteSizeValue getTotalDataSetSize() {
|
|
|
- return totalDataSetSize();
|
|
|
- }
|
|
|
-
|
|
|
- public long totalDataSetSizeInBytes() {
|
|
|
- return totalDataSetSizeInBytes;
|
|
|
+ public long reservedSizeInBytes() {
|
|
|
+ return reservedSizeInBytes;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -113,7 +105,7 @@ public class StoreStats implements Writeable, ToXContentFragment {
|
|
|
* the reserved size is unknown.
|
|
|
*/
|
|
|
public ByteSizeValue getReservedSize() {
|
|
|
- return ByteSizeValue.ofBytes(reservedSize);
|
|
|
+ return ByteSizeValue.ofBytes(reservedSizeInBytes);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -123,7 +115,7 @@ public class StoreStats implements Writeable, ToXContentFragment {
|
|
|
out.writeVLong(totalDataSetSizeInBytes);
|
|
|
}
|
|
|
if (out.getTransportVersion().onOrAfter(RESERVED_BYTES_VERSION)) {
|
|
|
- out.writeZLong(reservedSize);
|
|
|
+ out.writeZLong(reservedSizeInBytes);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -144,12 +136,12 @@ public class StoreStats implements Writeable, ToXContentFragment {
|
|
|
StoreStats that = (StoreStats) o;
|
|
|
return sizeInBytes == that.sizeInBytes
|
|
|
&& totalDataSetSizeInBytes == that.totalDataSetSizeInBytes
|
|
|
- && reservedSize == that.reservedSize;
|
|
|
+ && reservedSizeInBytes == that.reservedSizeInBytes;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int hashCode() {
|
|
|
- return Objects.hash(sizeInBytes, totalDataSetSizeInBytes, reservedSize);
|
|
|
+ return Objects.hash(sizeInBytes, totalDataSetSizeInBytes, reservedSizeInBytes);
|
|
|
}
|
|
|
|
|
|
static final class Fields {
|