Search in sources :

Example 1 with DbCheckpointListener

use of org.apache.ignite.internal.processors.cache.persistence.DbCheckpointListener in project ignite by apache.

the class IgnitePersistentStoreSchemaLoadTest method checkpointLatch.

/**
 * @param node Node whose checkpoint to wait for.
 * @return Latch released when checkpoint happens.
 */
private CountDownLatch checkpointLatch(IgniteEx node) {
    final CountDownLatch cnt = new CountDownLatch(1);
    GridCacheDatabaseSharedManager db = (GridCacheDatabaseSharedManager) node.context().cache().context().database();
    db.addCheckpointListener(new DbCheckpointListener() {

        @Override
        public void onCheckpointBegin(Context ctx) {
            cnt.countDown();
        }
    });
    return cnt;
}
Also used : GridCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager) DbCheckpointListener(org.apache.ignite.internal.processors.cache.persistence.DbCheckpointListener) CountDownLatch(java.util.concurrent.CountDownLatch)

Aggregations

CountDownLatch (java.util.concurrent.CountDownLatch)1 DbCheckpointListener (org.apache.ignite.internal.processors.cache.persistence.DbCheckpointListener)1 GridCacheDatabaseSharedManager (org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager)1