use of org.apache.ignite.internal.processors.cache.persistence.checkpoint.Checkpointer in project ignite by apache.
the class WalDeletionArchiveAbstractTest method testCheckpointStarted_WhenWalHasTooBigSizeWithoutCheckpoint.
/**
* Checkpoint triggered depends on wal size.
*/
@Test
public void testCheckpointStarted_WhenWalHasTooBigSizeWithoutCheckpoint() throws Exception {
// given: configured grid with max wal archive size = 1MB, wal segment size = 512KB
Ignite ignite = startGrid(dbCfg -> dbCfg.setMaxWalArchiveSize(1024 * 1024));
GridCacheDatabaseSharedManager dbMgr = gridDatabase(ignite);
IgniteCache<Integer, Object> cache = ignite.getOrCreateCache(cacheConfiguration());
for (int i = 0; i < 500; i++) cache.put(i, i);
// then: checkpoint triggered by size limit of wall without checkpoint
Checkpointer checkpointer = dbMgr.getCheckpointer();
String checkpointReason = U.field((Object) U.field(checkpointer, "curCpProgress"), "reason");
assertEquals("too big size of WAL without checkpoint", checkpointReason);
}
Aggregations