Package org.apache.avro.file
Class DataFileReader12<D>
java.lang.Object
org.apache.avro.file.DataFileReader12<D>
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<D>,Iterator<D>,FileReader<D>
Read files written by Avro version 1.2.
-
Constructor Summary
ConstructorsConstructorDescriptionDataFileReader12(SeekableInput sin, DatumReader<D> reader) Construct a reader for a file. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this reader.byte[]Return the value of a metadata property.longgetMetaLong(String key) Return the value of a metadata property.getMetaString(String key) Return the value of a metadata property.Return the schema used in this file.booleanhasNext()iterator()next()Return the next datum in the file.booleanpastSync(long position) Return true if past the next synchronization point after a position.voidremove()voidseek(long position) Move to the specified synchronization point, as returned byDataFileWriter.sync().voidsync(long position) Move to the next synchronization point after a position.longtell()Return the current position in the input.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
DataFileReader12
Construct a reader for a file.- Throws:
IOException
-
-
Method Details
-
getMeta
Return the value of a metadata property. -
getMetaString
Return the value of a metadata property. -
getMetaLong
Return the value of a metadata property. -
getSchema
Return the schema used in this file.- Specified by:
getSchemain interfaceFileReader<D>
-
iterator
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
next
Return the next datum in the file.- Specified by:
nextin interfaceFileReader<D>- Parameters:
reuse- an instance to reuse.- Throws:
IOException
-
seek
Move to the specified synchronization point, as returned byDataFileWriter.sync().- Throws:
IOException
-
sync
Move to the next synchronization point after a position.- Specified by:
syncin interfaceFileReader<D>- Throws:
IOException
-
pastSync
Return true if past the next synchronization point after a position.- Specified by:
pastSyncin interfaceFileReader<D>- Throws:
IOException
-
tell
Return the current position in the input.- Specified by:
tellin interfaceFileReader<D>- Throws:
IOException
-
close
Close this reader.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-