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.
|
public SequenceFileReader(File file) throws IOException
IOException
public SequenceFileReader(URI uri, Configuration c) throws IOException
IOException
public SequenceFileReader(SequenceFile.Reader reader, Configuration conf)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public Schema getSchema()
FileReader
getSchema
in interface FileReader<Pair<K,V>>
public Pair<K,V> next(Pair<K,V> reuse) throws IOException
FileReader
next
in interface FileReader<Pair<K,V>>
reuse
- an instance to reuse.IOException
public void sync(long position) throws IOException
FileReader
FileReader.pastSync(long)
with the end point before each call to Iterator.next()
.sync
in interface FileReader<Pair<K,V>>
IOException
public boolean pastSync(long position) throws IOException
FileReader
pastSync
in interface FileReader<Pair<K,V>>
IOException
public long tell() throws IOException
FileReader
tell
in interface FileReader<Pair<K,V>>
IOException
Copyright © 2009–2017 The Apache Software Foundation. All rights reserved.