presto-hive/src/main/java/io/prestosql/plugin/hive/util/AsyncQueue.java/AsyncQueue/isFinished
class AsyncQueue:    public synchronized boolean isFinished()
    {
        return finishing && borrowerCount == 0 && elements.size() == 0;
    }