public ClusterServiceImpl(Node node) {

    this.node = node;
    nodeEngine = node.nodeEngine;

    logger = node.getLogger(ClusterService.class.getName());
    clusterClock = new ClusterClockImpl(logger);

    thisAddress = node.getThisAddress();
    thisMember = node.getLocalMember();

    clusterStateManager = new ClusterStateManager(node, lock);
    clusterJoinManager = new ClusterJoinManager(node, this, lock);
    clusterHeartbeatManager = new ClusterHeartbeatManager(node, this);

    registerThisMember();

    node.connectionManager.addConnectionListener(this);
    // MEMBERSHIP_EVENT_EXECUTOR is a single threaded executor to ensure that events are executed in
    // correct order.
    nodeEngine
        .getExecutionService()
        .register(MEMBERSHIP_EVENT_EXECUTOR_NAME, 1, Integer.MAX_VALUE, ExecutorType.CACHED);
    registerMetrics();
  }