@TestOnly
  public boolean tryReserveForTest(
      String queryId,
      String fragmentInstanceId,
      String planNodeId,
      long bytesToReserve,
      long maxBytesCanReserve) {
    Validate.notNull(queryId, "queryId can not be null.");
    Validate.notNull(fragmentInstanceId, "fragmentInstanceId can not be null.");
    Validate.notNull(planNodeId, "planNodeId can not be null.");
    Validate.isTrue(
        bytesToReserve > 0L && bytesToReserve <= maxBytesPerFragmentInstance,
        "bytesToReserve should be in (0,maxBytesPerFI]. maxBytesPerFI: %d, bytesToReserve: %d",
        maxBytesPerFragmentInstance,
        bytesToReserve);

    if (tryReserve(queryId, fragmentInstanceId, planNodeId, bytesToReserve, maxBytesCanReserve)) {
      return true;
    } else {
      rollbackReserve(queryId, fragmentInstanceId, planNodeId, bytesToReserve);
      return false;
    }
  }
Reserve memory with bytesToReserve.

@return if reserve succeed, pair.right will be true, otherwise false
@throws IllegalArgumentException throw exception if current query requests more memory than can
    be allocated.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/memory/MemoryPool.java