@Internal public class HBaseRowInputFormat extends AbstractTableInputFormat<Row> implements ResultTypeQueryable<Row>
InputFormat
subclass that wraps the access for HTables. Returns the result as Row
connection, currentRow, endReached, resultScanner, scan, scannedRows, serializedConfig, table
Constructor and Description |
---|
HBaseRowInputFormat(Configuration conf,
String tableName,
HBaseTableSchema schema) |
Modifier and Type | Method and Description |
---|---|
TypeInformation<Row> |
getProducedType()
Gets the data type (as a
TypeInformation ) produced by this function or input format. |
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.
|
void |
initTable()
Creates a
Scan object and opens the HTable connection to initialize the HBase
table. |
protected Row |
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 HBaseRowInputFormat(Configuration conf, String tableName, HBaseTableSchema schema)
public void initTable() throws IOException
AbstractTableInputFormat
Scan
object and opens the HTable
connection to initialize the HBase
table.initTable
in class AbstractTableInputFormat<Row>
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<Row>
public String getTableName()
AbstractTableInputFormat
Per instance of a TableInputFormat derivative only a single table name is possible.
getTableName
in class AbstractTableInputFormat<Row>
protected Row 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<Row>
res
- The Result instance from HBase that needs to be convertedT
that contains the data of Result.public TypeInformation<Row> getProducedType()
ResultTypeQueryable
TypeInformation
) produced by this function or input format.getProducedType
in interface ResultTypeQueryable<Row>
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.