public boolean tryReserve(
      String queryId,
      String fragmentInstanceId,
      String planNodeId,
      long bytesToReserve,
      long maxBytesCanReserve) {
    long tryUsedBytes = memoryBlock.forceAllocateWithoutLimitation(bytesToReserve);
    long queryRemainingBytes =
        maxBytesCanReserve
            - queryMemoryReservations
                .get(queryId)
                .get(fragmentInstanceId)
                .merge(planNodeId, bytesToReserve, Long::sum);
    return tryUsedBytes <= memoryBlock.getTotalMemorySizeInBytes() && queryRemainingBytes >= 0;
  }
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