public void cacheHeartbeatSample(
      int dataNodeId, RegionHeartbeatSample newHeartbeatSample, boolean overwrite) {
    // Only cache sample when the corresponding loadCache exists
    Optional.ofNullable(regionCacheMap.get(dataNodeId))
        .ifPresent(region -> region.cacheHeartbeatSample(newHeartbeatSample, overwrite));
  }
Cache the newest RegionHeartbeatSample.

@param dataNodeId Where the specified Region resides
@param newHeartbeatSample The newest RegionHeartbeatSample
@param overwrite Able to overwrite Adding or Removing
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/region/RegionGroupCache.java