use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class ConfigXmlGenerator method cpSubsystemConfig.
private static void cpSubsystemConfig(XmlGenerator gen, Config config) {
CPSubsystemConfig cpSubsystemConfig = config.getCPSubsystemConfig();
gen.open("cp-subsystem").node("cp-member-count", cpSubsystemConfig.getCPMemberCount()).node("group-size", cpSubsystemConfig.getGroupSize()).node("session-time-to-live-seconds", cpSubsystemConfig.getSessionTimeToLiveSeconds()).node("session-heartbeat-interval-seconds", cpSubsystemConfig.getSessionHeartbeatIntervalSeconds()).node("missing-cp-member-auto-removal-seconds", cpSubsystemConfig.getMissingCPMemberAutoRemovalSeconds()).node("fail-on-indeterminate-operation-state", cpSubsystemConfig.isFailOnIndeterminateOperationState()).node("persistence-enabled", cpSubsystemConfig.isPersistenceEnabled()).node("base-dir", cpSubsystemConfig.getBaseDir().getAbsolutePath()).node("data-load-timeout-seconds", cpSubsystemConfig.getDataLoadTimeoutSeconds());
RaftAlgorithmConfig raftAlgorithmConfig = cpSubsystemConfig.getRaftAlgorithmConfig();
gen.open("raft-algorithm").node("leader-election-timeout-in-millis", raftAlgorithmConfig.getLeaderElectionTimeoutInMillis()).node("leader-heartbeat-period-in-millis", raftAlgorithmConfig.getLeaderHeartbeatPeriodInMillis()).node("max-missed-leader-heartbeat-count", raftAlgorithmConfig.getMaxMissedLeaderHeartbeatCount()).node("append-request-max-entry-count", raftAlgorithmConfig.getAppendRequestMaxEntryCount()).node("commit-index-advance-count-to-snapshot", raftAlgorithmConfig.getCommitIndexAdvanceCountToSnapshot()).node("uncommitted-entry-count-to-reject-new-appends", raftAlgorithmConfig.getUncommittedEntryCountToRejectNewAppends()).node("append-request-backoff-timeout-in-millis", raftAlgorithmConfig.getAppendRequestBackoffTimeoutInMillis()).close();
gen.open("semaphores");
for (SemaphoreConfig semaphoreConfig : cpSubsystemConfig.getSemaphoreConfigs().values()) {
gen.open("semaphore").node("name", semaphoreConfig.getName()).node("jdk-compatible", semaphoreConfig.isJDKCompatible()).node("initial-permits", semaphoreConfig.getInitialPermits()).close();
}
gen.close().open("locks");
for (FencedLockConfig lockConfig : cpSubsystemConfig.getLockConfigs().values()) {
gen.open("fenced-lock").node("name", lockConfig.getName()).node("lock-acquire-limit", lockConfig.getLockAcquireLimit()).close();
}
gen.close().close();
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class SemaphoreAdvancedTest 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);
cpSubsystemConfig.setSessionTimeToLiveSeconds(10);
cpSubsystemConfig.setSessionHeartbeatIntervalSeconds(1);
SemaphoreConfig semaphoreConfig = new SemaphoreConfig();
semaphoreConfig.setName(objectName);
cpSubsystemConfig.addSemaphoreConfig(semaphoreConfig);
return config;
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class FencedLockAdvancedTest 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);
cpSubsystemConfig.setSessionTimeToLiveSeconds(10);
cpSubsystemConfig.setSessionHeartbeatIntervalSeconds(1);
return config;
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class UnsafeFencedLockAdvancedTest method createInstances.
@Override
protected HazelcastInstance[] createInstances() {
Config config = new Config();
CPSubsystemConfig cpSubsystemConfig = config.getCPSubsystemConfig();
cpSubsystemConfig.setSessionTimeToLiveSeconds(10);
cpSubsystemConfig.setSessionHeartbeatIntervalSeconds(1);
return factory.newInstances(config, 2);
}
use of com.hazelcast.config.cp.CPSubsystemConfig in project hazelcast by hazelcast.
the class HazelcastRaftTestSupport method createConfig.
protected Config createConfig(int cpNodeCount, int groupSize) {
Config config = new Config();
configureSplitBrainDelay(config);
CPSubsystemConfig cpSubsystemConfig = new CPSubsystemConfig();
config.setCPSubsystemConfig(cpSubsystemConfig);
if (cpNodeCount > 0) {
cpSubsystemConfig.setCPMemberCount(cpNodeCount).setGroupSize(groupSize);
}
return config;
}
Aggregations