infoDb.get(dbTxn, firstPlaceholderKey, true));
if (placeholderOid < 0) {
logger.log(Level.FINEST, "No allocation placeholders");
return;
}
DbCursor cursor = oidsDb.openCursor(dbTxn);
try {
while (cursor.findNext(DataEncoding.encodeLong(placeholderOid))) {
byte[] key = cursor.getKey();
if (DataEncoding.decodeLong(key) != placeholderOid) {
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST,
"Placeholder oid:{0,number,#} not found",
placeholderOid);
}
} else if (isPlaceholderValue(cursor.getValue())) {
boolean success = oidsDb.delete(dbTxn, key);
assert success;
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST,
"Removed placeholder at oid:{0,number,#}",
placeholderOid);
}
} else {
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST,
"Ignoring oid:{0,number,#} that does not" +
" refer to a placeholder",
placeholderOid);
}
}
placeholderOid += ALLOCATION_BLOCK_SIZE;
}
infoDb.put(
dbTxn, firstPlaceholderKey, DataEncoding.encodeLong(-1));
} finally {
cursor.close();
}
}