Class SegmentsStats

java.lang.Object
org.opensearch.index.engine.SegmentsStats
All Implemented Interfaces:
org.opensearch.core.common.io.stream.Writeable, org.opensearch.core.xcontent.ToXContent, org.opensearch.core.xcontent.ToXContentFragment

@PublicApi(since="1.0.0") public class SegmentsStats extends Object implements org.opensearch.core.common.io.stream.Writeable, org.opensearch.core.xcontent.ToXContentFragment
Tracker for segment stats
Opensearch.api:
  • Constructor Details

    • SegmentsStats

      public SegmentsStats()
    • SegmentsStats

      public SegmentsStats(org.opensearch.core.common.io.stream.StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details

    • add

      public void add(long count)
    • addIndexWriterMemoryInBytes

      public void addIndexWriterMemoryInBytes(long indexWriterMemoryInBytes)
    • addVersionMapMemoryInBytes

      public void addVersionMapMemoryInBytes(long versionMapMemoryInBytes)
    • addBitsetMemoryInBytes

      public void addBitsetMemoryInBytes(long bitsetMemoryInBytes)
    • addRemoteSegmentStats

      public void addRemoteSegmentStats(RemoteSegmentStats remoteSegmentStats)
    • addReplicationStats

      public void addReplicationStats(ReplicationStats replicationStats)
    • addFileSizes

      public void addFileSizes(Map<String,Long> newFileSizes)
    • add

      public void add(SegmentsStats mergeStats)
    • getCount

      public long getCount()
      The number of segments.
    • getIndexWriterMemoryInBytes

      public long getIndexWriterMemoryInBytes()
      Estimation of the memory usage by index writer
    • getIndexWriterMemory

      public org.opensearch.core.common.unit.ByteSizeValue getIndexWriterMemory()
    • getVersionMapMemoryInBytes

      public long getVersionMapMemoryInBytes()
      Estimation of the memory usage by version map
    • getVersionMapMemory

      public org.opensearch.core.common.unit.ByteSizeValue getVersionMapMemory()
    • getBitsetMemoryInBytes

      public long getBitsetMemoryInBytes()
      Estimation of how much the cached bit sets are taking. (which nested and p/c rely on)
    • getBitsetMemory

      public org.opensearch.core.common.unit.ByteSizeValue getBitsetMemory()
    • getFileSizes

      public Map<String,Long> getFileSizes()
      Returns mapping of file names to their size (only used in tests)
    • getRemoteSegmentStats

      public RemoteSegmentStats getRemoteSegmentStats()
      Returns remote_store based stats
    • getReplicationStats

      public ReplicationStats getReplicationStats()
    • getMaxUnsafeAutoIdTimestamp

      public long getMaxUnsafeAutoIdTimestamp()
      Returns the max timestamp that is used to de-optimize documents with auto-generated IDs in the engine. This is used to ensure we don't add duplicate documents when we assume an append only case based on auto-generated IDs
    • toXContent

      public org.opensearch.core.xcontent.XContentBuilder toXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.opensearch.core.xcontent.ToXContent
      Throws:
      IOException
    • writeTo

      public void writeTo(org.opensearch.core.common.io.stream.StreamOutput out) throws IOException
      Specified by:
      writeTo in interface org.opensearch.core.common.io.stream.Writeable
      Throws:
      IOException
    • clearFileSizes

      public void clearFileSizes()
    • getZeroMemory

      @Deprecated public org.opensearch.core.common.unit.ByteSizeValue getZeroMemory()
      Deprecated.
      Used only for deprecating memory tracking in REST interface todo remove in OpenSearch 3.0