Search in sources :

Example 1 with ClusterStateManager

use of com.hazelcast.internal.cluster.impl.ClusterStateManager in project hazelcast by hazelcast.

the class ChangeClusterStateOperation method run.

@Override
public void run() throws Exception {
    ClusterServiceImpl service = getService();
    ClusterStateManager clusterStateManager = service.getClusterStateManager();
    getLogger().info("Changing cluster state state to " + stateChange + ", Initiator: " + initiator + " transient: " + isTransient);
    clusterStateManager.commitClusterState(stateChange, initiator, txnId, isTransient);
}
Also used : ClusterServiceImpl(com.hazelcast.internal.cluster.impl.ClusterServiceImpl) ClusterStateManager(com.hazelcast.internal.cluster.impl.ClusterStateManager)

Example 2 with ClusterStateManager

use of com.hazelcast.internal.cluster.impl.ClusterStateManager in project hazelcast by hazelcast.

the class RollbackClusterStateOperation method run.

@Override
public void run() throws Exception {
    ClusterServiceImpl service = getService();
    ClusterStateManager clusterStateManager = service.getClusterStateManager();
    getLogger().info("Rolling back cluster state! Initiator: " + initiator);
    response = clusterStateManager.rollbackClusterState(txnId);
}
Also used : ClusterServiceImpl(com.hazelcast.internal.cluster.impl.ClusterServiceImpl) ClusterStateManager(com.hazelcast.internal.cluster.impl.ClusterStateManager)

Example 3 with ClusterStateManager

use of com.hazelcast.internal.cluster.impl.ClusterStateManager in project hazelcast by hazelcast.

the class LockClusterStateOperation method run.

@Override
public void run() throws Exception {
    ClusterServiceImpl service = getService();
    ClusterStateManager clusterStateManager = service.getClusterStateManager();
    ClusterState state = clusterStateManager.getState();
    if (state == ClusterState.IN_TRANSITION) {
        getLogger().info("Extending cluster state lock. Initiator: " + initiator + ", lease-time: " + leaseTime);
    } else {
        getLogger().info("Locking cluster state. Initiator: " + initiator + ", lease-time: " + leaseTime);
    }
    clusterStateManager.lockClusterState(stateChange, initiator, txnId, leaseTime, partitionStateVersion);
}
Also used : ClusterState(com.hazelcast.cluster.ClusterState) ClusterServiceImpl(com.hazelcast.internal.cluster.impl.ClusterServiceImpl) ClusterStateManager(com.hazelcast.internal.cluster.impl.ClusterStateManager)

Aggregations

ClusterServiceImpl (com.hazelcast.internal.cluster.impl.ClusterServiceImpl)3 ClusterStateManager (com.hazelcast.internal.cluster.impl.ClusterStateManager)3 ClusterState (com.hazelcast.cluster.ClusterState)1