public class SequenceFileReader<K,V> extends Object implements FileReader<Pair<K,V>>
FileReader for sequence files.| Constructor and Description |
|---|
SequenceFileReader(File file) |
SequenceFileReader(SequenceFile.Reader reader,
Configuration conf) |
SequenceFileReader(URI uri,
Configuration c) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Schema |
getSchema()
Return the schema for data in this file.
|
boolean |
hasNext() |
Iterator<Pair<K,V>> |
iterator() |
Pair<K,V> |
next() |
Pair<K,V> |
next(Pair<K,V> reuse)
Read the next datum from the file.
|
boolean |
pastSync(long position)
Return true if past the next synchronization point after a position.
|
void |
remove() |
void |
sync(long position)
Move to the next synchronization point after a position.
|
long |
tell()
Return the current position in the input.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingforEach, spliteratorpublic SequenceFileReader(File file) throws IOException
IOExceptionpublic SequenceFileReader(URI uri, Configuration c) throws IOException
IOExceptionpublic SequenceFileReader(SequenceFile.Reader reader, Configuration conf)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic Schema getSchema()
FileReadergetSchema in interface FileReader<Pair<K,V>>public Pair<K,V> next(Pair<K,V> reuse) throws IOException
FileReadernext in interface FileReader<Pair<K,V>>reuse - an instance to reuse.IOExceptionpublic void sync(long position)
throws IOException
FileReaderFileReader.pastSync(long) with the end point before each call to
Iterator.next().sync in interface FileReader<Pair<K,V>>IOExceptionpublic boolean pastSync(long position)
throws IOException
FileReaderpastSync in interface FileReader<Pair<K,V>>IOExceptionpublic long tell()
throws IOException
FileReadertell in interface FileReader<Pair<K,V>>IOExceptionCopyright © 2009–2023 The Apache Software Foundation. All rights reserved.