Interface AbstractIndexFieldData.PerValueEstimator
-
- All Known Implementing Classes:
NonEstimatingEstimator
,PagedBytesIndexFieldData.PagedBytesEstimator
- Enclosing class:
- AbstractIndexFieldData<FD extends AtomicFieldData>
public static interface AbstractIndexFieldData.PerValueEstimator
APerValueEstimator
is a sub-class that can be used to estimate the memory overhead for loading the data. Each field data implementation should implement its ownPerValueEstimator
if it intends to take advantage of the MemoryCircuitBreaker.Note that the .beforeLoad(...) and .afterLoad(...) methods must be manually called.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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 knownorg.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)
-
-
-
Method Detail
-
bytesPerValue
long bytesPerValue(org.apache.lucene.util.BytesRef term)
- Returns:
- the number of bytes for the given term
-
beforeLoad
org.apache.lucene.index.TermsEnum beforeLoad(org.apache.lucene.index.Terms terms) throws java.io.IOException
Execute any pre-loading estimations for the terms. May also optionally wrap aTermsEnum
in aRamAccountingTermsEnum
which will estimate the memory on a per-term basis.- Parameters:
terms
- terms to be estimated- Returns:
- A TermsEnum for the given terms
- Throws:
java.io.IOException
-
afterLoad
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- Parameters:
termsEnum
- terms that were loadedactualUsed
- actual field data memory usage
-
-