Package org.elasticsearch.common
Class FieldMemoryStats
java.lang.Object
org.elasticsearch.common.FieldMemoryStats
- All Implemented Interfaces:
Iterable<com.carrotsearch.hppc.cursors.ObjectLongCursor<String>>
,Writeable
public final class FieldMemoryStats
extends Object
implements Writeable, Iterable<com.carrotsearch.hppc.cursors.ObjectLongCursor<String>>
A reusable class to encode
field -> memory size
mappings-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Constructor Summary
ConstructorDescriptionFieldMemoryStats(com.carrotsearch.hppc.ObjectLongHashMap<String> stats)
Creates a new FieldMemoryStats instanceFieldMemoryStats(StreamInput input)
Creates a new FieldMemoryStats instance from a stream -
Method Summary
Modifier and TypeMethodDescriptionvoid
add(FieldMemoryStats fieldMemoryStats)
Adds / merges the given field memory stats into this stats instanceboolean
containsField(String field)
Returnstrue
iff the given field is in the statscopy()
Creates a deep copy of this stats instanceboolean
long
Returns the fields value in bytes or0
if it's not present in the statsint
hashCode()
iterator()
void
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, String key, String rawKey, String readableKey)
Generates x-content into the given builder for each of the fields in this stats instancevoid
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
FieldMemoryStats
Creates a new FieldMemoryStats instance -
FieldMemoryStats
Creates a new FieldMemoryStats instance from a stream- Throws:
IOException
-
-
Method Details
-
add
Adds / merges the given field memory stats into this stats instance -
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
toXContent
public void toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, String key, String rawKey, String readableKey) throws IOExceptionGenerates x-content into the given builder for each of the fields in this stats instance- Parameters:
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 sizes- Throws:
IOException
-
copy
Creates a deep copy of this stats instance -
equals
-
hashCode
public int hashCode() -
iterator
-
get
Returns the fields value in bytes or0
if it's not present in the stats -
containsField
Returnstrue
iff the given field is in the stats
-