|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hive.ql.io.RCFile.Reader
public static class RCFile.Reader
Read KeyBuffer/ValueBuffer pairs from a RCFile.
Constructor Summary | |
---|---|
RCFile.Reader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file,
org.apache.hadoop.conf.Configuration conf)
Create a new RCFile reader. |
|
RCFile.Reader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file,
int bufferSize,
org.apache.hadoop.conf.Configuration conf,
long start,
long length)
Create a new RCFile reader. |
Method Summary | |
---|---|
void |
close()
Close the reader. |
protected void |
currentValueBuffer()
|
BytesRefArrayWritable |
getColumn(int columnID,
BytesRefArrayWritable rest)
Fetch all data in the buffer for a given column. |
void |
getCurrentRow(BytesRefArrayWritable ret)
get the current row used,make sure called next(LongWritable)
first. |
long |
getPosition()
Return the current byte position in the input file. |
boolean |
hasRecordsInBuffer()
|
boolean |
isCompressedRCFile()
|
long |
lastSeenSyncPos()
Returns the last seen sync position. |
boolean |
next(org.apache.hadoop.io.LongWritable readRows)
Returns how many rows we fetched with next(). |
boolean |
nextColumnsBatch()
Read in next key buffer and throw any data in current key buffer and current value buffer. |
protected int |
nextKeyBuffer()
|
protected org.apache.hadoop.fs.FSDataInputStream |
openFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file,
int bufferSize,
long length)
Override this method to specialize the type of FSDataInputStream returned. |
void |
seek(long position)
Set the current byte position in the input file. |
void |
sync(long position)
Seek to the next sync mark past a given position. |
boolean |
syncSeen()
Returns true iff the previous call to next passed a sync mark. |
String |
toString()
Returns the name of the file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RCFile.Reader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public RCFile.Reader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file, int bufferSize, org.apache.hadoop.conf.Configuration conf, long start, long length) throws IOException
IOException
Method Detail |
---|
protected org.apache.hadoop.fs.FSDataInputStream openFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file, int bufferSize, long length) throws IOException
FSDataInputStream
returned.
IOException
public long getPosition() throws IOException
IOException
public void seek(long position) throws IOException
The position passed must be a position returned by
RCFile.Writer.getLength()
when writing this file. To seek to an
arbitrary position, use sync(long)
. In another
words, the current seek can only seek to the end of the file. For other
positions, use sync(long)
.
IOException
public void sync(long position) throws IOException
IOException
protected int nextKeyBuffer() throws IOException
IOException
protected void currentValueBuffer() throws IOException
IOException
public BytesRefArrayWritable getColumn(int columnID, BytesRefArrayWritable rest) throws IOException
nextColumnsBatch()
.
Calling getColumn() with not change the result of
next(LongWritable)
and
getCurrentRow(BytesRefArrayWritable)
.
columnID
-
IOException
public boolean nextColumnsBatch() throws IOException
next(LongWritable)
and
getCurrentRow(BytesRefArrayWritable)
IOException
public boolean next(org.apache.hadoop.io.LongWritable readRows) throws IOException
seek(long)
,
nextColumnsBatch()
can change the underlying key buffer and
value buffer.
IOException
public boolean hasRecordsInBuffer()
public void getCurrentRow(BytesRefArrayWritable ret) throws IOException
next(LongWritable)
first.
IOException
public boolean syncSeen()
public long lastSeenSyncPos()
public String toString()
toString
in class Object
public boolean isCompressedRCFile()
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |