@PublicEvolving public class JSONKeyValueDeserializationSchema extends Object implements KeyedDeserializationSchema<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(byte[] messageKey,
byte[] message,
String topic,
int partition,
long offset)
Deserializes the byte message.
|
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(byte[] messageKey, byte[] message, String topic, int partition, long offset) throws IOException
KeyedDeserializationSchema
deserialize
in interface KeyedDeserializationSchema<org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode>
messageKey
- the key as a byte array (null if no key has been set).message
- The message, as a byte array (null if the message was empty or deleted).partition
- The partition the message has originated from.offset
- the offset of the message in the original source (for example the Kafka offset).IOException
public boolean isEndOfStream(org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode nextElement)
KeyedDeserializationSchema
isEndOfStream
in interface KeyedDeserializationSchema<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–2019 The Apache Software Foundation. All rights reserved.