public static class RCFile.RCFileScanner extends FileScanner
columnNum, conf, fragment, inited, meta, progress, schema, tableStats, targets
Constructor and Description |
---|
RCFile.RCFileScanner(org.apache.hadoop.conf.Configuration conf,
Schema schema,
TableMeta meta,
FileFragment fragment) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close scanner
|
protected void |
currentValueBuffer() |
void |
getCurrentRow(Tuple tuple)
get the current row used,make sure called
next()
first. |
org.apache.hadoop.io.SequenceFile.Metadata |
getMetadata()
Return the metadata (Text to Text map) that was written into the
file.
|
org.apache.hadoop.io.Text |
getMetadataValueOf(org.apache.hadoop.io.Text key)
Return the metadata value associated with the given key.
|
long |
getPosition()
Return the current byte position in the input file.
|
float |
getProgress()
How much of the input has the Scanner consumed
|
void |
init() |
boolean |
isProjectable()
It returns if the projection is executed in the underlying scanner layer.
|
boolean |
isSelectable()
It returns if the selection is executed in the underlying scanner layer.
|
boolean |
isSplittable()
It returns if the file is splittable.
|
long |
lastSeenSyncPos()
Returns the last seen sync position.
|
Tuple |
next()
It returns one tuple at each call.
|
boolean |
nextBuffer(org.apache.hadoop.io.LongWritable readRows)
Returns how many rows we fetched with nextBuffer().
|
protected int |
nextKeyBuffer() |
protected org.apache.hadoop.fs.FSDataInputStream |
openFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file,
int bufferSize)
Override this method to specialize the type of
FSDataInputStream returned. |
void |
reset()
Reset the cursor.
|
void |
resetBuffer()
Resets the values which determine if there are more rows in the buffer
This can be used after one calls seek or sync, if one called next before that.
|
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 if the previous call to next passed a sync mark.
|
String |
toString()
Returns the name of the file.
|
getFileSystem, getInputStats, getSchema, setSearchCondition, setTarget
public RCFile.RCFileScanner(org.apache.hadoop.conf.Configuration conf, Schema schema, TableMeta meta, FileFragment fragment) throws IOException
IOException
public void init() throws IOException
init
in interface Scanner
init
in class FileScanner
IOException
public org.apache.hadoop.io.SequenceFile.Metadata getMetadata()
public org.apache.hadoop.io.Text getMetadataValueOf(org.apache.hadoop.io.Text key)
key
- the metadata key to retrieveprotected org.apache.hadoop.fs.FSDataInputStream openFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file, int bufferSize) throws IOException
FSDataInputStream
returned.IOException
public long getPosition() throws IOException
IOException
public void seek(long position) throws IOException
RCFile.RCFileAppender.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 resetBuffer()
public void sync(long position) throws IOException
IOException
protected int nextKeyBuffer() throws IOException
IOException
protected void currentValueBuffer() throws IOException
IOException
public Tuple next() throws IOException
Scanner
IOException
- if internal I/O error occurs during next methodpublic float getProgress()
Scanner
getProgress
in interface Scanner
getProgress
in class FileScanner
0.0
to 1.0
.public boolean nextBuffer(org.apache.hadoop.io.LongWritable readRows) throws IOException
seek(long)
can change the underlying key buffer and
value buffer.IOException
public void getCurrentRow(Tuple tuple) throws IOException
next()
first.IOException
public boolean syncSeen()
public long lastSeenSyncPos()
public void reset() throws IOException
Scanner
IOException
- if internal I/O error occurs during reset methodpublic boolean isProjectable()
Scanner
public boolean isSelectable()
Scanner
public boolean isSplittable()
Scanner
public void close() throws IOException
Scanner
IOException
- if internal I/O error occurs during close methodCopyright © 2014 Apache Software Foundation. All Rights Reserved.