private synchronized ListenableFuture<?> updateRevocableMemory(String allocationTag, long delta) { if (delta >= 0) { return memoryPool.reserveRevocable(queryId, delta); } memoryPool.freeRevocable(queryId, -delta); return NOT_BLOCKED; }
private synchronized ListenableFuture<?> updateRevocableMemory(String allocationTag, long delta) { if (delta >= 0) { return memoryPool.reserveRevocable(queryId, delta); } memoryPool.freeRevocable(queryId, -delta); return NOT_BLOCKED; }
private synchronized ListenableFuture<?> updateRevocableMemory(String allocationTag, long delta) { if (delta >= 0) { return memoryPool.reserveRevocable(queryId, delta); } memoryPool.freeRevocable(queryId, -delta); return NOT_BLOCKED; }
synchronized ListenableFuture<?> moveQuery(QueryId queryId, MemoryPool targetMemoryPool) { long originalReserved = getQueryMemoryReservation(queryId); long originalRevocableReserved = getQueryRevocableMemoryReservation(queryId); // Get the tags before we call free() as that would remove the tags and we will lose the tags. 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; }
synchronized ListenableFuture<?> moveQuery(QueryId queryId, MemoryPool targetMemoryPool) { long originalReserved = getQueryMemoryReservation(queryId); long originalRevocableReserved = getQueryRevocableMemoryReservation(queryId); // Get the tags before we call free() as that would remove the tags and we will lose the tags. 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; }