public final class RamAccountingTermsEnum
extends org.apache.lucene.index.FilteredTermsEnum
TermsEnum that takes a MemoryCircuitBreaker, increasing the breaker
every time .next(...) is called. Proxies all methods to the original
TermsEnum otherwise.| Constructor and Description |
|---|
RamAccountingTermsEnum(org.apache.lucene.index.TermsEnum termsEnum,
CircuitBreaker breaker,
AbstractIndexFieldData.PerValueEstimator estimator,
java.lang.String fieldName) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.lucene.index.FilteredTermsEnum.AcceptStatus |
accept(org.apache.lucene.util.BytesRef term)
Always accept the term.
|
void |
flush()
Flush the
flushBuffer to the breaker, incrementing the total
bytes and resetting the buffer. |
long |
getTotalBytes() |
org.apache.lucene.util.BytesRef |
next()
Proxy to the original next() call, but estimates the overhead of
loading the next term.
|
public RamAccountingTermsEnum(org.apache.lucene.index.TermsEnum termsEnum,
CircuitBreaker breaker,
AbstractIndexFieldData.PerValueEstimator estimator,
java.lang.String fieldName)
protected org.apache.lucene.index.FilteredTermsEnum.AcceptStatus accept(org.apache.lucene.util.BytesRef term)
throws java.io.IOException
accept in class org.apache.lucene.index.FilteredTermsEnumjava.io.IOExceptionpublic void flush()
flushBuffer to the breaker, incrementing the total
bytes and resetting the buffer.public org.apache.lucene.util.BytesRef next()
throws java.io.IOException
next in interface org.apache.lucene.util.BytesRefIteratornext in class org.apache.lucene.index.FilteredTermsEnumjava.io.IOExceptionpublic long getTotalBytes()