T - The type of records contained in the block.public static class AvroSource.AvroReader<T>
extends org.apache.beam.sdk.io.BlockBasedSource.BlockBasedReader<T>
BlockBasedReader for reading blocks from Avro files.
An Avro Object Container File consists of a header followed by a 16-bit sync marker and then a sequence of blocks, where each block begins with two encoded longs representing the total number of records in the block and the block's size in bytes, followed by the block's (optionally-encoded) records. Each block is terminated by a 16-bit sync marker.
| Constructor and Description |
|---|
AvroReader(AvroSource<T> source)
Reads Avro records of type
T from the specified source. |
| Modifier and Type | Method and Description |
|---|---|
org.apache.beam.sdk.extensions.avro.io.AvroSource.AvroBlock<T> |
getCurrentBlock() |
long |
getCurrentBlockOffset() |
long |
getCurrentBlockSize() |
AvroSource<T> |
getCurrentSource() |
long |
getSplitPointsRemaining() |
boolean |
readNextBlock() |
protected void |
startReading(java.nio.channels.ReadableByteChannel channel) |
getCurrent, getCurrentOffset, getFractionConsumed, isAtSplitPoint, readNextRecordadvanceImpl, allowsDynamicSplitting, close, startImplpublic AvroReader(AvroSource<T> source)
T from the specified source.public AvroSource<T> getCurrentSource()
getCurrentSource in class org.apache.beam.sdk.io.FileBasedSource.FileBasedReader<T>public boolean readNextBlock()
readNextBlock in class org.apache.beam.sdk.io.BlockBasedSource.BlockBasedReader<T>public org.apache.beam.sdk.extensions.avro.io.AvroSource.AvroBlock<T> getCurrentBlock()
getCurrentBlock in class org.apache.beam.sdk.io.BlockBasedSource.BlockBasedReader<T>public long getCurrentBlockOffset()
getCurrentBlockOffset in class org.apache.beam.sdk.io.BlockBasedSource.BlockBasedReader<T>public long getCurrentBlockSize()
getCurrentBlockSize in class org.apache.beam.sdk.io.BlockBasedSource.BlockBasedReader<T>public long getSplitPointsRemaining()
getSplitPointsRemaining in class org.apache.beam.sdk.io.OffsetBasedSource.OffsetBasedReader<T>protected void startReading(java.nio.channels.ReadableByteChannel channel)
throws java.io.IOException
startReading in class org.apache.beam.sdk.io.FileBasedSource.FileBasedReader<T>java.io.IOException