public class PulsarSerializationSchemaWrapper<T> extends Object implements PulsarSerializationSchema<T>, PulsarContextAware<T>
SerializationSchema to PulsarSerializationSchema.| Modifier and Type | Class and Description |
|---|---|
static class |
PulsarSerializationSchemaWrapper.Builder<T>
Builder for
PulsarSerializationSchemaWrapper. |
| Modifier and Type | Method and Description |
|---|---|
org.apache.flink.api.common.typeinfo.TypeInformation<T> |
getProducedType() |
org.apache.pulsar.client.api.Schema<T> |
getSchema() |
Optional<String> |
getTargetTopic(T element)
Returns the topic that the presented element should be sent to.
|
void |
open(org.apache.flink.api.common.serialization.SerializationSchema.InitializationContext context)
Initialization method for the schema.
|
void |
serialize(T element,
org.apache.pulsar.client.api.TypedMessageBuilder<T> messageBuilder)
Serializes the incoming element to a specified type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetNumParallelInstances, setParallelInstanceIdpublic org.apache.flink.api.common.typeinfo.TypeInformation<T> getProducedType()
getProducedType in interface org.apache.flink.api.java.typeutils.ResultTypeQueryable<T>public Optional<String> getTargetTopic(T element)
PulsarContextAwaregetTargetTopic in interface PulsarContextAware<T>public void serialize(T element, org.apache.pulsar.client.api.TypedMessageBuilder<T> messageBuilder)
PulsarSerializationSchemaserialize in interface PulsarSerializationSchema<T>element - The incoming element to be serializedpublic void open(org.apache.flink.api.common.serialization.SerializationSchema.InitializationContext context)
throws Exception
PulsarSerializationSchemaPulsarSerializationSchema.serialize(Object, TypedMessageBuilder) and thus suitable for one time setup work.
The provided SerializationSchema.InitializationContext can be used to access additional features such as e.g.
registering user metrics.
open in interface PulsarSerializationSchema<T>context - Contextual information that can be used during initialization.Exceptionpublic org.apache.pulsar.client.api.Schema<T> getSchema()
getSchema in interface PulsarContextAware<T>Copyright © 2019–2022 The Apache Software Foundation. All rights reserved.