| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avro.file.DataFileStream<D>
org.apache.avro.file.DataFileReader<D>
public class DataFileReader<D>
Random access to files written with DataFileWriter.
DataFileWriter| Constructor Summary | |
|---|---|
DataFileReader(File file,
               DatumReader<D> reader)
Construct a reader for a file.  | 
|
DataFileReader(SeekableInput sin,
               DatumReader<D> reader)
Construct a reader for a file.  | 
|
| Method Summary | |
|---|---|
protected  void | 
blockFinished()
 | 
 boolean | 
pastSync(long position)
Return true if past the next synchronization point after a position.  | 
 long | 
previousSync()
Return the last synchronization point before our current position.  | 
 void | 
seek(long position)
Move to a specific, known synchronization point, one returned from DataFileWriter.sync() while writing. | 
 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 org.apache.avro.file.DataFileStream | 
|---|
close, getBlockCount, getMeta, getMetaLong, getMetaString, getSchema, hasNext, iterator, next, next, nextBlock, remove | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Methods inherited from interface org.apache.avro.file.FileReader | 
|---|
getSchema, next | 
| Methods inherited from interface java.util.Iterator | 
|---|
hasNext, next, remove | 
| Methods inherited from interface java.lang.Iterable | 
|---|
iterator | 
| Methods inherited from interface java.io.Closeable | 
|---|
close | 
| Constructor Detail | 
|---|
public DataFileReader(File file,
                      DatumReader<D> reader)
               throws IOException
IOException
public DataFileReader(SeekableInput sin,
                      DatumReader<D> reader)
               throws IOException
IOException| Method Detail | 
|---|
public void seek(long position)
          throws IOException
DataFileWriter.sync() while writing.  If synchronization points were not
 saved while writing a file, use {#sync(long)} instead.
IOException
public void sync(long position)
          throws IOException
pastSync(long) with the end point before each call to DataFileStream.next().
sync in interface FileReader<D>IOException
protected void blockFinished()
                      throws IOException
blockFinished in class DataFileStream<D>IOExceptionpublic long previousSync()
public boolean pastSync(long position)
                 throws IOException
pastSync in interface FileReader<D>IOException
public long tell()
          throws IOException
FileReader
tell in interface FileReader<D>IOException
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||