/*
* From the last checkpoint start LSN, there should be the
* checkpoint end log entry and a trace message. These take 196
* bytes.
*/
CheckpointConfig checkpointConfig = new CheckpointConfig();
/* Should not cause a checkpoint, too little growth. */
checkpointConfig.setKBytes(1);
env.checkpoint(checkpointConfig);
stats = env.getStats(statsConfig); // read again
assertEquals(0, stats.getNCheckpoints());
/* Fill up the log, there should be a checkpoint. */
String filler = "123456789012345678901245678901234567890123456789";
EnvironmentImpl envImpl = DbInternal.envGetEnvironmentImpl(env);
for (int i = 0; i < 20; i++) {
Tracer.trace(Level.SEVERE, envImpl, filler);
}
env.checkpoint(checkpointConfig);
stats = env.getStats(statsConfig); // read again
assertEquals(1, stats.getNCheckpoints());
/* Try time based, should not checkpoint. */
checkpointConfig.setKBytes(0);
checkpointConfig.setMinutes(1);
env.checkpoint(checkpointConfig);
stats = env.getStats(statsConfig); // read again
assertEquals(0, stats.getNCheckpoints());
/*