presto-main/src/main/java/io/prestosql/memory/ClusterMemoryPool.java/ClusterMemoryPool/update
class ClusterMemoryPool:    public synchronized void update(List<MemoryInfo> memoryInfos, int assignedQueries)
    {
        nodes = 0;
        blockedNodes = 0;
        totalDistributedBytes = 0;
        reservedDistributedBytes = 0;
        reservedRevocableDistributedBytes = 0;
        this.assignedQueries = assignedQueries;
        this.queryMemoryReservations.clear();
        this.queryMemoryAllocations.clear();
        this.queryMemoryRevocableReservations.clear();

        for (MemoryInfo info : memoryInfos) {
            MemoryPoolInfo poolInfo = info.getPools().get(id);
            if (poolInfo != null) {
                nodes++;
                if (poolInfo.getFreeBytes() + poolInfo.getReservedRevocableBytes() <= 0) {
                    blockedNodes++;
                }
                totalDistributedBytes += poolInfo.getMaxBytes();
                reservedDistributedBytes += poolInfo.getReservedBytes();
                reservedRevocableDistributedBytes += poolInfo.getReservedRevocableBytes();
                for (Map.Entry<QueryId, Long> entry : poolInfo.getQueryMemoryReservations().entrySet()) {
                    queryMemoryReservations.merge(entry.getKey(), entry.getValue(), Long::sum);
                }
                for (Map.Entry<QueryId, List<MemoryAllocation>> entry : poolInfo.getQueryMemoryAllocations().entrySet()) {
                    queryMemoryAllocations.merge(entry.getKey(), entry.getValue(), this::mergeQueryAllocations);
                }
                for (Map.Entry<QueryId, Long> entry : poolInfo.getQueryMemoryRevocableReservations().entrySet()) {
                    queryMemoryRevocableReservations.merge(entry.getKey(), entry.getValue(), Long::sum);
                }
            }
        }
    }