Interface ConnectorPageSink
public interface ConnectorPageSink
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()appendPage(Page page) Returns a future that will be completed when the page sink can accept more pages.default voidCloses the idle partition writers that have not received any data since the last time this method is called.CompletableFuture<Collection<io.airlift.slice.Slice>> finish()Notifies the connector that no more pages will be appended and returns connector-specific information that will be sent to the coordinator to complete the write operation.default longGets the number of output bytes written by this page source so far.default longGet the total memory that needs to be reserved in the memory pool.default longConnectorPageSink can provide optional validation to check the data is correctly consumed by connector (e.g. output table has the correct data).
-
Field Details
-
NOT_BLOCKED
-
-
Method Details
-
getCompletedBytes
default long getCompletedBytes()Gets the number of output bytes written by this page source so far. If size is not available, this method should return zero. -
getMemoryUsage
default 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
-
getValidationCpuNanos
default long getValidationCpuNanos()ConnectorPageSink can provide optional validation to check the data is correctly consumed by connector (e.g. output table has the correct data).This method returns the CPU spent on validation, if any.
-
appendPage
Returns a future that will be completed when the page sink can accept more pages. If the page sink can accept more pages immediately, this method should returnNOT_BLOCKED. -
closeIdleWriters
default void closeIdleWriters()Closes the idle partition writers that have not received any data since the last time this method is called. This method is called periodically based on some data written threshold by the TableWriterOperator. It is needed to avoid high memory usage due to stale partitions kept in memory during partitioned writes. -
finish
CompletableFuture<Collection<io.airlift.slice.Slice>> finish()Notifies the connector that no more pages will be appended and returns connector-specific information that will be sent to the coordinator to complete the write operation. This method may be called immediately after the previous call toappendPage(io.trino.spi.Page)(even if the returned future is not complete). -
abort
void abort()
-