* Use a tracker to count lazily compressed, deferred write, LNs as
* obsolete. A local tracker is used to accumulate tracked obsolete
* info so it can be added in a single call under the log write latch.
* [#15365]
*/
LocalUtilizationTracker localTracker = null;
/*
* Non-BIN INs are evicted by detaching them from their parent. For
* BINS, the first step is to remove deleted entries by compressing
* the BIN. The evictor indicates that we shouldn't fault in
* non-resident children during compression. After compression,
* LN logging and LN stripping may be performed.
*
* If LN stripping is used, first we strip the BIN by logging any dirty
* LN children and detaching all its resident LN targets. If we make
* progress doing that, we stop and will not evict the BIN itself until
* possibly later. If it has no resident LNs then we evict the BIN
* itself using the "regular" detach-from-parent routine.
*
* If the cleaner is doing clustering, we don't do BIN stripping if we
* can write out the BIN. Specifically LN stripping is not performed
* if the BIN is dirty AND the BIN is evictable AND cleaner
* clustering is enabled. In this case the BIN is going to be written
* out soon, and with clustering we want to be sure to write out the
* LNs with the BIN; therefore we don't do stripping.
*/
/*
* Use latchNoWait because if it's latched we don't want the cleaner
* to hold up eviction while it migrates an entire BIN. Latched INs
* have a high generation value, so not evicting makes sense. Pass
* false because we don't want to change the generation during the
* eviction process.
*/
boolean inline = (source == EvictionSource.CACHEMODE);
if (inline) {
target.latch(CacheMode.UNCHANGED);
} else {
if (!target.latchNoWait(CacheMode.UNCHANGED)) {
return evictedBytes;
}
}
boolean targetIsLatched = true;
try {
if (target instanceof BIN) {
/* First attempt to compress deleted, resident children. */
localTracker = new LocalUtilizationTracker(envImpl);
envImpl.lazyCompress(target, localTracker);
/*
* Strip any resident LN targets right now. This may dirty
* the BIN if dirty LNs were written out. Note that