presto-main/src/main/java/io/prestosql/execution/buffer/LazyOutputBuffer.java/LazyOutputBuffer/get
class LazyOutputBuffer:    @Override
    public ListenableFuture<BufferResult> get(OutputBufferId bufferId, long token, DataSize maxSize)
    {
        OutputBuffer outputBuffer;
        synchronized (this) {
            if (delegate == null) {
                if (state.get() == FINISHED) {
                    return immediateFuture(emptyResults(taskInstanceId, 0, true));
                }

                PendingRead pendingRead = new PendingRead(bufferId, token, maxSize);
                pendingReads.add(pendingRead);
                return pendingRead.getFutureResult();
            }
            outputBuffer = delegate;
        }
        return outputBuffer.get(bufferId, token, maxSize);
    }