Add ByteSizeValue to SegmentStats.
This commit is contained in:
parent
d657dc49b2
commit
125ac4f92f
|
@ -23,6 +23,7 @@ import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.io.stream.Streamable;
|
import org.elasticsearch.common.io.stream.Streamable;
|
||||||
|
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
import org.elasticsearch.common.xcontent.ToXContent;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilderString;
|
import org.elasticsearch.common.xcontent.XContentBuilderString;
|
||||||
|
@ -68,6 +69,10 @@ public class SegmentsStats implements Streamable, ToXContent {
|
||||||
return this.memoryInBytes;
|
return this.memoryInBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ByteSizeValue getMemory() {
|
||||||
|
return new ByteSizeValue(memoryInBytes);
|
||||||
|
}
|
||||||
|
|
||||||
public static SegmentsStats readSegmentsStats(StreamInput in) throws IOException {
|
public static SegmentsStats readSegmentsStats(StreamInput in) throws IOException {
|
||||||
SegmentsStats stats = new SegmentsStats();
|
SegmentsStats stats = new SegmentsStats();
|
||||||
stats.readFrom(in);
|
stats.readFrom(in);
|
||||||
|
|
Loading…
Reference in New Issue