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 -&gt; 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

    Constructors
    Constructor
    Description
    > stats)
    Creates a new FieldMemoryStats instance
    Creates a new FieldMemoryStats instance from a stream
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add​(FieldMemoryStats fieldMemoryStats)
    Adds / merges the given field memory stats into this stats instance
    boolean
     field)
    Returns true iff the given field is in the stats
    Creates a deep copy of this stats instance
    boolean
     o)
     
    long
     field)
    Returns the fields value in bytes or 0 if it's not present in the stats
    int
     
    <com.carrotsearch.hppc.cursors.ObjectLongCursor<>>
     
    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 instance
    void
    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

      public FieldMemoryStats(StreamInput input) throws
      Creates a new FieldMemoryStats instance from a stream
      Throws:
  • 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
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
    • toXContent

      public void toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder,  key,  rawKey,  readableKey) throws
      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:
    • copy

      public FieldMemoryStats 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 or 0 if it's not present in the stats
    • containsField

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