org.apache.avro.mapred
Class SequenceFileReader<K,V>

java.lang.Object
  extended by org.apache.avro.mapred.SequenceFileReader<K,V>
All Implemented Interfaces:
Closeable, Iterable<Pair<K,V>>, Iterator<Pair<K,V>>, FileReader<Pair<K,V>>

public class SequenceFileReader<K,V>
extends Object
implements FileReader<Pair<K,V>>

A FileReader for sequence files.


Constructor Summary
SequenceFileReader(File file)
           
SequenceFileReader(SequenceFile.Reader reader, Configuration conf)
           
SequenceFileReader(URI uri, Configuration c)
           
 
Method Summary
 void close()
           
 Schema getSchema()
           
 boolean hasNext()
           
 Iterator<Pair<K,V>> iterator()
           
 Pair<K,V> next()
           
 Pair<K,V> next(Pair<K,V> reuse)
           
 boolean pastSync(long position)
           
 void remove()
           
 void sync(long position)
           
 long tell()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceFileReader

public SequenceFileReader(File file)
                   throws IOException
Throws:
IOException

SequenceFileReader

public SequenceFileReader(URI uri,
                          Configuration c)
                   throws IOException
Throws:
IOException

SequenceFileReader

public SequenceFileReader(SequenceFile.Reader reader,
                          Configuration conf)
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

remove

public void remove()
Specified by:
remove in interface Iterator<Pair<K,V>>

iterator

public Iterator<Pair<K,V>> iterator()
Specified by:
iterator in interface Iterable<Pair<K,V>>

getSchema

public Schema getSchema()
Specified by:
getSchema in interface FileReader<Pair<K,V>>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<Pair<K,V>>

next

public Pair<K,V> next()
Specified by:
next in interface Iterator<Pair<K,V>>

next

public Pair<K,V> next(Pair<K,V> reuse)
               throws IOException
Specified by:
next in interface FileReader<Pair<K,V>>
Throws:
IOException

sync

public void sync(long position)
          throws IOException
Specified by:
sync in interface FileReader<Pair<K,V>>
Throws:
IOException

pastSync

public boolean pastSync(long position)
                 throws IOException
Specified by:
pastSync in interface FileReader<Pair<K,V>>
Throws:
IOException

tell

public long tell()
          throws IOException
Specified by:
tell in interface FileReader<Pair<K,V>>
Throws:
IOException


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.