use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.
the class StandaloneWalRecordsIteratorTest method createWalFiles.
/**
*/
private String createWalFiles(int segRecCnt) throws Exception {
IgniteEx ig = (IgniteEx) startGrid();
String archiveWalDir = getArchiveWalDirPath(ig);
ig.cluster().active(true);
IgniteCacheDatabaseSharedManager sharedMgr = ig.context().cache().context().database();
IgniteWriteAheadLogManager walMgr = ig.context().cache().context().wal();
// Generate WAL segments for filling WAL archive folder.
for (int i = 0; i < 2 * ig.configuration().getDataStorageConfiguration().getWalSegments(); i++) {
sharedMgr.checkpointReadLock();
try {
for (int j = 0; j < segRecCnt - 1; j++) walMgr.log(new SnapshotRecord(i * segRecCnt + j, false));
walMgr.log(new SnapshotRecord(i * segRecCnt + segRecCnt - 1, false), RolloverType.NEXT_SEGMENT);
} finally {
sharedMgr.checkpointReadUnlock();
}
}
stopGrid();
return archiveWalDir;
}
use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.
the class FailureHandlingConfigurationTest method testPartialCfgParamsPropagation.
/**
* @throws Exception If failed.
*/
@Test
public void testPartialCfgParamsPropagation() throws Exception {
sysWorkerBlockedTimeout = 30_000L;
checkpointReadLockTimeout = null;
IgniteEx ignite = startGrid(0);
ignite.cluster().active(true);
WorkersRegistry reg = ignite.context().workersRegistry();
IgniteCacheDatabaseSharedManager dbMgr = ignite.context().cache().context().database();
FailureHandlingMxBean mBean = getMBean();
assertEquals(sysWorkerBlockedTimeout.longValue(), reg.getSystemWorkerBlockedTimeout());
assertEquals(sysWorkerBlockedTimeout.longValue(), dbMgr.checkpointReadLockTimeout());
assertEquals(sysWorkerBlockedTimeout.longValue(), mBean.getSystemWorkerBlockedTimeout());
assertEquals(sysWorkerBlockedTimeout.longValue(), mBean.getCheckpointReadLockTimeout());
}
use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.
the class FailureHandlingConfigurationTest method testCfgParamsPropagation.
/**
* @throws Exception If failed.
*/
@Test
public void testCfgParamsPropagation() throws Exception {
sysWorkerBlockedTimeout = 30_000L;
checkpointReadLockTimeout = 20_000L;
IgniteEx ignite = startGrid(0);
ignite.cluster().active(true);
WorkersRegistry reg = ignite.context().workersRegistry();
IgniteCacheDatabaseSharedManager dbMgr = ignite.context().cache().context().database();
FailureHandlingMxBean mBean = getMBean();
assertEquals(sysWorkerBlockedTimeout.longValue(), reg.getSystemWorkerBlockedTimeout());
assertEquals(checkpointReadLockTimeout.longValue(), dbMgr.checkpointReadLockTimeout());
assertEquals(sysWorkerBlockedTimeout.longValue(), mBean.getSystemWorkerBlockedTimeout());
assertEquals(checkpointReadLockTimeout.longValue(), mBean.getCheckpointReadLockTimeout());
}
use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.
the class FailureHandlingConfigurationTest method testOverridingBySysProps.
/**
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_SYSTEM_WORKER_BLOCKED_TIMEOUT, value = "80000")
@WithSystemProperty(key = IGNITE_CHECKPOINT_READ_LOCK_TIMEOUT, value = "90000")
public void testOverridingBySysProps() throws Exception {
sysWorkerBlockedTimeout = 1L;
checkpointReadLockTimeout = 2L;
IgniteEx ignite = startGrid(0);
ignite.cluster().active(true);
WorkersRegistry reg = ignite.context().workersRegistry();
IgniteCacheDatabaseSharedManager dbMgr = ignite.context().cache().context().database();
FailureHandlingMxBean mBean = getMBean();
assertEquals(sysWorkerBlockedTimeout, ignite.configuration().getSystemWorkerBlockedTimeout());
assertEquals(checkpointReadLockTimeout, ignite.configuration().getDataStorageConfiguration().getCheckpointReadLockTimeout());
long workerPropVal = Long.getLong(IGNITE_SYSTEM_WORKER_BLOCKED_TIMEOUT);
long checkpointPropVal = Long.getLong(IGNITE_CHECKPOINT_READ_LOCK_TIMEOUT);
assertEquals(workerPropVal, reg.getSystemWorkerBlockedTimeout());
assertEquals(checkpointPropVal, dbMgr.checkpointReadLockTimeout());
assertEquals(workerPropVal, mBean.getSystemWorkerBlockedTimeout());
assertEquals(checkpointPropVal, mBean.getCheckpointReadLockTimeout());
}
use of org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager in project ignite by apache.
the class FailureHandlingConfigurationTest method testNegativeParamValues.
/**
* @throws Exception If failed.
*/
@Test
public void testNegativeParamValues() throws Exception {
sysWorkerBlockedTimeout = -1L;
checkpointReadLockTimeout = -85L;
IgniteEx ignite = startGrid(0);
ignite.cluster().active(true);
WorkersRegistry reg = ignite.context().workersRegistry();
IgniteCacheDatabaseSharedManager dbMgr = ignite.context().cache().context().database();
FailureHandlingMxBean mBean = getMBean();
assertEquals(0L, reg.getSystemWorkerBlockedTimeout());
assertEquals(-85L, dbMgr.checkpointReadLockTimeout());
assertEquals(0L, mBean.getSystemWorkerBlockedTimeout());
assertEquals(-85L, mBean.getCheckpointReadLockTimeout());
}
Aggregations