@Internal public abstract class AbstractHBaseDynamicTableSource extends Object implements ScanTableSource, LookupTableSource, SupportsProjectionPushDown
ScanTableSource.ScanContext, ScanTableSource.ScanRuntimeProvider
LookupTableSource.LookupContext, LookupTableSource.LookupRuntimeProvider
DynamicTableSource.Context, DynamicTableSource.DataStructureConverter
Modifier and Type | Field and Description |
---|---|
protected LookupCache |
cache |
protected org.apache.hadoop.conf.Configuration |
conf |
protected HBaseTableSchema |
hbaseSchema |
protected int |
maxRetryTimes |
protected String |
nullStringLiteral |
protected String |
tableName |
Constructor and Description |
---|
AbstractHBaseDynamicTableSource(org.apache.hadoop.conf.Configuration conf,
String tableName,
HBaseTableSchema hbaseSchema,
String nullStringLiteral,
int maxRetryTimes,
LookupCache cache) |
Modifier and Type | Method and Description |
---|---|
void |
applyProjection(int[][] projectedFields,
DataType producedDataType)
Provides the field index paths that should be used for a projection.
|
String |
asSummaryString()
Returns a string that summarizes this source for printing to a console or log.
|
LookupCache |
getCache() |
ChangelogMode |
getChangelogMode()
Returns the set of changes that the planner can expect during runtime.
|
HBaseTableSchema |
getHBaseTableSchema() |
protected abstract InputFormat<RowData,?> |
getInputFormat() |
LookupTableSource.LookupRuntimeProvider |
getLookupRuntimeProvider(LookupTableSource.LookupContext context)
Returns a provider of runtime implementation for reading the data.
|
int |
getMaxRetryTimes() |
ScanTableSource.ScanRuntimeProvider |
getScanRuntimeProvider(ScanTableSource.ScanContext runtimeProviderContext)
Returns a provider of runtime implementation for reading the data.
|
boolean |
supportsNestedProjection()
Returns whether this source supports nested projection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
copy
applyProjection
protected final org.apache.hadoop.conf.Configuration conf
protected final String tableName
protected HBaseTableSchema hbaseSchema
protected final String nullStringLiteral
protected final int maxRetryTimes
@Nullable protected final LookupCache cache
public AbstractHBaseDynamicTableSource(org.apache.hadoop.conf.Configuration conf, String tableName, HBaseTableSchema hbaseSchema, String nullStringLiteral, int maxRetryTimes, @Nullable LookupCache cache)
public ScanTableSource.ScanRuntimeProvider getScanRuntimeProvider(ScanTableSource.ScanContext runtimeProviderContext)
ScanTableSource
There might exist different interfaces for runtime implementation which is why ScanTableSource.ScanRuntimeProvider
serves as the base interface. Concrete ScanTableSource.ScanRuntimeProvider
interfaces might be located in other Flink modules.
Independent of the provider interface, the table runtime expects that a source
implementation emits internal data structures (see RowData
for more information).
The given ScanTableSource.ScanContext
offers utilities by the planner for creating runtime
implementation with minimal dependencies to internal data structures.
SourceProvider
is the recommended core interface. SourceFunctionProvider
in flink-table-api-java-bridge
and InputFormatProvider
are available for
backwards compatibility.
getScanRuntimeProvider
in interface ScanTableSource
SourceProvider
protected abstract InputFormat<RowData,?> getInputFormat()
public LookupTableSource.LookupRuntimeProvider getLookupRuntimeProvider(LookupTableSource.LookupContext context)
LookupTableSource
There exist different interfaces for runtime implementation which is why LookupTableSource.LookupRuntimeProvider
serves as the base interface.
Independent of the provider interface, a source implementation can work on either
arbitrary objects or internal data structures (see org.apache.flink.table.data
for
more information).
The given LookupTableSource.LookupContext
offers utilities by the planner for creating runtime
implementation with minimal dependencies to internal data structures.
getLookupRuntimeProvider
in interface LookupTableSource
LookupFunctionProvider
,
AsyncLookupFunctionProvider
public boolean supportsNestedProjection()
SupportsProjectionPushDown
supportsNestedProjection
in interface SupportsProjectionPushDown
public void applyProjection(int[][] projectedFields, DataType producedDataType)
SupportsProjectionPushDown
SupportsProjectionPushDown.supportsNestedProjection()
.
In the example mentioned in SupportsProjectionPushDown
, this method would receive:
[[2], [1]]
which is equivalent to [["s"], ["r"]]
if SupportsProjectionPushDown.supportsNestedProjection()
returns false.
[[2], [1, 0]]
which is equivalent to [["s"], ["r", "d"]]]
if SupportsProjectionPushDown.supportsNestedProjection()
returns true.
Note: Use the passed data type instead of ResolvedSchema.toPhysicalRowDataType()
for describing the final output data type when creating TypeInformation
.
applyProjection
in interface SupportsProjectionPushDown
projectedFields
- field index paths of all fields that must be present in the physically
produced dataproducedDataType
- the final output type of the source, with the projection appliedpublic ChangelogMode getChangelogMode()
ScanTableSource
getChangelogMode
in interface ScanTableSource
RowKind
public String asSummaryString()
DynamicTableSource
asSummaryString
in interface DynamicTableSource
@VisibleForTesting public HBaseTableSchema getHBaseTableSchema()
@VisibleForTesting public int getMaxRetryTimes()
@VisibleForTesting @Nullable public LookupCache getCache()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.