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
ConstructorDescriptionDataFileReader12
(SeekableInput sin, DatumReader<D> reader) Construct a reader for a file. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this reader.byte[]
Return the value of a metadata property.long
getMetaLong
(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.boolean
hasNext()
iterator()
next()
Return the next datum in the file.boolean
pastSync
(long position) Return true if past the next synchronization point after a position.void
remove()
void
seek
(long position) Move to the specified synchronization point, as returned byDataFileWriter.sync()
.void
sync
(long position) Move to the next synchronization point after a position.long
tell()
Return the current position in the input.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods 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:
getSchema
in interfaceFileReader<D>
-
iterator
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
next
Return the next datum in the file.- Specified by:
next
in 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:
sync
in interfaceFileReader<D>
- Throws:
IOException
-
pastSync
Return true if past the next synchronization point after a position.- Specified by:
pastSync
in interfaceFileReader<D>
- Throws:
IOException
-
tell
Return the current position in the input.- Specified by:
tell
in interfaceFileReader<D>
- Throws:
IOException
-
close
Close this reader.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-