public final class FieldMemoryStats extends java.lang.Object implements Writeable, java.lang.Iterable<com.carrotsearch.hppc.cursors.ObjectLongCursor<java.lang.String>>
Writeable.Reader<V>, Writeable.Writer<V>
Constructor and Description |
---|
FieldMemoryStats(com.carrotsearch.hppc.ObjectLongHashMap<java.lang.String> stats)
Creates a new FieldMemoryStats instance
|
FieldMemoryStats(StreamInput input)
Creates a new FieldMemoryStats instance from a stream
|
Modifier and Type | Method and Description |
---|---|
void |
add(FieldMemoryStats fieldMemoryStats)
Adds / merges the given field memory stats into this stats instance
|
boolean |
containsField(java.lang.String field)
Returns
true iff the given field is in the stats |
FieldMemoryStats |
copy()
Creates a deep copy of this stats instance
|
boolean |
equals(java.lang.Object o) |
long |
get(java.lang.String field)
Returns the fields value in bytes or
0 if it's not present in the stats |
int |
hashCode() |
java.util.Iterator<com.carrotsearch.hppc.cursors.ObjectLongCursor<java.lang.String>> |
iterator() |
void |
toXContent(XContentBuilder builder,
java.lang.String key,
java.lang.String rawKey,
java.lang.String readableKey)
Generates x-content into the given builder for each of the fields in this stats instance
|
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
public FieldMemoryStats(com.carrotsearch.hppc.ObjectLongHashMap<java.lang.String> stats)
public FieldMemoryStats(StreamInput input) throws java.io.IOException
java.io.IOException
public void add(FieldMemoryStats fieldMemoryStats)
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public void toXContent(XContentBuilder builder, java.lang.String key, java.lang.String rawKey, java.lang.String readableKey) throws java.io.IOException
builder
- the builder to generated onkey
- the top level key for this stats objectrawKey
- the raw byte key for each of the fields byte sizesreadableKey
- the readable key for each of the fields byte sizesjava.io.IOException
public FieldMemoryStats copy()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.Iterator<com.carrotsearch.hppc.cursors.ObjectLongCursor<java.lang.String>> iterator()
iterator
in interface java.lang.Iterable<com.carrotsearch.hppc.cursors.ObjectLongCursor<java.lang.String>>
public long get(java.lang.String field)
0
if it's not present in the statspublic boolean containsField(java.lang.String field)
true
iff the given field is in the stats