Package io.trino.operator
Class OperatorContext
java.lang.Object
io.trino.operator.OperatorContext
Contains information about
Operator execution.
Not thread-safe. Only getNestedOperatorStats()
and revocable-memory-related operations are thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionOperatorContext(int operatorId, PlanNodeId planNodeId, String operatorType, DriverContext driverContext, Executor executor, MemoryTrackingContext operatorMemoryContext) -
Method Summary
Modifier and TypeMethodDescription<C,R> R accept(QueryContextVisitor<C, R> visitor, C context) voiddestroy()io.airlift.stats.CounterStatio.airlift.stats.CounterStatintstatic MetricsgetOperatorMetrics(Metrics operatorMetrics, long inputPositions, double cpuTimeSeconds, double wallTimeSeconds, double blockedWallSeconds) io.airlift.stats.CounterStatio.airlift.stats.CounterStatlonglonglongbooleancom.google.common.util.concurrent.ListenableFuture<Void> com.google.common.util.concurrent.ListenableFuture<Void> newLocalUserMemoryContext(String allocationTag) voidrecordBlocked(com.google.common.util.concurrent.ListenableFuture<Void> blocked) voidrecordDynamicFilterSplitProcessed(long dynamicFilterSplits) voidrecordNetworkInput(long sizeInBytes, long positions) Record the amount of network bytes that were read by an operator.voidrecordOutput(long sizeInBytes, long positions) voidrecordPhysicalInputWithTiming(long sizeInBytes, long positions, long readNanos) Record the amount of physical bytes that were read by an operator and the time it took to read the data.voidrecordPhysicalWrittenData(long sizeInBytes) voidrecordProcessedInput(long sizeInBytes, long positions) Record the size in bytes of input blocks that were processed by an operator.voidrecordWriterInputDataSize(long sizeInBytes) longReturns how much revocable memory will be revoked by the operatorvoidvoidsetFinishedFuture(com.google.common.util.concurrent.ListenableFuture<Void> finishedFuture) voidsetInfoSupplier(Supplier<? extends OperatorInfo> infoSupplier) voidsetLatestConnectorMetrics(Metrics metrics) voidsetLatestMetrics(Metrics metrics) Overwrites the metrics with the latest one.voidsetMemoryRevocationRequestListener(Runnable listener) voidsetNestedOperatorStatsSupplier(Supplier<List<OperatorStats>> nestedOperatorStatsSupplier) toString()
-
Constructor Details
-
OperatorContext
public OperatorContext(int operatorId, PlanNodeId planNodeId, String operatorType, DriverContext driverContext, Executor executor, MemoryTrackingContext operatorMemoryContext)
-
-
Method Details
-
getOperatorId
public int getOperatorId() -
getOperatorType
-
getDriverContext
-
getSession
-
recordPhysicalInputWithTiming
public void recordPhysicalInputWithTiming(long sizeInBytes, long positions, long readNanos) Record the amount of physical bytes that were read by an operator and the time it took to read the data. This metric is valid only for source operators. -
recordNetworkInput
public void recordNetworkInput(long sizeInBytes, long positions) Record the amount of network bytes that were read by an operator. This metric is valid only for source operators. -
recordProcessedInput
public void recordProcessedInput(long sizeInBytes, long positions) Record the size in bytes of input blocks that were processed by an operator. This metric is valid only for source operators. -
recordOutput
public void recordOutput(long sizeInBytes, long positions) -
recordDynamicFilterSplitProcessed
public void recordDynamicFilterSplitProcessed(long dynamicFilterSplits) -
setLatestMetrics
Overwrites the metrics with the latest one.- Parameters:
metrics- Latest operator's metrics.
-
setLatestConnectorMetrics
-
setFinishedFuture
public void setFinishedFuture(com.google.common.util.concurrent.ListenableFuture<Void> finishedFuture) -
recordWriterInputDataSize
public void recordWriterInputDataSize(long sizeInBytes) -
recordPhysicalWrittenData
public void recordPhysicalWrittenData(long sizeInBytes) -
recordBlocked
-
isWaitingForMemory
-
isWaitingForRevocableMemory
-
newLocalUserMemoryContext
-
localUserMemoryContext
-
localRevocableMemoryContext
-
aggregateUserMemoryContext
-
aggregateRevocableMemoryContext
-
newAggregateUserMemoryContext
-
newAggregateRevocableMemoryContext
-
getReservedRevocableBytes
public long getReservedRevocableBytes() -
destroy
public void destroy() -
getSpillContext
-
isMemoryRevokingRequested
public boolean isMemoryRevokingRequested() -
requestMemoryRevoking
public long requestMemoryRevoking()Returns how much revocable memory will be revoked by the operator -
resetMemoryRevokingRequested
public void resetMemoryRevokingRequested() -
setMemoryRevocationRequestListener
-
setInfoSupplier
-
setNestedOperatorStatsSupplier
public void setNestedOperatorStatsSupplier(Supplier<List<OperatorStats>> nestedOperatorStatsSupplier) -
getInputDataSize
public io.airlift.stats.CounterStat getInputDataSize() -
getInputPositions
public io.airlift.stats.CounterStat getInputPositions() -
getOutputDataSize
public io.airlift.stats.CounterStat getOutputDataSize() -
getOutputPositions
public io.airlift.stats.CounterStat getOutputPositions() -
getWriterInputDataSize
public long getWriterInputDataSize() -
getPhysicalWrittenDataSize
public long getPhysicalWrittenDataSize() -
toString
-
getNestedOperatorStats
-
getOperatorMetrics
-
accept
-
getOperatorMemoryContext
-