public void cacheRegionHeartbeatSample(
      TConsensusGroupId regionGroupId,
      int nodeId,
      RegionHeartbeatSample sample,
      boolean overwrite) {
    // Only cache sample when the corresponding loadCache exists
    Optional.ofNullable(regionGroupCacheMap.get(regionGroupId))
        .ifPresent(group -> group.cacheHeartbeatSample(nodeId, sample, overwrite));
  }
Cache the latest heartbeat sample of a RegionGroup.

@param regionGroupId the id of the RegionGroup
@param nodeId the id of the DataNode where specified Region resides
@param sample the latest heartbeat sample
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/LoadCache.java