Search in sources :

Example 1 with SplitBrainProtectionServiceImpl

use of com.hazelcast.splitbrainprotection.impl.SplitBrainProtectionServiceImpl in project hazelcast by hazelcast.

the class ClusterHeartbeatManager method resetHeartbeats.

/**
 * Reset all heartbeats to the current cluster time. Called when system clock jump is detected.
 */
private void resetHeartbeats() {
    SplitBrainProtectionServiceImpl splitBrainProtectionService = nodeEngine.getSplitBrainProtectionService();
    long now = clusterClock.getClusterTime();
    for (MemberImpl member : clusterService.getMemberImpls()) {
        heartbeatFailureDetector.heartbeat(member, now);
        splitBrainProtectionService.onHeartbeat(member, now);
    }
}
Also used : SplitBrainProtectionServiceImpl(com.hazelcast.splitbrainprotection.impl.SplitBrainProtectionServiceImpl) MemberImpl(com.hazelcast.cluster.impl.MemberImpl)

Example 2 with SplitBrainProtectionServiceImpl

use of com.hazelcast.splitbrainprotection.impl.SplitBrainProtectionServiceImpl in project hazelcast by hazelcast.

the class OperationRunnerImpl method ensureNoSplitBrain.

/**
 * Ensures that there is no split brain if the split brain protection is configured and the operation
 * service is split brain protection aware.
 *
 * @param op the operation for which the minimum cluster size property must satisfy
 * @throws SplitBrainProtectionException if the operation requires a split brain protection and
 *                                       the the minimum cluster size property is not satisfied
 */
private void ensureNoSplitBrain(Operation op) {
    SplitBrainProtectionServiceImpl splitBrainProtectionService = operationService.nodeEngine.getSplitBrainProtectionService();
    splitBrainProtectionService.ensureNoSplitBrain(op);
}
Also used : SplitBrainProtectionServiceImpl(com.hazelcast.splitbrainprotection.impl.SplitBrainProtectionServiceImpl)

Aggregations

SplitBrainProtectionServiceImpl (com.hazelcast.splitbrainprotection.impl.SplitBrainProtectionServiceImpl)2 MemberImpl (com.hazelcast.cluster.impl.MemberImpl)1