public long getQueryMemoryReservedBytes(String queryId) {
    if (!queryMemoryReservations.containsKey(queryId)) {
      return 0L;
    }
    long sum = 0;
    for (Map<String, Long> map : queryMemoryReservations.get(queryId).values()) {
      sum = sum + map.values().stream().reduce(0L, Long::sum);
    }
    return sum;
  }
Cancel the specified memory reservation. If the reservation has finished, do nothing.

@param future The future returned from {@link #reserve(String, String, String, long, long)}
@return If the future has not complete, return the number of bytes being reserved. Otherwise,
    return 0.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/memory/MemoryPool.java