use of org.apache.ignite.internal.processors.cache.GridCacheProcessor.TIMEOUT_OUTPUT_RESTORE_PARTITION_STATE_PROGRESS in project ignite by apache.
the class RestorePartitionStateTest method testLogTopPartitions.
/**
* Check that the progress of restoring partitions with the top partitions is displayed in the log.
*
* @throws Exception If fail.
*/
@Test
public void testLogTopPartitions() throws Exception {
IgniteEx n = startGrid(0);
n.cluster().state(ClusterState.ACTIVE);
awaitPartitionMapExchange();
((GridCacheDatabaseSharedManager) n.context().cache().context().database()).enableCheckpoints(false).get(getTestTimeout());
for (IgniteInternalCache cache : n.context().cache().caches()) {
for (int i = 0; i < 1_000; i++) cache.put(i, cache.name() + i);
}
stopAllGrids();
awaitPartitionMapExchange();
LogListener startPartRestore = LogListener.matches(logStr -> {
if (logStr.startsWith("Started restoring partition state [grp=")) {
try {
U.sleep(15);
} catch (IgniteInterruptedCheckedException e) {
throw new IgniteException(e);
}
return true;
}
return false;
}).build();
LogListener progressPartRestore = LogListener.matches("Restore partitions state progress").andMatches("topProcessedPartitions").build();
LogListener finishPartRestore = LogListener.matches("Finished restoring partition state for local groups").andMatches("topProcessedPartitions").build();
TIMEOUT_OUTPUT_RESTORE_PARTITION_STATE_PROGRESS = 150L;
setRootLoggerDebugLevel();
startGrid(0, (UnaryOperator<IgniteConfiguration>) cfg -> {
cfg.setGridLogger(new ListeningTestLogger(log, startPartRestore, progressPartRestore, finishPartRestore));
return cfg;
});
assertTrue(startPartRestore.check());
assertTrue(progressPartRestore.check());
assertTrue(finishPartRestore.check());
}
Aggregations