throw new IllegalStateException(status.toString());
}
}
/* Position a cursor to the first record. */
final Cursor cursor = db.openCursor(null, null);
OperationStatus status = cursor.getFirst(keyEntry, dataEntry, null);
assert status == OperationStatus.SUCCESS;
/*
* Calculate BIN size including LNs/data. The recalcKeyPrefix and
* compactMemory methods are called to simulate normal operation.
* Normally prefixes are recalculated when a IN is split, and
* compactMemory is called after fetching a IN or evicting an LN.
*/
final BIN bin = DbInternal.getCursorImpl(cursor).getBIN();
bin.recalcKeyPrefix();
bin.compactMemory();
minBinSizeWithData = bin.getInMemorySize();
/* Evict all LNs. */
for (int i = 0; i < nodeAvg; i += 1) {
assert status == OperationStatus.SUCCESS;
final CursorImpl cursorImpl = DbInternal.getCursorImpl(cursor);
assert bin == cursorImpl.getBIN();
assert duplicates ?
(bin.getTarget(i) == null) :
(bin.getTarget(i) != null);
if (!duplicates) {
cursorImpl.evict();
}
status = cursor.getNext(keyEntry, dataEntry, null);
}
assert status == OperationStatus.NOTFOUND;
cursor.close();
/*
* Calculate BIN size without LNs/data. The clearLsnCompaction method
* is called to artificially remove LSN compaction savings. The amount
* saved by LSN compaction is currently the only difference between the