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 -&gt; memory size mappings
  • Constructor Details

    • FieldMemoryStats

      public FieldMemoryStats(com.carrotsearch.hppc.ObjectLongHashMap<String> stats)
      Creates a new FieldMemoryStats instance
    • FieldMemoryStats

      public FieldMemoryStats(StreamInput input) throws IOException
      Creates a new FieldMemoryStats instance from a stream
      Throws:
      IOException
  • Method Details

    • add

      public void add(FieldMemoryStats fieldMemoryStats)
      Adds / merges the given field memory stats into this stats instance
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

      public void toXContent(org.elasticsearch.common.xcontent.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 on
      key - the top level key for this stats object
      rawKey - the raw byte key for each of the fields byte sizes
      readableKey - the readable key for each of the fields byte sizes
      Throws:
      IOException
    • copy

      public FieldMemoryStats copy()
      Creates a deep copy of this stats instance
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • iterator

      public Iterator<com.carrotsearch.hppc.cursors.ObjectLongCursor<String>> iterator()
      Specified by:
      iterator in interface Iterable<com.carrotsearch.hppc.cursors.ObjectLongCursor<String>>
    • get

      public long get(String field)
      Returns the fields value in bytes or 0 if it's not present in the stats
    • containsField

      public boolean containsField(String field)
      Returns true iff the given field is in the stats