org.apache.pig.piggybank.storage
Class IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader

java.lang.Object
  extended by org.apache.pig.piggybank.storage.IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader
Enclosing class:
IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader

public static class IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader
extends Object


Constructor Summary
IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader(InputStream in)
          Create a line reader that reads from the given stream using the default buffer-size (64k).
IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader(InputStream in, org.apache.hadoop.conf.Configuration conf)
          Create a line reader that reads from the given stream using the io.file.buffer.size specified in the given Configuration.
IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader(InputStream in, int bufferSize)
          Create a line reader that reads from the given stream using the given buffer-size.
 
Method Summary
 void close()
          Close the underlying stream.
 int readLine(org.apache.hadoop.io.Text str)
          Read from the InputStream into the given Text.
 int readLine(org.apache.hadoop.io.Text str, int maxLineLength)
          Read from the InputStream into the given Text.
 int readLine(org.apache.hadoop.io.Text str, int maxLineLength, int maxBytesToConsume)
          Read one line from the InputStream into the given Text.
 void seek(long offset)
          If given offset is within the buffer, adjust the buffer position to read from otherwise seek to the given offset from start of the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader

public IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader(InputStream in)
Create a line reader that reads from the given stream using the default buffer-size (64k).

Parameters:
in - The input stream
Throws:
IOException

IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader

public IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader(InputStream in,
                                                                                                    int bufferSize)
Create a line reader that reads from the given stream using the given buffer-size.

Parameters:
in - The input stream
bufferSize - Size of the read buffer
Throws:
IOException

IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader

public IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader(InputStream in,
                                                                                                    org.apache.hadoop.conf.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(org.apache.hadoop.io.Text str,
                    int maxLineLength,
                    int maxBytesToConsume)
             throws IOException
Read one line from the InputStream into the given Text. A line can be terminated by one of the following: '\n' (LF) , '\r' (CR), or '\r\n' (CR+LF). EOF also terminates an otherwise unterminated line.

Parameters:
str - the object to store the given line (without newline)
maxLineLength - the maximum number of bytes to store into str; the rest of the line is silently discarded.
maxBytesToConsume - the maximum number of bytes to consume in this call. This is only a hint, because if the line cross this threshold, we allow it to happen. It can overshoot potentially by as much as one buffer length.
Returns:
the number of bytes read including the (longest) newline found.
Throws:
IOException - if the underlying stream throws

readLine

public int readLine(org.apache.hadoop.io.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(org.apache.hadoop.io.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

seek

public void seek(long offset)
          throws IOException
If given offset is within the buffer, adjust the buffer position to read from otherwise seek to the given offset from start of the file.

Parameters:
offset -
Throws:
IOException


Copyright © 2007-2012 The Apache Software Foundation