* often enough to prevent the pending LN set from growing too large.
*/
void processPending()
throws DatabaseException {
DbTree dbMapTree = env.getDbTree();
LNInfo[] pendingLNs = fileSelector.getPendingLNs();
if (pendingLNs != null) {
TreeLocation location = new TreeLocation();
for (LNInfo info : pendingLNs) {
DatabaseId dbId = info.getDbId();
DatabaseImpl db = dbMapTree.getDb(dbId, lockTimeout);
try {
byte[] key = info.getKey();
byte[] dupKey = info.getDupKey();
LN ln = info.getLN();
/* Evict before processing each entry. */
if (DO_CRITICAL_EVICTION) {
env.criticalEviction(true /*backgroundIO*/);
}
processPendingLN
(ln, db, key, dupKey, location);
} finally {
dbMapTree.releaseDb(db);
}
/* Sleep if background read/write limit was exceeded. */
env.sleepAfterBackgroundIO();
}
}
DatabaseId[] pendingDBs = fileSelector.getPendingDBs();
if (pendingDBs != null) {
for (DatabaseId dbId : pendingDBs) {
DatabaseImpl db = dbMapTree.getDb(dbId, lockTimeout);
try {
if (db == null || db.isDeleteFinished()) {
fileSelector.removePendingDB(dbId);
}
} finally {
dbMapTree.releaseDb(db);
}
}
}
}