public class HBaseRowInputFormat extends AbstractTableInputFormat<org.apache.flink.types.Row> implements org.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.types.Row>
InputFormat
subclass that wraps the access for HTables. Returns the result as Row
currentRow, endReached, resultScanner, scan, scannedRows, table
构造器和说明 |
---|
HBaseRowInputFormat(org.apache.hadoop.conf.Configuration conf,
String tableName,
HBaseTableSchema schema) |
限定符和类型 | 方法和说明 |
---|---|
void |
configure(org.apache.flink.configuration.Configuration parameters)
Creates a
Scan object and opens the HTable connection. |
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> |
getProducedType() |
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 org.apache.flink.types.Row |
mapResultToOutType(org.apache.hadoop.hbase.client.Result res)
HBase returns an instance of
Result . |
close, closeInputFormat, createInputSplits, getInputSplitAssigner, getStatistics, includeRegionInScan, nextRecord, open, reachedEnd
public HBaseRowInputFormat(org.apache.hadoop.conf.Configuration conf, String tableName, HBaseTableSchema schema)
public void configure(org.apache.flink.configuration.Configuration parameters)
AbstractTableInputFormat
Scan
object and opens the HTable
connection.
These are opened here because they are needed in the createInputSplits which is called before the openInputFormat method.
The connection is opened in this method and closed in AbstractTableInputFormat.closeInputFormat()
.
configure
在接口中 org.apache.flink.api.common.io.InputFormat<org.apache.flink.types.Row,TableInputSplit>
configure
在类中 AbstractTableInputFormat<org.apache.flink.types.Row>
parameters
- The configuration that is to be usedConfiguration
protected org.apache.hadoop.hbase.client.Scan getScanner()
AbstractTableInputFormat
getScanner
在类中 AbstractTableInputFormat<org.apache.flink.types.Row>
public String getTableName()
AbstractTableInputFormat
Per instance of a TableInputFormat derivative only a single table name is possible.
getTableName
在类中 AbstractTableInputFormat<org.apache.flink.types.Row>
protected org.apache.flink.types.Row mapResultToOutType(org.apache.hadoop.hbase.client.Result res)
AbstractTableInputFormat
Result
.
This method maps the returned Result
instance into the output type T
.
mapResultToOutType
在类中 AbstractTableInputFormat<org.apache.flink.types.Row>
res
- The Result instance from HBase that needs to be convertedT
that contains the data of Result.public org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> getProducedType()
getProducedType
在接口中 org.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.types.Row>
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.