public class HBaseRowDataInputFormat extends AbstractTableInputFormat<RowData>
InputFormat
subclass that wraps the access for HTables. Returns the result as RowData
connection, currentRow, endReached, regionLocator, resultScanner, scan, scannedRows, serializedConfig, table
Constructor and Description |
---|
HBaseRowDataInputFormat(Configuration conf,
String tableName,
HBaseTableSchema schema,
String nullStringLiteral) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.hadoop.hbase.client.Scan |
getScanner()
Returns an instance of Scan that retrieves the required subset of records from the HBase
table.
|
String |
getTableName()
What table is to be read.
|
protected void |
initTable()
Creates a
Scan object and opens the HTable connection to initialize the HBase
table. |
protected RowData |
mapResultToOutType(org.apache.hadoop.hbase.client.Result res)
HBase returns an instance of
Result . |
close, closeTable, configure, createInputSplits, getConnection, getHadoopConfiguration, getInputSplitAssigner, getStatistics, includeRegionInScan, nextRecord, open, reachedEnd
closeInputFormat, getRuntimeContext, openInputFormat, setRuntimeContext
public HBaseRowDataInputFormat(Configuration conf, String tableName, HBaseTableSchema schema, String nullStringLiteral)
protected void initTable() throws IOException
AbstractTableInputFormat
Scan
object and opens the HTable
connection to initialize the HBase
table.initTable
in class AbstractTableInputFormat<RowData>
IOException
- Thrown, if the connection could not be opened due to an I/O problem.protected org.apache.hadoop.hbase.client.Scan getScanner()
AbstractTableInputFormat
getScanner
in class AbstractTableInputFormat<RowData>
public String getTableName()
AbstractTableInputFormat
Per instance of a TableInputFormat derivative only a single table name is possible.
getTableName
in class AbstractTableInputFormat<RowData>
protected RowData mapResultToOutType(org.apache.hadoop.hbase.client.Result res)
AbstractTableInputFormat
Result
.
This method maps the returned Result
instance into the output type T
.
mapResultToOutType
in class AbstractTableInputFormat<RowData>
res
- The Result instance from HBase that needs to be convertedT
that contains the data of Result.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.