public RegionStatus getRegionCacheLastSampleStatus(TConsensusGroupId regionGroupId, int nodeId) {
    return Optional.ofNullable(regionGroupCacheMap.get(regionGroupId))
        .map(regionGroupCache -> regionGroupCache.getRegionCache(nodeId))
        .map(regionCache -> (RegionHeartbeatSample) regionCache.getLastSample())
        .map(RegionHeartbeatSample::getStatus)
        .orElse(RegionStatus.Unknown);
  }
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