public class HBaseRowDataInputFormat
extends org.apache.flink.api.common.io.RichInputFormat<T,org.apache.flink.connector.hbase.source.TableInputSplit>
InputFormat subclass that wraps the access for HTables. Returns the result as RowData| 限定符和类型 | 字段和说明 |
|---|---|
protected byte[] |
currentRow |
protected boolean |
endReached |
protected org.apache.hadoop.hbase.client.ResultScanner |
resultScanner
HBase iterator wrapper.
|
protected org.apache.hadoop.hbase.client.Scan |
scan |
protected long |
scannedRows |
protected byte[] |
serializedConfig |
protected org.apache.hadoop.hbase.client.HTable |
table |
| 构造器和说明 |
|---|
HBaseRowDataInputFormat(org.apache.hadoop.conf.Configuration conf,
String tableName,
HBaseTableSchema schema,
String nullStringLiteral) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
void |
closeInputFormat() |
void |
configure(org.apache.flink.configuration.Configuration parameters)
Creates a
Scan object and opens the HTable connection. |
org.apache.flink.connector.hbase.source.TableInputSplit[] |
createInputSplits(int minNumSplits) |
protected org.apache.hadoop.conf.Configuration |
getHadoopConfiguration() |
org.apache.flink.core.io.InputSplitAssigner |
getInputSplitAssigner(org.apache.flink.connector.hbase.source.TableInputSplit[] inputSplits) |
protected org.apache.hadoop.hbase.client.Scan |
getScanner()
Returns an instance of Scan that retrieves the required subset of records from the HBase table.
|
org.apache.flink.api.common.io.statistics.BaseStatistics |
getStatistics(org.apache.flink.api.common.io.statistics.BaseStatistics cachedStatistics) |
String |
getTableName()
What table is to be read.
|
protected boolean |
includeRegionInScan(byte[] startKey,
byte[] endKey)
Test if the given region is to be included in the scan while splitting the regions of a table.
|
protected org.apache.flink.table.data.RowData |
mapResultToOutType(org.apache.hadoop.hbase.client.Result res)
HBase returns an instance of
Result. |
T |
nextRecord(T reuse) |
void |
open(org.apache.flink.connector.hbase.source.TableInputSplit split) |
boolean |
reachedEnd() |
protected boolean endReached
protected transient org.apache.hadoop.hbase.client.HTable table
protected transient org.apache.hadoop.hbase.client.Scan scan
protected org.apache.hadoop.hbase.client.ResultScanner resultScanner
protected byte[] currentRow
protected long scannedRows
protected byte[] serializedConfig
public HBaseRowDataInputFormat(org.apache.hadoop.conf.Configuration conf,
String tableName,
HBaseTableSchema schema,
String nullStringLiteral)
public void configure(org.apache.flink.configuration.Configuration parameters)
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 closeInputFormat().
configure 在接口中 org.apache.flink.api.common.io.InputFormat<org.apache.flink.table.data.RowData,org.apache.flink.connector.hbase.source.TableInputSplit>parameters - The configuration that is to be usedConfigurationprotected org.apache.hadoop.hbase.client.Scan getScanner()
public String getTableName()
Per instance of a TableInputFormat derivative only a single table name is possible.
protected org.apache.flink.table.data.RowData mapResultToOutType(org.apache.hadoop.hbase.client.Result res)
Result.
This method maps the returned Result instance into the output type T.
res - The Result instance from HBase that needs to be convertedT that contains the data of Result.protected org.apache.hadoop.conf.Configuration getHadoopConfiguration()
public void open(org.apache.flink.connector.hbase.source.TableInputSplit split)
throws IOException
IOExceptionpublic T nextRecord(T reuse)
throws IOException
IOExceptionpublic boolean reachedEnd()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic void closeInputFormat()
throws IOException
closeInputFormat 在类中 org.apache.flink.api.common.io.RichInputFormat<T,org.apache.flink.connector.hbase.source.TableInputSplit>IOExceptionpublic org.apache.flink.connector.hbase.source.TableInputSplit[] createInputSplits(int minNumSplits)
throws IOException
IOExceptionprotected boolean includeRegionInScan(byte[] startKey,
byte[] endKey)
startKey - Start key of the regionendKey - End key of the regionpublic org.apache.flink.core.io.InputSplitAssigner getInputSplitAssigner(org.apache.flink.connector.hbase.source.TableInputSplit[] inputSplits)
public org.apache.flink.api.common.io.statistics.BaseStatistics getStatistics(org.apache.flink.api.common.io.statistics.BaseStatistics cachedStatistics)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.