@Internal public class PulsarSerializationSchemaWrapper<IN> extends Object implements PulsarSerializationSchema<IN>
Constructor and Description |
---|
PulsarSerializationSchemaWrapper(SerializationSchema<IN> serializationSchema) |
Modifier and Type | Method and Description |
---|---|
void |
open(SerializationSchema.InitializationContext initializationContext,
PulsarSinkContext sinkContext,
SinkConfiguration sinkConfiguration)
Initialization method for the schema.
|
PulsarMessage<?> |
serialize(IN element,
PulsarSinkContext sinkContext)
Serializes the given element into bytes and
Schema.BYTES . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
flinkSchema, pulsarSchema, pulsarSchema, pulsarSchema
public PulsarSerializationSchemaWrapper(SerializationSchema<IN> serializationSchema)
public void open(SerializationSchema.InitializationContext initializationContext, PulsarSinkContext sinkContext, SinkConfiguration sinkConfiguration) throws Exception
PulsarSerializationSchema
PulsarSerializationSchema.serialize(Object, PulsarSinkContext)
and thus suitable for one-time setup work.
The provided SerializationSchema.InitializationContext
can be used to access additional features such
as registering user metrics.
open
in interface PulsarSerializationSchema<IN>
initializationContext
- Contextual information that can be used during initialization.sinkContext
- Runtime information i.e. partitions, subtaskId.sinkConfiguration
- All the configure options for the Pulsar sink. You can add custom
options.Exception
public PulsarMessage<?> serialize(IN element, PulsarSinkContext sinkContext)
PulsarSerializationSchema
Schema.BYTES
. Or you can convert it to a
new type of instance with a Schema
. The return value PulsarMessage
can be
built by PulsarMessageBuilder
. All the methods provided in the PulsarMessageBuilder
is just equals to the TypedMessageBuilder
.serialize
in interface PulsarSerializationSchema<IN>
element
- Element to be serialized.sinkContext
- Context to provide extra information.Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.