org.apache.hadoop.hive.ql.io
Class FlatFileInputFormat.FlatFileRecordReader<R>

java.lang.Object
  extended by org.apache.hadoop.hive.ql.io.FlatFileInputFormat.FlatFileRecordReader<R>
Enclosing class:
FlatFileInputFormat<T>

public class FlatFileInputFormat.FlatFileRecordReader<R>
extends Object

An FlatFileInputFormat.FlatFileRecordReader for plain files with Deserializer records Reads one row at a time of type R. R is intended to be a base class of something such as: Record, Writable, Text, ...


Field Summary
static String SerializationContextImplKey
          The JobConf key of the SerializationContext to use.
 
Constructor Summary
FlatFileInputFormat.FlatFileRecordReader(Configuration conf, FileSplit split)
          FlatFileRecordReader constructor constructs the underlying stream (potentially decompressed) and creates the deserializer.
 
Method Summary
 void close()
           
 Void createKey()
           
 FlatFileInputFormat.RowContainer<R> createValue()
           
 long getPos()
           
 float getProgress()
           
 boolean next(Void key, FlatFileInputFormat.RowContainer<R> value)
          Returns the next row # and value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SerializationContextImplKey

public static final String SerializationContextImplKey
The JobConf key of the SerializationContext to use.

See Also:
Constant Field Values
Constructor Detail

FlatFileInputFormat.FlatFileRecordReader

public FlatFileInputFormat.FlatFileRecordReader(Configuration conf,
                                                FileSplit split)
                                         throws IOException
FlatFileRecordReader constructor constructs the underlying stream (potentially decompressed) and creates the deserializer.

Parameters:
conf - the jobconf
split - the split for this file
Throws:
IOException
Method Detail

createKey

public Void createKey()
Returns:
null

createValue

public FlatFileInputFormat.RowContainer<R> createValue()
Returns:
a new R instance.

next

public boolean next(Void key,
                    FlatFileInputFormat.RowContainer<R> value)
             throws IOException
Returns the next row # and value.

Parameters:
key - - void as these files have a value only
value - - the row container which is always re-used, but the internal value may be set to a new Object
Returns:
whether the key and value were read. True if they were and false if EOF
Throws:
IOException - from the deserializer

getProgress

public float getProgress()
                  throws IOException
Throws:
IOException

getPos

public long getPos()
            throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Throws:
IOException


Copyright © 2012 The Apache Software Foundation