@Override
  public synchronized void updateCurrentStatistics(boolean forceUpdate) {
    ConsensusGroupHeartbeatSample lastSample;
    synchronized (slidingWindow) {
      lastSample = (ConsensusGroupHeartbeatSample) getLastSample();
    }
    if (lastSample != null && lastSample.getLeaderId() != UN_READY_LEADER_ID) {
      currentStatistics.set(
          new ConsensusGroupStatistics(System.nanoTime(), lastSample.getLeaderId()));
    }
  }
ConsensusGroupCache caches the ConsensusGroupHeartbeatSamples of a consensus group. Update and
cache the current statistics of the consensus group based on the latest
ConsensusGroupHeartbeatSample.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/consensus/ConsensusGroupCache.java