public interface MessageDeserializer<T> extends Serializable, org.apache.flink.api.java.typeutils.ResultTypeQueryable<T>
| Modifier and Type | Method and Description |
|---|---|
void |
deserialize(org.apache.pulsar.client.api.Message<?> message,
org.apache.flink.util.Collector<T> collector)
Deserialize a consumer record into the given collector.
|
boolean |
isEndOfStream(T nextElement)
Method to decide whether the element signals the end of the stream.
|
default void |
open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context)
Initialization method for the schema.
|
static <V> MessageDeserializer<V> |
valueOnly(org.apache.flink.api.common.serialization.DeserializationSchema<V> valueDeserializer)
Wraps a Flink
DeserializationSchema to a MessageDeserializer. |
default void open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context)
throws Exception
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.
context - Contextual information that can be used during initialization.Exceptionvoid deserialize(org.apache.pulsar.client.api.Message<?> message,
org.apache.flink.util.Collector<T> collector)
throws IOException
message - the Message to deserialize.IOException - if the deserialization failed.boolean isEndOfStream(T nextElement)
nextElement - The element to test for the end-of-stream signal.static <V> MessageDeserializer<V> valueOnly(org.apache.flink.api.common.serialization.DeserializationSchema<V> valueDeserializer)
DeserializationSchema to a MessageDeserializer.V - the value type.valueDeserializer - the deserializer class used to deserialize the value.MessageDeserializer that deserialize the value with the given deserializer.Copyright © 2019–2021 The Apache Software Foundation. All rights reserved.