Class RamAccountingTermsEnum

java.lang.Object
org.apache.lucene.index.TermsEnum
org.apache.lucene.index.FilteredTermsEnum
org.elasticsearch.index.fielddata.RamAccountingTermsEnum
All Implemented Interfaces:
org.apache.lucene.util.BytesRefIterator

public final class RamAccountingTermsEnum extends org.apache.lucene.index.FilteredTermsEnum
TermsEnum that takes a CircuitBreaker, increasing the breaker every time .next(...) is called. Proxies all methods to the original TermsEnum otherwise.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.lucene.index.FilteredTermsEnum

    org.apache.lucene.index.FilteredTermsEnum.AcceptStatus

    Nested classes/interfaces inherited from class org.apache.lucene.index.TermsEnum

    org.apache.lucene.index.TermsEnum.SeekStatus
  • Field Summary

    Fields inherited from class org.apache.lucene.index.FilteredTermsEnum

    actualTerm, tenum

    Fields inherited from class org.apache.lucene.index.TermsEnum

    EMPTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    RamAccountingTermsEnum​(org.apache.lucene.index.TermsEnum termsEnum, CircuitBreaker breaker, AbstractIndexOrdinalsFieldData.PerValueEstimator estimator, String fieldName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.lucene.index.FilteredTermsEnum.AcceptStatus
    accept​(org.apache.lucene.util.BytesRef term)
    Always accept the term.
    void
    Flush the flushBuffer to the breaker, incrementing the total bytes and resetting the buffer.
    long
     
    org.apache.lucene.util.BytesRef
    Proxy to the original next() call, but estimates the overhead of loading the next term.

    Methods inherited from class org.apache.lucene.index.FilteredTermsEnum

    attributes, docFreq, impacts, nextSeekTerm, ord, postings, seekCeil, seekExact, seekExact, seekExact, setInitialSeekTerm, term, termState, totalTermFreq

    Methods inherited from class org.apache.lucene.index.TermsEnum

    postings

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • accept

      protected org.apache.lucene.index.FilteredTermsEnum.AcceptStatus accept(org.apache.lucene.util.BytesRef term) throws IOException
      Always accept the term.
      Specified by:
      accept in class org.apache.lucene.index.FilteredTermsEnum
      Throws:
      IOException
    • flush

      public void flush()
      Flush the flushBuffer to the breaker, incrementing the total bytes and resetting the buffer.
    • next

      public org.apache.lucene.util.BytesRef next() throws IOException
      Proxy to the original next() call, but estimates the overhead of loading the next term.
      Specified by:
      next in interface org.apache.lucene.util.BytesRefIterator
      Overrides:
      next in class org.apache.lucene.index.FilteredTermsEnum
      Throws:
      IOException
    • getTotalBytes

      public long getTotalBytes()
      Returns:
      the total number of bytes that have been aggregated