java.lang.Object
org.elasticsearch.common.FieldMemoryStats
public final class FieldMemoryStats
extends Object
implements Writeable, Iterable<Map.Entry<String,Long>>
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
ConstructorsConstructorDescriptionFieldMemoryStats(Map<String, Long> stats) Creates a new FieldMemoryStats instanceFieldMemoryStats(StreamInput input) Creates a new FieldMemoryStats instance from a stream -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(FieldMemoryStats fieldMemoryStats) Adds / merges the given field memory stats into this stats instancebooleancontainsField(String field) Returnstrueiff the given field is in the statscopy()Creates a deep copy of this stats instancebooleanlongReturns the fields value in bytes or0if it's not present in the statsinthashCode()iterator()voidtoXContent(XContentBuilder builder, String key, String rawKey, String readableKey) Generates x-content into the given builder for each of the fields in this stats instancevoidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public void toXContent(XContentBuilder builder, String key, String rawKey, String readableKey) throws IOException Generates 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 or0if it's not present in the stats -
containsField
Returnstrueiff the given field is in the stats
-