Class OperatorContext

java.lang.Object
io.trino.operator.OperatorContext

public class OperatorContext extends Object
Contains information about Operator execution.

Not thread-safe. Only getNestedOperatorStats() and revocable-memory-related operations are thread-safe.

  • Constructor Details

  • Method Details

    • getOperatorId

      public int getOperatorId()
    • getOperatorType

      public String getOperatorType()
    • getDriverContext

      public DriverContext getDriverContext()
    • getSession

      public Session getSession()
    • isDone

      public boolean isDone()
    • 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

      public void setLatestMetrics(Metrics metrics)
      Overwrites the metrics with the latest one.
      Parameters:
      metrics - Latest operator's metrics.
    • setLatestConnectorMetrics

      public void setLatestConnectorMetrics(Metrics metrics)
    • recordPhysicalWrittenData

      public void recordPhysicalWrittenData(long sizeInBytes)
    • recordBlocked

      public void recordBlocked(com.google.common.util.concurrent.ListenableFuture<Void> blocked)
    • isWaitingForMemory

      public com.google.common.util.concurrent.ListenableFuture<Void> isWaitingForMemory()
    • isWaitingForRevocableMemory

      public com.google.common.util.concurrent.ListenableFuture<Void> isWaitingForRevocableMemory()
    • newLocalSystemMemoryContext

      public LocalMemoryContext newLocalSystemMemoryContext(String allocationTag)
    • localUserMemoryContext

      public LocalMemoryContext localUserMemoryContext()
    • localSystemMemoryContext

      public LocalMemoryContext localSystemMemoryContext()
    • localRevocableMemoryContext

      public LocalMemoryContext localRevocableMemoryContext()
    • aggregateUserMemoryContext

      public AggregatedMemoryContext aggregateUserMemoryContext()
    • aggregateSystemMemoryContext

      public AggregatedMemoryContext aggregateSystemMemoryContext()
    • aggregateRevocableMemoryContext

      public AggregatedMemoryContext aggregateRevocableMemoryContext()
    • newAggregateUserMemoryContext

      public AggregatedMemoryContext newAggregateUserMemoryContext()
    • newAggregateSystemMemoryContext

      public AggregatedMemoryContext newAggregateSystemMemoryContext()
    • newAggregateRevocableMemoryContext

      public AggregatedMemoryContext newAggregateRevocableMemoryContext()
    • getReservedRevocableBytes

      public long getReservedRevocableBytes()
    • destroy

      public void destroy()
    • getSpillContext

      public SpillContext 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

      public void setMemoryRevocationRequestListener(Runnable listener)
    • setInfoSupplier

      public void setInfoSupplier(Supplier<? extends OperatorInfo> infoSupplier)
    • 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()
    • getPhysicalWrittenDataSize

      public long getPhysicalWrittenDataSize()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getNestedOperatorStats

      public List<OperatorStats> getNestedOperatorStats()
    • getOperatorMetrics

      public static Metrics getOperatorMetrics(Metrics operatorMetrics, long inputPositions)
    • getConnectorMetrics

      public static Metrics getConnectorMetrics(Metrics connectorMetrics, long physicalInputReadTimeNanos)
    • accept

      public <C, R> R accept(QueryContextVisitor<C,R> visitor, C context)
    • getOperatorMemoryContext

      public MemoryTrackingContext getOperatorMemoryContext()