Package org.apache.hadoop.hbase.mapred
Class TableRecordReader
java.lang.Object
org.apache.hadoop.hbase.mapred.TableRecordReader
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,Result>
@Public
public class TableRecordReader
extends Object
implements org.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,Result>
Iterate over an HBase table data, return (Text, RowResult) pairs
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longgetPos()floatvoidinit()Build the scanner.booleannext(ImmutableBytesWritable key, Result value) voidrestart(byte[] firstRow) Restart from survivable exceptions by creating a new scanner.voidsetEndRow(byte[] endRow) voidvoidsetInputColumns(byte[][] inputColumns) voidsetRowFilter(Filter rowFilter) voidsetStartRow(byte[] startRow)
-
Field Details
-
recordReaderImpl
-
-
Constructor Details
-
TableRecordReader
public TableRecordReader()
-
-
Method Details
-
restart
Restart from survivable exceptions by creating a new scanner.- Throws:
IOException
-
init
Build the scanner. Not done in constructor to allow for extension.- Throws:
IOException
-
setHTable
- Parameters:
htable- the table to scan.
-
setInputColumns
- Parameters:
inputColumns- the columns to be placed inResult.
-
setStartRow
- Parameters:
startRow- the first row in the split
-
setEndRow
- Parameters:
endRow- the last row in the split
-
setRowFilter
- Parameters:
rowFilter- theFilterto be used.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,Result>
-
createKey
- Specified by:
createKeyin interfaceorg.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,Result> - See Also:
-
RecordReader.createKey()
-
createValue
- Specified by:
createValuein interfaceorg.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,Result> - See Also:
-
RecordReader.createValue()
-
getPos
- Specified by:
getPosin interfaceorg.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,Result>
-
getProgress
- Specified by:
getProgressin interfaceorg.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,Result>
-
next
- Specified by:
nextin interfaceorg.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,Result> - Parameters:
key- HStoreKey as input key.value- MapWritable as input value- Returns:
- true if there was more data
- Throws:
IOException
-