Package io.trino.memory
Class QueryContext
- java.lang.Object
-
- io.trino.memory.QueryContext
-
@ThreadSafe public class QueryContext extends Object
-
-
Constructor Summary
Constructors Constructor Description QueryContext(QueryId queryId, io.airlift.units.DataSize maxUserMemory, io.airlift.units.DataSize maxTotalMemory, MemoryPool memoryPool, io.airlift.stats.GcMonitor gcMonitor, Executor notificationExecutor, ScheduledExecutorService yieldExecutor, io.airlift.units.DataSize maxSpill, SpillSpaceTracker spillSpaceTracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <C,R>
Raccept(QueryContextVisitor<C,R> visitor, C context)<C,R>
List<R>acceptChildren(QueryContextVisitor<C,R> visitor, C context)TaskContextaddTaskContext(TaskStateMachine taskStateMachine, Session session, Runnable notifyStatusChanged, boolean perOperatorCpuTimerEnabled, boolean cpuTimerEnabled)voidfreeSpill(long bytes)longgetMaxTotalMemory()longgetMaxUserMemory()MemoryPoolgetMemoryPool()QueryIdgetQueryId()TaskContextgetTaskContextByTaskId(TaskId taskId)voidinitializeMemoryLimits(boolean resourceOverCommit, long maxUserMemory, long maxTotalMemory)booleanisMemoryLimitsInitialized()com.google.common.util.concurrent.ListenableFuture<Void>reserveSpill(long bytes)voidsetMemoryPool(MemoryPool newMemoryPool)
-
-
-
Constructor Detail
-
QueryContext
public QueryContext(QueryId queryId, io.airlift.units.DataSize maxUserMemory, io.airlift.units.DataSize maxTotalMemory, MemoryPool memoryPool, io.airlift.stats.GcMonitor gcMonitor, Executor notificationExecutor, ScheduledExecutorService yieldExecutor, io.airlift.units.DataSize maxSpill, SpillSpaceTracker spillSpaceTracker)
-
-
Method Detail
-
isMemoryLimitsInitialized
public boolean isMemoryLimitsInitialized()
-
initializeMemoryLimits
public void initializeMemoryLimits(boolean resourceOverCommit, long maxUserMemory, long maxTotalMemory)
-
getMaxUserMemory
public long getMaxUserMemory()
-
getMaxTotalMemory
public long getMaxTotalMemory()
-
getQueryId
public QueryId getQueryId()
-
reserveSpill
public com.google.common.util.concurrent.ListenableFuture<Void> reserveSpill(long bytes)
-
freeSpill
public void freeSpill(long bytes)
-
setMemoryPool
public void setMemoryPool(MemoryPool newMemoryPool)
-
getMemoryPool
public MemoryPool getMemoryPool()
-
addTaskContext
public TaskContext addTaskContext(TaskStateMachine taskStateMachine, Session session, Runnable notifyStatusChanged, boolean perOperatorCpuTimerEnabled, boolean cpuTimerEnabled)
-
accept
public <C,R> R accept(QueryContextVisitor<C,R> visitor, C context)
-
acceptChildren
public <C,R> List<R> acceptChildren(QueryContextVisitor<C,R> visitor, C context)
-
getTaskContextByTaskId
public TaskContext getTaskContextByTaskId(TaskId taskId)
-
-