Package io.trino.spi.connector
Class FixedPageSource
- java.lang.Object
-
- io.trino.spi.connector.FixedPageSource
-
- All Implemented Interfaces:
ConnectorPageSource
,Closeable
,AutoCloseable
public class FixedPageSource extends Object implements ConnectorPageSource
-
-
Field Summary
-
Fields inherited from interface io.trino.spi.connector.ConnectorPageSource
NOT_BLOCKED
-
-
Constructor Summary
Constructors Constructor Description FixedPageSource(Iterable<Page> pages)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Immediately finishes this page source.long
getCompletedBytes()
Gets the number of input bytes processed by this page source so far.long
getMemoryUsage()
Get the total memory that needs to be reserved in the general memory pool.Page
getNextPage()
Gets the next page of data.long
getReadTimeNanos()
Gets the wall time this page source spent reading data from the input.boolean
isFinished()
Will this page source product more pages?-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.trino.spi.connector.ConnectorPageSource
getCompletedPositions, getMetrics, isBlocked
-
-
-
-
Method Detail
-
close
public void close()
Description copied from interface:ConnectorPageSource
Immediately finishes this page source. Trino will always call this method.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceConnectorPageSource
-
getCompletedBytes
public long getCompletedBytes()
Description copied from interface:ConnectorPageSource
Gets the number of input bytes processed by this page source so far. If size is not available, this method should return zero.- Specified by:
getCompletedBytes
in interfaceConnectorPageSource
-
getReadTimeNanos
public long getReadTimeNanos()
Description copied from interface:ConnectorPageSource
Gets the wall time this page source spent reading data from the input. If read time is not available, this method should return zero.- Specified by:
getReadTimeNanos
in interfaceConnectorPageSource
-
isFinished
public boolean isFinished()
Description copied from interface:ConnectorPageSource
Will this page source product more pages?- Specified by:
isFinished
in interfaceConnectorPageSource
-
getNextPage
public Page getNextPage()
Description copied from interface:ConnectorPageSource
Gets the next page of data. This method is allowed to return null.- Specified by:
getNextPage
in interfaceConnectorPageSource
-
getMemoryUsage
public long getMemoryUsage()
Description copied from interface:ConnectorPageSource
Get the total memory that needs to be reserved in the general memory pool. This memory should include any buffers, etc. that are used for reading data.- Specified by:
getMemoryUsage
in interfaceConnectorPageSource
- Returns:
- the memory used so far in table read
-
-