public class PulsarDynamicTableSource extends Object implements org.apache.flink.table.connector.source.ScanTableSource, SupportsReadingMetadata
| Modifier and Type | Class and Description |
|---|---|
static class |
PulsarDynamicTableSource.ReadableMetadata
readableMetadata for new table api.
|
| Modifier and Type | Field and Description |
|---|---|
protected String |
adminUrl
The Pulsar topic to consume.
|
protected org.apache.flink.table.connector.format.DecodingFormat<org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>> |
decodingFormat
Scan format for decoding records from Pulsar.
|
protected List<String> |
metadataKeys
Metadata that is appended at the end of a physical source row.
|
protected org.apache.flink.table.types.DataType |
physicalDataType
Data type to configure the format.
|
protected org.apache.flink.table.types.DataType |
producedDataType
Data type that describes the final output of the source.
|
protected Properties |
properties
Properties for the Pulsar consumer.
|
protected String |
serviceUrl
The Pulsar topic to consume.
|
protected PulsarTableOptions.StartupOptions |
startupOptions
The startup mode for the contained consumer (default is
StartupMode.LATEST). |
protected String |
topicPattern
The Pulsar topic to consume.
|
protected List<String> |
topics
The Pulsar topic to consume.
|
protected boolean |
useExtendField |
| Constructor and Description |
|---|
PulsarDynamicTableSource(org.apache.flink.table.types.DataType physicalDataType,
org.apache.flink.table.connector.format.DecodingFormat<org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>> decodingFormat,
List<String> topics,
String topicPattern,
String serviceUrl,
String adminUrl,
Properties properties,
PulsarTableOptions.StartupOptions startupOptions) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyReadableMetadata(List<String> metadataKeys,
org.apache.flink.table.types.DataType producedDataType)
Provides a list of metadata keys that the produced
RowData must contain as appended
metadata columns. |
String |
asSummaryString() |
org.apache.flink.table.connector.source.DynamicTableSource |
copy() |
boolean |
equals(Object o) |
org.apache.flink.table.connector.ChangelogMode |
getChangelogMode() |
org.apache.flink.table.connector.source.ScanTableSource.ScanRuntimeProvider |
getScanRuntimeProvider(org.apache.flink.table.connector.source.ScanTableSource.ScanContext runtimeProviderContext) |
int |
hashCode() |
Map<String,org.apache.flink.table.types.DataType> |
listReadableMetadata()
Returns the map of metadata keys and their corresponding data types that can be produced by this
table source for reading.
|
protected org.apache.flink.table.types.DataType producedDataType
protected final org.apache.flink.table.types.DataType physicalDataType
protected List<String> metadataKeys
protected final org.apache.flink.table.connector.format.DecodingFormat<org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>> decodingFormat
protected final String topicPattern
protected final String serviceUrl
protected final boolean useExtendField
protected final String adminUrl
protected final Properties properties
protected final PulsarTableOptions.StartupOptions startupOptions
StartupMode.LATEST).public PulsarDynamicTableSource(org.apache.flink.table.types.DataType physicalDataType,
org.apache.flink.table.connector.format.DecodingFormat<org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>> decodingFormat,
List<String> topics,
String topicPattern,
String serviceUrl,
String adminUrl,
Properties properties,
PulsarTableOptions.StartupOptions startupOptions)
public org.apache.flink.table.connector.ChangelogMode getChangelogMode()
getChangelogMode in interface org.apache.flink.table.connector.source.ScanTableSourcepublic org.apache.flink.table.connector.source.ScanTableSource.ScanRuntimeProvider getScanRuntimeProvider(org.apache.flink.table.connector.source.ScanTableSource.ScanContext runtimeProviderContext)
getScanRuntimeProvider in interface org.apache.flink.table.connector.source.ScanTableSourcepublic org.apache.flink.table.connector.source.DynamicTableSource copy()
copy in interface org.apache.flink.table.connector.source.DynamicTableSourcepublic String asSummaryString()
asSummaryString in interface org.apache.flink.table.connector.source.DynamicTableSourcepublic Map<String,org.apache.flink.table.types.DataType> listReadableMetadata()
SupportsReadingMetadataThe returned map will be used by the planner for validation and insertion of explicit casts
(see LogicalTypeCasts.supportsExplicitCast(LogicalType, LogicalType)) if necessary.
The iteration order of the returned map determines the order of metadata keys in the list
passed in SupportsReadingMetadata.applyReadableMetadata(List, DataType). Therefore, it might be beneficial to
return a LinkedHashMap if a strict metadata column order is required.
If a source forwards metadata from one or more formats, we recommend the following column order for consistency:
KEY FORMAT METADATA COLUMNS + VALUE FORMAT METADATA COLUMNS + SOURCE METADATA COLUMNS
Metadata key names follow the same pattern as mentioned in Factory. In case of duplicate
names in format and source keys, format keys shall have higher precedence.
Regardless of the returned DataTypes, a metadata column is always represented using
internal data structures (see RowData).
listReadableMetadata in interface SupportsReadingMetadatapublic void applyReadableMetadata(List<String> metadataKeys, org.apache.flink.table.types.DataType producedDataType)
SupportsReadingMetadataRowData must contain as appended
metadata columns.
Note: Use the passed data type instead of TableSchema.toPhysicalRowDataType() for
describing the final output data type when creating TypeInformation. If the source implements
SupportsProjectionPushDown, the projection is already considered in the given output
data type.
applyReadableMetadata in interface SupportsReadingMetadatametadataKeys - a subset of the keys returned by SupportsReadingMetadata.listReadableMetadata(), ordered
by the iteration order of returned mapproducedDataType - the final output type of the sourceCopyright © 2019–2021 The Apache Software Foundation. All rights reserved.