presto-main/src/main/java/io/prestosql/operator/exchange/LocalExchangeMemoryManager.java/LocalExchangeMemoryManager/updateMemoryUsage
class LocalExchangeMemoryManager:    public void updateMemoryUsage(long bytesAdded)
    {
        SettableFuture<?> future;
        synchronized (this) {
            bufferedBytes.addAndGet(bytesAdded);

            // if we are full, then breakout
            if (bufferedBytes.get() > maxBufferedBytes || notFullFuture.isDone()) {
                return;
            }

            // otherwise, we are not full, so complete the future
            future = notFullFuture;
            notFullFuture = NOT_FULL;
        }

        // complete future outside of lock since this can invoke callbacks
        future.set(null);
    }