/** * Adjust the breaker when no terms were actually loaded, but the field data takes up space * regardless. For instance, when ordinals are used. * * @param actualUsed bytes actually used */ public void adjustForNoTerms(long actualUsed) { breaker.addWithoutBreaking(actualUsed); }
/** * Adjusts the breaker based on the aggregated value from the RamAccountingTermsEnum * * @param termsEnum terms that were wrapped and loaded * @param actualUsed actual field data memory usage */ @Override public void afterLoad(TermsEnum termsEnum, long actualUsed) { assert termsEnum instanceof RamAccountingTermsEnum; long estimatedBytes = ((RamAccountingTermsEnum) termsEnum).getTotalBytes(); breaker.addWithoutBreaking(-(estimatedBytes - actualUsed)); }