@PublicEvolving public class JSONKeyValueDeserializationSchema extends Object implements KafkaDeserializationSchema<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode>
Key fields can be accessed by calling objectNode.get("key").get(<name>).as(<type>)
Value fields can be accessed by calling objectNode.get("value").get(<name>).as(<type>)
Metadata fields can be accessed by calling objectNode.get("metadata").get(<name>).as(<type>) and include the "offset" (long), "topic" (String) and "partition" (int).
| 构造器和说明 |
|---|
JSONKeyValueDeserializationSchema(boolean includeMetadata) |
| 限定符和类型 | 方法和说明 |
|---|---|
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode |
deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record)
Deserializes the Kafka record.
|
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode> |
getProducedType() |
boolean |
isEndOfStream(org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeserializepublic JSONKeyValueDeserializationSchema(boolean includeMetadata)
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<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode>context - Contextual information that can be used during initialization.Exceptionpublic org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record)
throws Exception
KafkaDeserializationSchemadeserialize 在接口中 KafkaDeserializationSchema<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode>record - Kafka record to be deserialized.Exceptionpublic boolean isEndOfStream(org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode nextElement)
KafkaDeserializationSchemaisEndOfStream 在接口中 KafkaDeserializationSchema<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode>nextElement - The element to test for the end-of-stream signal.public org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode> getProducedType()
getProducedType 在接口中 org.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode>Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.