Class MemoryPool


  • public class MemoryPool
    extends Object
    • Constructor Detail

      • MemoryPool

        public MemoryPool​(MemoryPoolId id,
                          io.airlift.units.DataSize size)
    • Method Detail

      • reserve

        public com.google.common.util.concurrent.ListenableFuture<Void> reserve​(QueryId queryId,
                                                                                String allocationTag,
                                                                                long bytes)
        Reserves the given number of bytes. Caller should wait on the returned future, before allocating more memory.
      • reserveRevocable

        public com.google.common.util.concurrent.ListenableFuture<Void> reserveRevocable​(QueryId queryId,
                                                                                         long bytes)
      • tryReserve

        public boolean tryReserve​(QueryId queryId,
                                  String allocationTag,
                                  long bytes)
        Try to reserve the given number of bytes. Return value indicates whether the caller may use the requested memory.
      • free

        public void free​(QueryId queryId,
                         String allocationTag,
                         long bytes)
      • freeRevocable

        public void freeRevocable​(QueryId queryId,
                                  long bytes)
      • getFreeBytes

        public long getFreeBytes()
        Returns the number of free bytes. This value may be negative, which indicates that the pool is over-committed.
      • getMaxBytes

        public long getMaxBytes()
      • getReservedBytes

        public long getReservedBytes()
      • getReservedRevocableBytes

        public long getReservedRevocableBytes()