@Experimental public abstract class HBaseInputFormat<T extends org.apache.flink.api.java.tuple.Tuple> extends AbstractTableInputFormat<T>
InputFormat subclass that wraps the access for HTables.connection, currentRow, endReached, LOG, regionLocator, resultScanner, scan, scannedRows, serializedConfig, table| Constructor and Description |
|---|
HBaseInputFormat(org.apache.hadoop.conf.Configuration hConf)
Constructs a
InputFormat with hbase configuration to read data from hbase. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract org.apache.hadoop.hbase.client.Scan |
getScanner()
Returns an instance of Scan that retrieves the required subset of records from the HBase
table.
|
protected abstract 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 T |
mapResultToOutType(org.apache.hadoop.hbase.client.Result r)
HBase returns an instance of
Result. |
protected abstract T |
mapResultToTuple(org.apache.hadoop.hbase.client.Result r)
The output from HBase is always an instance of
Result. |
close, closeTable, configure, createInputSplits, getConnection, getHadoopConfiguration, getInputSplitAssigner, getStatistics, includeRegionInScan, nextRecord, open, reachedEndpublic HBaseInputFormat(org.apache.hadoop.conf.Configuration hConf)
InputFormat with hbase configuration to read data from hbase.hConf - The configuration that connect to hbase. At least hbase.zookeeper.quorum and
zookeeper.znode.parent need to be set.protected abstract org.apache.hadoop.hbase.client.Scan getScanner()
getScanner in class AbstractTableInputFormat<T extends org.apache.flink.api.java.tuple.Tuple>protected abstract String getTableName()
getTableName in class AbstractTableInputFormat<T extends org.apache.flink.api.java.tuple.Tuple>protected abstract T mapResultToTuple(org.apache.hadoop.hbase.client.Result r)
Result. This method is to copy the
data in the Result instance into the required Tupler - The Result instance from HBase that needs to be convertedTuple that contains the needed information.protected void initTable()
AbstractTableInputFormatScan object and opens the HTable connection to initialize the HBase
table.initTable in class AbstractTableInputFormat<T extends org.apache.flink.api.java.tuple.Tuple>protected T mapResultToOutType(org.apache.hadoop.hbase.client.Result r)
AbstractTableInputFormatResult.
This method maps the returned Result instance into the output type T.
mapResultToOutType in class AbstractTableInputFormat<T extends org.apache.flink.api.java.tuple.Tuple>r - The Result instance from HBase that needs to be convertedT that contains the data of Result.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.