CheckpointConfig ckptConfig = new CheckpointConfig();
ckptConfig.setForce(true);
env.checkpoint(ckptConfig);
Tree tree = DbInternal.dbGetDatabaseImpl(db).getTree();
com.sleepycat.je.tree.Key.DUMP_INT_BINDING = true;
if (DEBUG) {
tree.dump();
}
/*
* Update a key on the BIN3 and a key on BIN4, to create reason for
* a BINDelta. Force a BINDelta for BIN3 and BIN4 out to the log.
*/
IntegerBinding.intToEntry(0, key);
IntegerBinding.intToEntry(100, data);
assertEquals(OperationStatus.SUCCESS, db.put(null, key, data));
IntegerBinding.intToEntry(20, key);
assertEquals(OperationStatus.SUCCESS, db.put(null, key, data));
EnvironmentImpl envImpl = DbInternal.envGetEnvironmentImpl(env);
BIN bin = (BIN)tree.getFirstNode();
bin.log(envImpl.getLogManager(), true, false, false, null);
bin = tree.getNextBin(bin, null);
bin.log(envImpl.getLogManager(), true, false, false, null);
bin.releaseLatch();
/*
* Delete all of left hand side of the tree, so that the subtree root
* headed by IN2 is compressed.
*/
for (int i = 0; i < 50; i+=10) {
IntegerBinding.intToEntry(i, key);
assertEquals(OperationStatus.SUCCESS, db.delete(null, key));
}
/* force a compression */
env.compress();
if (DEBUG) {
tree.dump();
}
}