Interface ConnectorPageSource
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
EmptyPageSource,FixedPageSource,RecordPageSource
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Immediately finishes this page source.longGets the number of input bytes processed by this page source so far.default OptionalLongGets the number of input rows processed by this page source so far.longGet the total memory that needs to be reserved in the memory pool.default MetricsReturns the connector's metrics, mapping a metric ID to its latest value.Gets the next page of data.longGets the wall time this page source spent reading data from the input.default CompletableFuture<?> Returns a future that will be completed when the page source becomes unblocked.booleanWill this page source product more pages?
-
Field Details
-
NOT_BLOCKED
-
-
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
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
Immediately finishes this page source. Trino will always call this method.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
isBlocked
Returns a future that will be completed when the page source becomes unblocked. If the page source is not blocked, this method should returnNOT_BLOCKED. -
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.
-