org.apache.hadoop.mapred
Class LineRecordReader.LineReader

java.lang.Object
  extended by org.apache.hadoop.mapred.LineRecordReader.LineReader
Enclosing class:
LineRecordReader

public static class LineRecordReader.LineReader
extends Object

A class that provides a line reader from an input stream.


Constructor Summary
LineRecordReader.LineReader(InputStream in, Configuration conf)
          Create a line reader that reads from the given stream using the io.file.buffer.size specified in the given Configuration.
 
Method Summary
 void close()
          Close the underlying stream.
 int readLine(Text str)
          Read from the InputStream into the given Text.
 int readLine(Text str, int maxLineLength)
          Read from the InputStream into the given Text.
 int readLine(Text str, int maxLineLength, int maxBytesToConsume)
          Read from the InputStream into the given Text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineRecordReader.LineReader

public LineRecordReader.LineReader(InputStream in,
                                   Configuration conf)
                            throws IOException
Create a line reader that reads from the given stream using the io.file.buffer.size specified in the given Configuration.

Parameters:
in - input stream
conf - configuration
Throws:
IOException
Method Detail

close

public void close()
           throws IOException
Close the underlying stream.

Throws:
IOException

readLine

public int readLine(Text str,
                    int maxLineLength,
                    int maxBytesToConsume)
             throws IOException
Read from the InputStream into the given Text.

Parameters:
str - the object to store the given line
maxLineLength - the maximum number of bytes to store into str.
maxBytesToConsume - the maximum number of bytes to consume in this call.
Returns:
the number of bytes read including the newline
Throws:
IOException - if the underlying stream throws

readLine

public int readLine(Text str,
                    int maxLineLength)
             throws IOException
Read from the InputStream into the given Text.

Parameters:
str - the object to store the given line
maxLineLength - the maximum number of bytes to store into str.
Returns:
the number of bytes read including the newline
Throws:
IOException - if the underlying stream throws

readLine

public int readLine(Text str)
             throws IOException
Read from the InputStream into the given Text.

Parameters:
str - the object to store the given line
Returns:
the number of bytes read including the newline
Throws:
IOException - if the underlying stream throws


Copyright © 2008 The Apache Software Foundation