use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class AbstractProxySessionManagerTest method createConfig.
@Override
protected Config createConfig(int cpNodeCount, int groupSize) {
Config config = super.createConfig(cpNodeCount, groupSize);
CPSubsystemConfig cpSubsystemConfig = config.getCPSubsystemConfig();
cpSubsystemConfig.setSessionHeartbeatIntervalSeconds(1);
cpSubsystemConfig.setSessionTimeToLiveSeconds(sessionTTLSeconds);
return config;
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class ConfigValidatorTest method testValidationFails_whenSessionHeartbeatIntervalGreaterThanSessionTTL.
@Test(expected = IllegalArgumentException.class)
public void testValidationFails_whenSessionHeartbeatIntervalGreaterThanSessionTTL() {
CPSubsystemConfig config = new CPSubsystemConfig();
config.setSessionTimeToLiveSeconds(5);
config.setSessionHeartbeatIntervalSeconds(10);
checkCPSubsystemConfig(config);
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class ConfigValidatorTest method testValidationFails_whenSessionTTLGreaterThanMissingCPMemberAutoRemovalSeconds.
@Test(expected = IllegalArgumentException.class)
public void testValidationFails_whenSessionTTLGreaterThanMissingCPMemberAutoRemovalSeconds() {
CPSubsystemConfig config = new CPSubsystemConfig();
config.setMissingCPMemberAutoRemovalSeconds(5);
config.setSessionTimeToLiveSeconds(10);
checkCPSubsystemConfig(config);
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class PhoneHomeCPSubsystemTest method initialise.
@Before
public void initialise() {
Config config = getConfig();
CPSubsystemConfig cpSubsystemConfig = new CPSubsystemConfig().setCPMemberCount(3);
config.setCPSubsystemConfig(cpSubsystemConfig);
HazelcastInstance hz = createHazelcastInstances(config, 3)[0];
node = getNode(hz);
phoneHome = new PhoneHome(node);
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testCPSubsystemConfig.
@Test
public void testCPSubsystemConfig() {
CPSubsystemConfig cpSubsystemConfig = config.getCPSubsystemConfig();
assertEquals(0, cpSubsystemConfig.getCPMemberCount());
assertEquals(0, cpSubsystemConfig.getGroupSize());
assertEquals(15, cpSubsystemConfig.getSessionTimeToLiveSeconds());
assertEquals(3, cpSubsystemConfig.getSessionHeartbeatIntervalSeconds());
assertEquals(120, cpSubsystemConfig.getMissingCPMemberAutoRemovalSeconds());
assertEquals(30, cpSubsystemConfig.getDataLoadTimeoutSeconds());
assertTrue(cpSubsystemConfig.isFailOnIndeterminateOperationState());
assertFalse(cpSubsystemConfig.isPersistenceEnabled());
assertEquals(new File("/custom-dir").getAbsolutePath(), cpSubsystemConfig.getBaseDir().getAbsolutePath());
RaftAlgorithmConfig raftAlgorithmConfig = cpSubsystemConfig.getRaftAlgorithmConfig();
assertEquals(500, raftAlgorithmConfig.getLeaderElectionTimeoutInMillis());
assertEquals(100, raftAlgorithmConfig.getLeaderHeartbeatPeriodInMillis());
assertEquals(3, raftAlgorithmConfig.getMaxMissedLeaderHeartbeatCount());
assertEquals(25, raftAlgorithmConfig.getAppendRequestMaxEntryCount());
assertEquals(250, raftAlgorithmConfig.getCommitIndexAdvanceCountToSnapshot());
assertEquals(75, raftAlgorithmConfig.getUncommittedEntryCountToRejectNewAppends());
assertEquals(50, raftAlgorithmConfig.getAppendRequestBackoffTimeoutInMillis());
SemaphoreConfig semaphoreConfig1 = cpSubsystemConfig.findSemaphoreConfig("sem1");
SemaphoreConfig semaphoreConfig2 = cpSubsystemConfig.findSemaphoreConfig("sem2");
assertNotNull(semaphoreConfig1);
assertNotNull(semaphoreConfig2);
assertTrue(semaphoreConfig1.isJDKCompatible());
assertFalse(semaphoreConfig2.isJDKCompatible());
assertEquals(1, semaphoreConfig1.getInitialPermits());
assertEquals(2, semaphoreConfig2.getInitialPermits());
FencedLockConfig lockConfig1 = cpSubsystemConfig.findLockConfig("lock1");
FencedLockConfig lockConfig2 = cpSubsystemConfig.findLockConfig("lock2");
assertNotNull(lockConfig1);
assertNotNull(lockConfig2);
assertEquals(1, lockConfig1.getLockAcquireLimit());
assertEquals(2, lockConfig2.getLockAcquireLimit());
}
Aggregations