public static class IndexedStorage.IndexedStorageInputFormat.IndexedStorageRecordReader.IndexedStorageLineReader extends Object
| Constructor and Description |
|---|
IndexedStorageLineReader(InputStream in)
Create a line reader that reads from the given stream using the
default buffer-size (64k).
|
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. |
IndexedStorageLineReader(InputStream in,
int bufferSize)
Create a line reader that reads from the given stream using the
given buffer-size.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public IndexedStorageLineReader(InputStream in)
in - The input streamIOExceptionpublic IndexedStorageLineReader(InputStream in, int bufferSize)
in - The input streambufferSize - Size of the read bufferIOExceptionpublic IndexedStorageLineReader(InputStream in, org.apache.hadoop.conf.Configuration conf) throws IOException
io.file.buffer.size specified in the given
Configuration.in - input streamconf - configurationIOExceptionpublic void close()
throws IOException
IOExceptionpublic int readLine(org.apache.hadoop.io.Text str,
int maxLineLength,
int maxBytesToConsume)
throws IOException
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.IOException - if the underlying stream throwspublic int readLine(org.apache.hadoop.io.Text str,
int maxLineLength)
throws IOException
str - the object to store the given linemaxLineLength - the maximum number of bytes to store into str.IOException - if the underlying stream throwspublic int readLine(org.apache.hadoop.io.Text str)
throws IOException
str - the object to store the given lineIOException - if the underlying stream throwspublic void seek(long offset)
throws IOException
offset - IOExceptionCopyright © 2007-2017 The Apache Software Foundation