public final class SocketDynamicTableSource extends Object implements ScanTableSource
SocketDynamicTableSource
is used during planning.
In our example, we don't implement any of the available ability interfaces such as SupportsFilterPushDown
or SupportsProjectionPushDown
. Therefore, the main logic can be
found in ScanTableSource.getScanRuntimeProvider(ScanContext)
where we instantiate the required SourceFunction
and its DeserializationSchema
for runtime. Both instances are
parameterized to return internal data structures (i.e. RowData
).
ScanTableSource.ScanContext, ScanTableSource.ScanRuntimeProvider
DynamicTableSource.Context, DynamicTableSource.DataStructureConverter
Constructor and Description |
---|
SocketDynamicTableSource(String hostname,
int port,
byte byteDelimiter,
DecodingFormat<DeserializationSchema<RowData>> decodingFormat,
DataType producedDataType) |
Modifier and Type | Method and Description |
---|---|
String |
asSummaryString()
Returns a string that summarizes this source for printing to a console or log.
|
DynamicTableSource |
copy()
Creates a copy of this instance during planning.
|
ChangelogMode |
getChangelogMode()
Returns the set of changes that the planner can expect during runtime.
|
ScanTableSource.ScanRuntimeProvider |
getScanRuntimeProvider(ScanTableSource.ScanContext runtimeProviderContext)
Returns a provider of runtime implementation for reading the data.
|
public SocketDynamicTableSource(String hostname, int port, byte byteDelimiter, DecodingFormat<DeserializationSchema<RowData>> decodingFormat, DataType producedDataType)
public ChangelogMode getChangelogMode()
ScanTableSource
getChangelogMode
in interface ScanTableSource
RowKind
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.
See org.apache.flink.table.connector.source.SourceFunctionProvider
in flink-table-api-java-bridge
.
getScanRuntimeProvider
in interface ScanTableSource
public DynamicTableSource copy()
DynamicTableSource
copy
in interface DynamicTableSource
public String asSummaryString()
DynamicTableSource
asSummaryString
in interface DynamicTableSource
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.