Package org.elasticsearch.common
Class FieldMemoryStats
org.elasticsearch.common.FieldMemoryStats
- All Implemented Interfaces:
<com.carrotsearch.hppc.cursors.ObjectLongCursor<>>
,Writeable
public final class FieldMemoryStats
extends
implements <com.carrotsearch.hppc.cursors.ObjectLongCursor<>>
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
ConstructorDescription> 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
field)
Returnstrue
iff the given field is in the statscopy()
Creates a deep copy of this stats instanceboolean
o)
long
field)
Returns the fields value in bytes or0
if it's not present in the statsint
hashCode()
<com.carrotsearch.hppc.cursors.ObjectLongCursor<>>
iterator()
void
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, key, rawKey, 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.
, , , , , , , ,
Methods inherited from interface java.lang.
,
-
Constructor Details
-
FieldMemoryStats
public FieldMemoryStats(com.carrotsearch.hppc.ObjectLongHashMap<> stats)Creates a new FieldMemoryStats instance -
FieldMemoryStats
Creates a new FieldMemoryStats instance from a stream- Throws:
-
-
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. -
toXContent
public void toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, key, rawKey, readableKey) throwsGenerates 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:
-
copy
Creates a deep copy of this stats instance -
equals
public boolean equals( o)- Overrides:
in class
-
hashCode
public int hashCode()- Overrides:
in class
-
iterator
public <com.carrotsearch.hppc.cursors.ObjectLongCursor<>> iterator()- Specified by:
in interface
<com.carrotsearch.hppc.cursors.ObjectLongCursor<>>
-
get
public long get( field)Returns the fields value in bytes or0
if it's not present in the stats -
containsField
public boolean containsField( field)Returnstrue
iff the given field is in the stats
-