@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).
Constructor and Description |
---|
JSONKeyValueDeserializationSchema(boolean includeMetadata) |
Modifier and Type | Method and Description |
---|---|
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.
|
TypeInformation<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode> |
getProducedType()
Gets the data type (as a
TypeInformation ) produced by this function or input format. |
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.
|
public JSONKeyValueDeserializationSchema(boolean includeMetadata)
public org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record) throws Exception
KafkaDeserializationSchema
deserialize
in interface KafkaDeserializationSchema<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode>
record
- Kafka record to be deserialized.Exception
public boolean isEndOfStream(org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode nextElement)
KafkaDeserializationSchema
isEndOfStream
in interface KafkaDeserializationSchema<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode>
nextElement
- The element to test for the end-of-stream signal.public TypeInformation<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode> getProducedType()
ResultTypeQueryable
TypeInformation
) produced by this function or input format.getProducedType
in interface ResultTypeQueryable<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode>
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.