presto-main/src/main/java/io/prestosql/execution/MemoryRevokingScheduler.java/MemoryRevokingScheduler/getMemoryAlreadyBeingRevoked
class MemoryRevokingScheduler:    private long getMemoryAlreadyBeingRevoked(Collection<SqlTask> sqlTasks, MemoryPool memoryPool)
    {
        return sqlTasks.stream()
                .filter(task -> task.getTaskStatus().getState() == TaskState.RUNNING)
                .filter(task -> task.getQueryContext().getMemoryPool() == memoryPool)
                .mapToLong(task -> task.getQueryContext().accept(new TraversingQueryContextVisitor<Void, Long>()
                {
                    @Override
                    public Long visitOperatorContext(OperatorContext operatorContext, Void context)
                    {
                        if (operatorContext.isMemoryRevokingRequested()) {
                            return operatorContext.getReservedRevocableBytes();
                        }
                        return 0L;
                    }

                    @Override
                    public Long mergeResults(List<Long> childrenResults)
                    {
                        return childrenResults.stream()
                                .mapToLong(i -> i).sum();
                    }
                }, null))
                .sum();
    }