public class SequenceFileReader<K,V> extends Object implements FileReader<Pair<K,V>>
FileReader
for sequence files.Constructor and Description |
---|
SequenceFileReader(File file) |
SequenceFileReader(org.apache.hadoop.io.SequenceFile.Reader reader,
org.apache.hadoop.conf.Configuration conf) |
SequenceFileReader(URI uri,
org.apache.hadoop.conf.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, org.apache.hadoop.conf.Configuration c) throws IOException
IOException
public SequenceFileReader(org.apache.hadoop.io.SequenceFile.Reader reader, org.apache.hadoop.conf.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-2013 The Apache Software Foundation. All Rights Reserved.