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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
long
getPos()
float
void
init()
Build the scanner.boolean
next
(ImmutableBytesWritable key, Result value) void
restart
(byte[] firstRow) Restart from survivable exceptions by creating a new scanner.void
setEndRow
(byte[] endRow) void
void
setInputColumns
(byte[][] inputColumns) void
setRowFilter
(Filter rowFilter) void
setStartRow
(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
- theFilter
to be used.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,
Result>
-
createKey
- Specified by:
createKey
in interfaceorg.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,
Result> - See Also:
-
RecordReader.createKey()
-
createValue
- Specified by:
createValue
in interfaceorg.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,
Result> - See Also:
-
RecordReader.createValue()
-
getPos
- Specified by:
getPos
in interfaceorg.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,
Result>
-
getProgress
- Specified by:
getProgress
in interfaceorg.apache.hadoop.mapred.RecordReader<ImmutableBytesWritable,
Result>
-
next
- Specified by:
next
in 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
-