Interface ConnectorPageSource

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
EmptyPageSource, FixedPageSource, RecordPageSource

public interface ConnectorPageSource extends Closeable
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final CompletableFuture<?>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Immediately finishes this page source.
    long
    Gets the number of input bytes processed by this page source so far.
    default OptionalLong
    Gets the number of input rows processed by this page source so far.
    long
    Get the total memory that needs to be reserved in the memory pool.
    default Metrics
    Returns the connector's metrics, mapping a metric ID to its latest value.
    Gets the next page of data.
    long
    Gets the wall time this page source spent reading data from the input.
    Returns a future that will be completed when the page source becomes unblocked.
    boolean
    Will this page source product more pages?
  • Field Details

  • Method Details

    • getCompletedBytes

      long getCompletedBytes()
      Gets the number of input bytes processed by this page source so far. If size is not available, this method should return zero.
    • getCompletedPositions

      default OptionalLong getCompletedPositions()
      Gets the number of input rows processed by this page source so far. By default, the positions count of the page returned from getNextPage is used to calculate the number of input rows.
    • getReadTimeNanos

      long getReadTimeNanos()
      Gets the wall time this page source spent reading data from the input. If read time is not available, this method should return zero.
    • isFinished

      boolean isFinished()
      Will this page source product more pages?
    • getNextPage

      Page getNextPage()
      Gets the next page of data. This method is allowed to return null.
    • getMemoryUsage

      long getMemoryUsage()
      Get the total memory that needs to be reserved in the memory pool. This memory should include any buffers, etc. that are used for reading data.
      Returns:
      the memory used so far in table read
    • close

      void close() throws IOException
      Immediately finishes this page source. Trino will always call this method.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • isBlocked

      default CompletableFuture<?> isBlocked()
      Returns a future that will be completed when the page source becomes unblocked. If the page source is not blocked, this method should return NOT_BLOCKED.
    • getMetrics

      default Metrics getMetrics()
      Returns the connector's metrics, mapping a metric ID to its latest value. Each call must return an immutable snapshot of available metrics. Same ID metrics are merged across all tasks and exposed via OperatorStats. This method can be called after the page source is closed.