synchronized ListenableFuture<?> moveQuery(QueryId queryId, MemoryPool targetMemoryPool)
{
long originalReserved = getQueryMemoryReservation(queryId);
long originalRevocableReserved = getQueryRevocableMemoryReservation(queryId);
Map<String, Long> taggedAllocations = taggedMemoryAllocations.remove(queryId);
ListenableFuture<?> future = targetMemoryPool.reserve(queryId, MOVE_QUERY_TAG, originalReserved);
free(queryId, MOVE_QUERY_TAG, originalReserved);
targetMemoryPool.reserveRevocable(queryId, originalRevocableReserved);
freeRevocable(queryId, originalRevocableReserved);
targetMemoryPool.taggedMemoryAllocations.put(queryId, taggedAllocations);
return future;
}