@Experimental(value=SOURCE_SINK) protected abstract static class BlockBasedSource.Block<T> extends Object
Block represents a block of records that can be read.| Modifier | Constructor and Description |
|---|---|
protected |
Block() |
| Modifier and Type | Method and Description |
|---|---|
abstract T |
getCurrentRecord()
Returns the current record.
|
abstract double |
getFractionOfBlockConsumed()
Returns the fraction of the block already consumed (i.e., not including the current record),
if possible, as a value in [0, 1].
|
abstract boolean |
readNextRecord()
Reads the next record from the block and returns true iff one exists.
|
public abstract T getCurrentRecord()
public abstract boolean readNextRecord()
throws IOException
IOExceptionpublic abstract double getFractionOfBlockConsumed()
If it is not possible to compute the fraction of the block consumed (e.g., the total number of records is unknown and record offsets are unknown), this method may return zero.