public class PulsarTableDeserializationSchema extends Object implements PulsarDeserializationSchema<org.apache.flink.table.data.RowData>
PulsarDeserializationSchema for PulsarTableSource.
Both Flink's key decoding format and value decoding format are wrapped in this class. It is responsible for getting metadata fields from a physical pulsar message body, and the final projection mapping from Pulsar message fields to Flink row.
After retrieving key and value bytes and convert them into a list of RowData, it then
delegates metadata appending, key and value RowData combining to a PulsarRowDataConverter instance.
| Constructor and Description |
|---|
PulsarTableDeserializationSchema(org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData> keyDeserialization,
org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData> valueDeserialization,
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> producedTypeInfo,
PulsarRowDataConverter rowDataConverter) |
| Modifier and Type | Method and Description |
|---|---|
void |
deserialize(org.apache.pulsar.client.api.Message<?> message,
org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> collector)
Deserializes the pulsar message.
|
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> |
getProducedType() |
void |
open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context,
SourceConfiguration configuration)
Initialization method for the schema.
|
org.apache.pulsar.client.api.Schema<?> |
schema()
By default, deserializers will decode bytes array message.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitflinkSchema, flinkTypeInfo, open, pulsarSchema, pulsarSchema, pulsarSchemapublic PulsarTableDeserializationSchema(@Nullable org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData> keyDeserialization, org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData> valueDeserialization, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> producedTypeInfo, PulsarRowDataConverter rowDataConverter)
public void open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context,
SourceConfiguration configuration)
throws Exception
PulsarDeserializationSchemaPulsarDeserializationSchema.deserialize(org.apache.pulsar.client.api.Message<?>, org.apache.flink.util.Collector<T>) and thus suitable for one time setup work.
The provided DeserializationSchema.InitializationContext can be used to access additional features such
as e.g. registering user metrics.
open in interface PulsarDeserializationSchema<org.apache.flink.table.data.RowData>context - Contextual information that can be used during initialization.configuration - The Pulsar related source configuration.Exceptionpublic void deserialize(org.apache.pulsar.client.api.Message<?> message,
org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> collector)
throws IOException
PulsarDeserializationSchemaYou can output multiple message by using the Collector. Note that number and size
of the produced records should be relatively small. Depending on the source implementation
records can be buffered in memory or collecting records might delay emitting checkpoint
barrier.
deserialize in interface PulsarDeserializationSchema<org.apache.flink.table.data.RowData>message - The message decoded by pulsar.collector - The collector to put the resulting messages.IOExceptionpublic org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> getProducedType()
getProducedType in interface org.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.table.data.RowData>public org.apache.pulsar.client.api.Schema<?> schema()
PulsarDeserializationSchemaschema in interface PulsarDeserializationSchema<org.apache.flink.table.data.RowData>Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.