Search in sources :

Example 6 with CPSubsystemConfig

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);
}
Also used : Config(com.hazelcast.config.Config) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig) ConfigValidator.checkCPSubsystemConfig(com.hazelcast.internal.config.ConfigValidator.checkCPSubsystemConfig) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig) ConfigValidator.checkCPSubsystemConfig(com.hazelcast.internal.config.ConfigValidator.checkCPSubsystemConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 7 with CPSubsystemConfig

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);
}
Also used : Config(com.hazelcast.config.Config) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig) ConfigValidator.checkCPSubsystemConfig(com.hazelcast.internal.config.ConfigValidator.checkCPSubsystemConfig) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig) ConfigValidator.checkCPSubsystemConfig(com.hazelcast.internal.config.ConfigValidator.checkCPSubsystemConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 8 with 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;
}
Also used : Config(com.hazelcast.config.Config) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig)

Example 9 with CPSubsystemConfig

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;
}
Also used : CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig) Config(com.hazelcast.config.Config) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig)

Example 10 with CPSubsystemConfig

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");
        }
    }
}
Also used : PersistenceConfig(com.hazelcast.config.PersistenceConfig) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig)

Aggregations

CPSubsystemConfig (com.hazelcast.config.cp.CPSubsystemConfig)28 Config (com.hazelcast.config.Config)18 QuickTest (com.hazelcast.test.annotation.QuickTest)16 Test (org.junit.Test)16 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)15 ConfigValidator.checkCPSubsystemConfig (com.hazelcast.internal.config.ConfigValidator.checkCPSubsystemConfig)12 SemaphoreConfig (com.hazelcast.config.cp.SemaphoreConfig)8 FencedLockConfig (com.hazelcast.config.cp.FencedLockConfig)5 RaftAlgorithmConfig (com.hazelcast.config.cp.RaftAlgorithmConfig)4 File (java.io.File)4 KerberosAuthenticationConfig (com.hazelcast.config.security.KerberosAuthenticationConfig)3 KerberosIdentityConfig (com.hazelcast.config.security.KerberosIdentityConfig)3 LdapAuthenticationConfig (com.hazelcast.config.security.LdapAuthenticationConfig)3 RealmConfig (com.hazelcast.config.security.RealmConfig)3 SimpleAuthenticationConfig (com.hazelcast.config.security.SimpleAuthenticationConfig)3 TokenIdentityConfig (com.hazelcast.config.security.TokenIdentityConfig)2 File.createTempFile (java.io.File.createTempFile)2 CPSubsystemConfigChecker (com.hazelcast.config.ConfigCompatibilityChecker.CPSubsystemConfigChecker)1 PersistenceConfig (com.hazelcast.config.PersistenceConfig)1 JaasAuthenticationConfig (com.hazelcast.config.security.JaasAuthenticationConfig)1