/*
* Get a new reference to the child, in case the reference
* saved in the selection list became out of date because of
* changes to that parent.
*/
IN renewedChild = (IN) parent.getTarget(index);
/*
* See the evict() method in this class for an explanation for
* calling latchNoWait(false).
*/
if ((renewedChild != null) &&
(renewedChild.getGeneration() <= oldGenerationCount) &&
renewedChild.latchNoWait(false)) {
try {
if (renewedChild.isEvictable()) {
/*
* Log the child if dirty and env is not r/o. Remove
* from IN list.
*/
long renewedChildLsn = DbLsn.NULL_LSN;
boolean newChildLsn = false;
if (renewedChild.getDirty()) {
if (!envIsReadOnly) {
/*
* Determine whether provisional logging is
* needed. The checkpointer can be null if it
* was shutdown or never started.
*/
boolean logProvisional =
(envImpl.getCheckpointer() != null &&
(renewedChild.getLevel() < envImpl.
getCheckpointer().
getHighestFlushLevel()));
/*
* Log a full version (no deltas) and with
* cleaner migration allowed.
*/
renewedChildLsn = renewedChild.log
(logManager,
false, // allowDeltas
logProvisional,
true, // proactiveMigration
parent);
newChildLsn = true;
}
} else {
renewedChildLsn = parent.getLsn(index);
}
if (renewedChildLsn != DbLsn.NULL_LSN) {
/* Take this off the inlist. */
scanIter.mark();
inlist.removeLatchAlreadyHeld(renewedChild);
scanIter.resetToMark();
evictBytes = renewedChild.getInMemorySize();
if (newChildLsn) {
/*
* Update the parent so its reference is
* null and it has the proper LSN.
*/
parent.updateEntry
(index, null, renewedChildLsn);
} else {
/*
* Null out the reference, but don't dirty
* the node since only the reference
* changed.
*/
parent.updateEntry(index, (Node) null);
}
/* Stats */
nNodesEvictedThisRun++;
nNodesEvicted++;
}
}
} finally {
renewedChild.releaseLatch();
}
}
} finally {
parent.releaseLatch();
}