public synchronized MemoryPoolInfo getInfo()
{
Map<QueryId, List<MemoryAllocation>> memoryAllocations = new HashMap<>();
for (Entry<QueryId, Map<String, Long>> entry : taggedMemoryAllocations.entrySet()) {
List<MemoryAllocation> allocations = new ArrayList<>();
if (entry.getValue() != null) {
entry.getValue().forEach((tag, allocation) -> allocations.add(new MemoryAllocation(tag, allocation)));
}
memoryAllocations.put(entry.getKey(), allocations);
}
return new MemoryPoolInfo(maxBytes, reservedBytes, reservedRevocableBytes, queryMemoryReservations, memoryAllocations, queryMemoryRevocableReservations);
}