presto-memory-context/src/main/java/io/prestosql/memory/context/SimpleLocalMemoryContext.java/SimpleLocalMemoryContext/setBytes
class SimpleLocalMemoryContext:    @Override
    public synchronized ListenableFuture<?> setBytes(long bytes)
    {
        checkState(!closed, "SimpleLocalMemoryContext is already closed");
        checkArgument(bytes >= 0, "bytes cannot be negative");

        if (bytes == usedBytes) {
            return NOT_BLOCKED;
        }

        // update the parent first as it may throw a runtime exception (e.g., ExceededMemoryLimitException)
        ListenableFuture<?> future = parentMemoryContext.updateBytes(allocationTag, bytes - usedBytes);
        usedBytes = bytes;
        return future;
    }