org.apache.hadoop.hbase.mapred
Class TableInputFormatBase.TableRecordReader
java.lang.Object
org.apache.hadoop.hbase.mapred.TableInputFormatBase.TableRecordReader
- All Implemented Interfaces:
- org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,RowResult>
- Enclosing class:
- TableInputFormatBase
protected class TableInputFormatBase.TableRecordReader
- extends Object
- implements org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,RowResult>
Iterate over an HBase table data, return (Text, RowResult) pairs
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TableInputFormatBase.TableRecordReader
protected TableInputFormatBase.TableRecordReader()
restart
public void restart(byte[] firstRow)
throws IOException
- Restart from survivable exceptions by creating a new scanner.
- Parameters:
firstRow -
- Throws:
IOException
init
public void init()
throws IOException
- Build the scanner. Not done in constructor to allow for extension.
- Throws:
IOException
setHTable
public void setHTable(HTable htable)
- Parameters:
htable - the HTable to scan.
setInputColumns
public void setInputColumns(byte[][] inputColumns)
- Parameters:
inputColumns - the columns to be placed in RowResult.
setStartRow
public void setStartRow(byte[] startRow)
- Parameters:
startRow - the first row in the split
setEndRow
public void setEndRow(byte[] endRow)
- Parameters:
endRow - the last row in the split
setRowFilter
public void setRowFilter(RowFilterInterface rowFilter)
- Parameters:
rowFilter - the RowFilterInterface to be used.
close
public void close()
- Specified by:
close in interface org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,RowResult>
createKey
public ImmutableBytesWritable createKey()
- Specified by:
createKey in interface org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,RowResult>
- Returns:
- ImmutableBytesWritable
- See Also:
RecordReader.createKey()
createValue
public RowResult createValue()
- Specified by:
createValue in interface org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,RowResult>
- Returns:
- RowResult
- See Also:
RecordReader.createValue()
getPos
public long getPos()
- Specified by:
getPos in interface org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,RowResult>
getProgress
public float getProgress()
- Specified by:
getProgress in interface org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,RowResult>
next
public boolean next(ImmutableBytesWritable key,
RowResult value)
throws IOException
- Specified by:
next in interface org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,RowResult>
- Parameters:
key - HStoreKey as input key.value - MapWritable as input value
- Returns:
- true if there was more data
- Throws:
IOException
Copyright © 2008 The Apache Software Foundation