public static interface AbstractIndexFieldData.PerValueEstimator
PerValueEstimator
is a sub-class that can be used to estimate
the memory overhead for loading the data. Each field data
implementation should implement its own PerValueEstimator
if it
intends to take advantage of the MemoryCircuitBreaker.
Note that the .beforeLoad(...) and .afterLoad(...) methods must be manually called.
Modifier and Type | Method and Description |
---|---|
void |
afterLoad(org.apache.lucene.index.TermsEnum termsEnum,
long actualUsed)
Possibly adjust a circuit breaker after field data has been loaded,
now that the actual amount of memory used by the field data is known
|
org.apache.lucene.index.TermsEnum |
beforeLoad(org.apache.lucene.index.Terms terms)
Execute any pre-loading estimations for the terms.
|
long |
bytesPerValue(org.apache.lucene.util.BytesRef term) |
long bytesPerValue(org.apache.lucene.util.BytesRef term)
org.apache.lucene.index.TermsEnum beforeLoad(org.apache.lucene.index.Terms terms) throws java.io.IOException
TermsEnum
in a
RamAccountingTermsEnum
which will estimate the memory on a per-term basis.terms
- terms to be estimatedjava.io.IOException
void afterLoad(org.apache.lucene.index.TermsEnum termsEnum, long actualUsed)
termsEnum
- terms that were loadedactualUsed
- actual field data memory usage