Package io.trino.memory
Class MemoryPool
java.lang.Object
io.trino.memory.MemoryPool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(MemoryPoolListener listener) voidvoidfreeRevocable(QueryId queryId, long bytes) longReturns the number of free bytes.getId()getInfo()longlonglongvoidremoveListener(MemoryPoolListener listener) com.google.common.util.concurrent.ListenableFuture<Void>Reserves the given number of bytes.com.google.common.util.concurrent.ListenableFuture<Void>reserveRevocable(QueryId queryId, long bytes) toString()booleantryReserve(QueryId queryId, String allocationTag, long bytes) Try to reserve the given number of bytes.
-
Constructor Details
-
MemoryPool
-
-
Method Details
-
getId
-
getInfo
-
addListener
-
removeListener
-
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
-
tryReserve
Try to reserve the given number of bytes. Return value indicates whether the caller may use the requested memory. -
free
-
freeRevocable
-
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() -
toString
-