@Evolving
public interface PartitionReader<T>
extends java.io.Closeable
PartitionReaderFactory.createReader(InputPartition) or
PartitionReaderFactory.createColumnarReader(InputPartition). It's responsible for
outputting data for a RDD partition.
Note that, Currently the type `T` can only be InternalRow
for normal data sources, or ColumnarBatch for columnar
data sources(whose PartitionReaderFactory.supportColumnarReads(InputPartition)
returns true).
| Modifier and Type | Method and Description |
|---|---|
default CustomTaskMetric[] |
currentMetricsValues()
Returns an array of custom task metrics.
|
T |
get()
Return the current record.
|
default void |
initMetricsValues(CustomTaskMetric[] metrics)
Sets the initial value of metrics before fetching any data from the reader.
|
boolean |
next()
Proceed to next record, returns false if there is no more records.
|
boolean next()
throws java.io.IOException
java.io.IOException - if failure happens during disk/network IO like reading files.T get()
default CustomTaskMetric[] currentMetricsValues()
default void initMetricsValues(CustomTaskMetric[] metrics)
PartitionReaders are grouped into one partition in case of
KeyGroupedPartitioning and the reader
is initialized with the metrics returned by the previous reader that belongs to the same
partition. By default, this method does nothing.