Search in sources :

Example 6 with ClusterServiceImpl

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

the class FinalizeJoinOperation method runPostJoinOp.

private void runPostJoinOp() {
    if (postJoinOp == null) {
        return;
    }
    ClusterServiceImpl clusterService = getService();
    NodeEngineImpl nodeEngine = clusterService.getNodeEngine();
    InternalOperationService operationService = nodeEngine.getOperationService();
    postJoinOp.setNodeEngine(nodeEngine);
    OperationAccessor.setCallerAddress(postJoinOp, getCallerAddress());
    OperationAccessor.setConnection(postJoinOp, getConnection());
    postJoinOp.setOperationResponseHandler(createEmptyResponseHandler());
    operationService.run(postJoinOp);
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) ClusterServiceImpl(com.hazelcast.internal.cluster.impl.ClusterServiceImpl) InternalOperationService(com.hazelcast.spi.impl.operationservice.InternalOperationService)

Example 7 with ClusterServiceImpl

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

the class FinalizeJoinOperation method run.

@Override
public void run() throws Exception {
    checkLocalMemberUuid();
    ClusterServiceImpl clusterService = getService();
    Address callerAddress = getConnectionEndpointOrThisAddress();
    boolean finalized = clusterService.finalizeJoin(memberInfos, callerAddress, clusterId, clusterState, clusterVersion, clusterStartTime, masterTime);
    if (!finalized) {
        return;
    }
    processPartitionState();
    sendPostJoinOperations();
    runPostJoinOp();
}
Also used : Address(com.hazelcast.nio.Address) ClusterServiceImpl(com.hazelcast.internal.cluster.impl.ClusterServiceImpl)

Example 8 with ClusterServiceImpl

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

the class MemberRemoveOperation method isCallerValid.

private boolean isCallerValid(Address caller) {
    ClusterServiceImpl clusterService = getService();
    ILogger logger = getLogger();
    if (caller == null) {
        if (logger.isFineEnabled()) {
            logger.fine("Ignoring removal request of " + address + ", because sender is local or not known.");
        }
        return false;
    }
    if (!address.equals(caller) && !caller.equals(clusterService.getMasterAddress())) {
        if (logger.isFineEnabled()) {
            logger.fine("Ignoring removal request of " + address + ", because sender is neither dead-member " + "nor master: " + caller);
        }
        return false;
    }
    return true;
}
Also used : ClusterServiceImpl(com.hazelcast.internal.cluster.impl.ClusterServiceImpl) ILogger(com.hazelcast.logging.ILogger)

Example 9 with ClusterServiceImpl

use of com.hazelcast.internal.cluster.impl.ClusterServiceImpl 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 10 with ClusterServiceImpl

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

the class MasterConfirmationOperation method run.

@Override
public void run() {
    final Address endpoint = getCallerAddress();
    if (endpoint == null) {
        return;
    }
    final ClusterServiceImpl clusterService = getService();
    final ILogger logger = getLogger();
    final MemberImpl member = clusterService.getMember(endpoint);
    if (member == null) {
        logger.warning("MasterConfirmation has been received from " + endpoint + ", but it is not a member of this cluster!");
        OperationService operationService = getNodeEngine().getOperationService();
        operationService.send(new MemberRemoveOperation(clusterService.getThisAddress()), endpoint);
    } else {
        if (clusterService.isMaster()) {
            clusterService.getClusterHeartbeatManager().acceptMasterConfirmation(member, timestamp);
        } else {
            logger.warning(endpoint + " has sent MasterConfirmation, but this node is not master!");
        }
    }
}
Also used : Address(com.hazelcast.nio.Address) MemberImpl(com.hazelcast.instance.MemberImpl) ClusterServiceImpl(com.hazelcast.internal.cluster.impl.ClusterServiceImpl) ILogger(com.hazelcast.logging.ILogger) OperationService(com.hazelcast.spi.OperationService)

Aggregations

ClusterServiceImpl (com.hazelcast.internal.cluster.impl.ClusterServiceImpl)41 Node (com.hazelcast.instance.Node)13 Address (com.hazelcast.nio.Address)13 ILogger (com.hazelcast.logging.ILogger)9 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)8 ClusterState (com.hazelcast.cluster.ClusterState)6 MemberImpl (com.hazelcast.instance.MemberImpl)5 HazelcastInstance (com.hazelcast.core.HazelcastInstance)4 OperationService (com.hazelcast.spi.OperationService)4 Member (com.hazelcast.core.Member)3 MemberLeftException (com.hazelcast.core.MemberLeftException)3 ClusterStateManager (com.hazelcast.internal.cluster.impl.ClusterStateManager)3 Config (com.hazelcast.config.Config)2 InternalPartition (com.hazelcast.internal.partition.InternalPartition)2 Connection (com.hazelcast.nio.Connection)2 Operation (com.hazelcast.spi.Operation)2 InternalOperationService (com.hazelcast.spi.impl.operationservice.InternalOperationService)2 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)2 ParallelTest (com.hazelcast.test.annotation.ParallelTest)2 QuickTest (com.hazelcast.test.annotation.QuickTest)2