use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class CPConfigCheckerTest method whenMemberCount_smallerThanMin.
@Test(expected = IllegalArgumentException.class)
public void whenMemberCount_smallerThanMin() {
Config config = new Config();
CPSubsystemConfig cpSubsystemConfig = config.getCPSubsystemConfig();
cpSubsystemConfig.setCPMemberCount(CPSubsystemConfig.MIN_GROUP_SIZE - 1);
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class CPConfigCheckerTest method whenPersistenceEnabled_andCPSubsystemNotEnabled.
@Test(expected = IllegalArgumentException.class)
public void whenPersistenceEnabled_andCPSubsystemNotEnabled() {
Config config = new Config();
CPSubsystemConfig cpSubsystemConfig = config.getCPSubsystemConfig();
cpSubsystemConfig.setPersistenceEnabled(true);
checkCPSubsystemConfig(cpSubsystemConfig);
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class SemaphoreInitialPermitsTest method createConfig.
@Override
protected Config createConfig(int cpNodeCount, int groupSize) {
Config config = super.createConfig(cpNodeCount, groupSize);
CPSubsystemConfig cpSubsystemConfig = config.getCPSubsystemConfig();
if (cpSubsystemEnabled) {
cpSubsystemConfig.setCPMemberCount(cpNodeCount).setGroupSize(groupSize);
}
SemaphoreConfig semaphoreConfig = new SemaphoreConfig(objectName, jdkCompatible, initialPermits);
cpSubsystemConfig.addSemaphoreConfig(semaphoreConfig);
return config;
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class CountDownLatchAdvancedTest method createConfig.
@Override
protected Config createConfig(int cpNodeCount, int groupSize) {
Config config = super.createConfig(cpNodeCount, groupSize);
CPSubsystemConfig cpSubsystemConfig = config.getCPSubsystemConfig();
cpSubsystemConfig.getRaftAlgorithmConfig().setCommitIndexAdvanceCountToSnapshot(LOG_ENTRY_COUNT_TO_SNAPSHOT);
return config;
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class DefaultNodeExtension method checkPersistenceAllowed.
private void checkPersistenceAllowed() {
PersistenceConfig persistenceConfig = node.getConfig().getPersistenceConfig();
if (persistenceConfig != null && persistenceConfig.isEnabled()) {
if (!BuildInfoProvider.getBuildInfo().isEnterprise()) {
throw new IllegalStateException("Hot Restart requires Hazelcast Enterprise Edition");
}
}
CPSubsystemConfig cpSubsystemConfig = node.getConfig().getCPSubsystemConfig();
if (cpSubsystemConfig != null && cpSubsystemConfig.isPersistenceEnabled()) {
if (!BuildInfoProvider.getBuildInfo().isEnterprise()) {
throw new IllegalStateException("CP persistence requires Hazelcast Enterprise Edition");
}
}
}
Aggregations