示例#1
0
  private void postJoin() {
    blacklistedAddresses.clear();

    if (logger.isFinestEnabled()) {
      logger.finest(
          "PostJoin master: " + node.getMasterAddress() + ", isMaster: " + node.isMaster());
    }
    if (node.getState() != NodeState.ACTIVE) {
      return;
    }
    if (tryCount.incrementAndGet() == JOIN_TRY_COUNT) {
      logger.warning("Join try count exceed limit, setting this node as master!");
      node.setAsMaster();
    }

    if (node.joined()) {
      if (!node.isMaster()) {
        ensureConnectionToAllMembers();
      }

      if (clusterService.getSize() == 1) {
        logger.info('\n' + node.clusterService.membersString());
      }
    }
  }
示例#2
0
 @Override
 public boolean isActive() {
   return node.getState() != NodeState.SHUT_DOWN;
 }