@Override
  public synchronized void updateCurrentStatistics(boolean forceUpdate) {
    // The Removing status can not be updated
    if (!forceUpdate && NodeStatus.Removing.equals(getNodeStatus())) {
      return;
    }

    NodeHeartbeatSample lastSample;
    final List<AbstractHeartbeatSample> heartbeatHistory;
    /* Update Node status */
    NodeStatus status;
    String statusReason = null;
    long currentNanoTime = System.nanoTime();
    synchronized (slidingWindow) {
      lastSample = (NodeHeartbeatSample) getLastSample();
      heartbeatHistory = Collections.unmodifiableList(slidingWindow);
      /* Update load sample */
      if (lastSample != null && lastSample.isSetLoadSample()) {
        latestLoadSample.set(lastSample.getLoadSample());
      }

      if (lastSample == null) {
        /* First heartbeat not received from this DataNode, status is UNKNOWN */
        status = NodeStatus.Unknown;
      } else if (!failureDetector.isAvailable(nodeId, heartbeatHistory)) {
        /* Failure detector decides that this DataNode is UNKNOWN */
        status = NodeStatus.Unknown;
      } else {
        status = lastSample.getStatus();
        statusReason = lastSample.getStatusReason();
      }
    }

    /* Update loadScore */
    // Only consider Running DataNode as available currently
    // TODO: Construct load score module
    long loadScore = NodeStatus.isNormalStatus(status) ? 0 : Long.MAX_VALUE;

    currentStatistics.set(new NodeStatistics(currentNanoTime, status, statusReason, loadScore));

    if (forceUpdate) {
      LOGGER.debug(
          "Force update NodeCache: status={}, currentNanoTime={}", status, currentNanoTime);
    }
  }
Constructor for create DataNodeHeartbeatCache with default NodeStatistics.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/node/DataNodeHeartbeatCache.java