public class PulsarTableSource extends Object implements org.apache.flink.table.sources.StreamTableSource<org.apache.flink.types.Row>, org.apache.flink.table.sources.DefinedProctimeAttribute, org.apache.flink.table.sources.DefinedRowtimeAttributes, org.apache.flink.table.sources.DefinedFieldMapping, SupportsReadingMetadata
| Modifier and Type | Class and Description |
|---|---|
static class |
PulsarTableSource.ReadableMetadata
readable metadata in source.
|
| Modifier and Type | Field and Description |
|---|---|
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 org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> |
producedTypeInfo |
protected boolean |
useExtendField |
| Constructor and Description |
|---|
PulsarTableSource(Optional<org.apache.flink.table.api.TableSchema> providedSchema,
Optional<String> proctimeAttribute,
List<org.apache.flink.table.sources.RowtimeAttributeDescriptor> rowtimeAttributeDescriptors,
Optional<Map<String,String>> fieldMapping,
String serviceUrl,
String adminUrl,
Properties properties,
org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.types.Row> deserializationSchema,
StartupMode startupMode,
Map<String,org.apache.pulsar.client.api.MessageId> specificStartupOffsets,
String externalSubscriptionName) |
PulsarTableSource(String serviceUrl,
String adminUrl,
Properties properties) |
| 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. |
org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.types.Row> |
getDataStream(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment execEnv) |
PulsarDeserializationSchema<org.apache.flink.types.Row> |
getDeserializationSchema() |
Map<String,String> |
getFieldMapping() |
String |
getProctimeAttribute() |
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> |
getReturnType() |
List<org.apache.flink.table.sources.RowtimeAttributeDescriptor> |
getRowtimeAttributeDescriptors() |
org.apache.flink.table.api.TableSchema |
getTableSchema() |
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 List<String> metadataKeys
protected final boolean useExtendField
protected org.apache.flink.table.types.DataType producedDataType
protected final org.apache.flink.table.types.DataType physicalDataType
protected org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> producedTypeInfo
public PulsarTableSource(Optional<org.apache.flink.table.api.TableSchema> providedSchema, Optional<String> proctimeAttribute, List<org.apache.flink.table.sources.RowtimeAttributeDescriptor> rowtimeAttributeDescriptors, Optional<Map<String,String>> fieldMapping, String serviceUrl, String adminUrl, Properties properties, org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.types.Row> deserializationSchema, StartupMode startupMode, Map<String,org.apache.pulsar.client.api.MessageId> specificStartupOffsets, String externalSubscriptionName)
public PulsarTableSource(String serviceUrl, String adminUrl, Properties properties)
public String getProctimeAttribute()
getProctimeAttribute in interface org.apache.flink.table.sources.DefinedProctimeAttributepublic List<org.apache.flink.table.sources.RowtimeAttributeDescriptor> getRowtimeAttributeDescriptors()
getRowtimeAttributeDescriptors in interface org.apache.flink.table.sources.DefinedRowtimeAttributespublic org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> getReturnType()
getReturnType in interface org.apache.flink.table.sources.TableSource<org.apache.flink.types.Row>public org.apache.flink.table.api.TableSchema getTableSchema()
getTableSchema in interface org.apache.flink.table.sources.TableSource<org.apache.flink.types.Row>public Map<String,String> getFieldMapping()
getFieldMapping in interface org.apache.flink.table.sources.DefinedFieldMappingpublic org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.types.Row> getDataStream(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment execEnv)
getDataStream in interface org.apache.flink.table.sources.StreamTableSource<org.apache.flink.types.Row>public PulsarDeserializationSchema<org.apache.flink.types.Row> getDeserializationSchema()
public 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.