T - The type created by the deserialization schema.@Internal public class KafkaDeserializationSchemaWrapper<T> extends Object implements KafkaDeserializationSchema<T>
| 构造器和说明 |
|---|
KafkaDeserializationSchemaWrapper(org.apache.flink.api.common.serialization.DeserializationSchema<T> deserializationSchema) |
| 限定符和类型 | 方法和说明 |
|---|---|
T |
deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record)
Deserializes the Kafka record.
|
void |
deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> message,
org.apache.flink.util.Collector<T> out)
Deserializes the Kafka record.
|
org.apache.flink.api.common.typeinfo.TypeInformation<T> |
getProducedType() |
boolean |
isEndOfStream(T nextElement)
Method to decide whether the element signals the end of the stream.
|
void |
open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context)
Initialization method for the schema.
|
public KafkaDeserializationSchemaWrapper(org.apache.flink.api.common.serialization.DeserializationSchema<T> deserializationSchema)
public void open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context)
throws Exception
KafkaDeserializationSchemaKafkaDeserializationSchema.deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]>) 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 在接口中 KafkaDeserializationSchema<T>context - Contextual information that can be used during initialization.Exceptionpublic T deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record) throws Exception
KafkaDeserializationSchemadeserialize 在接口中 KafkaDeserializationSchema<T>record - Kafka record to be deserialized.Exceptionpublic void deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> message,
org.apache.flink.util.Collector<T> out)
throws Exception
KafkaDeserializationSchemaCan output multiple records through 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 在接口中 KafkaDeserializationSchema<T>message - The message, as a byte array.out - The collector to put the resulting messages.Exceptionpublic boolean isEndOfStream(T nextElement)
KafkaDeserializationSchemaisEndOfStream 在接口中 KafkaDeserializationSchema<T>nextElement - The element to test for the end-of-stream signal.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.