public void cacheAINodeHeartbeatSample(int nodeId, NodeHeartbeatSample sample) {
    nodeCacheMap
        .computeIfAbsent(nodeId, empty -> new AINodeHeartbeatCache(nodeId))
        .cacheHeartbeatSample(sample);
    Optional.ofNullable(heartbeatProcessingMap.get(nodeId)).ifPresent(node -> node.set(false));
  }
Cache the latest heartbeat sample of a AINode.

@param nodeId the id of the AINode
@param sample the latest heartbeat sample
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/cache/LoadCache.java