Interface SupportsRealTimeRead<T>
- All Superinterfaces:
AutoCloseable,Closeable,PartitionReader<T>
A variation on
PartitionReader for use with low latency streaming processing.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA class to represent the status of a record to be read as the return type of nextWithTimeout. -
Method Summary
Modifier and TypeMethodDescriptionGet the offset of the next record, or the start offset if no records have been read.nextWithTimeout(Long timeout) Alternative function to be called than next(), that proceed to the next record.Methods inherited from interface org.apache.spark.sql.connector.read.PartitionReader
currentMetricsValues, get, next
-
Method Details
-
getOffset
PartitionOffset getOffset()Get the offset of the next record, or the start offset if no records have been read.The execution engine will call this method along with get() to keep track of the current offset. When a task ends, the offset in each partition will be passed back to the driver. They will be used as the start offsets of the next batch.
-
nextWithTimeout
Alternative function to be called than next(), that proceed to the next record. The different from next() is that, if there is no more records, the call needs to keep waiting until the timeout.- Parameters:
timeout- if no result is available after this timeout (milliseconds), return- Returns:
SupportsRealTimeRead.RecordStatusdescribing whether a record is available and its arrival time- Throws:
IOException
-