Class JSONKeyValueDeserializationSchema

java.lang.Object
org.apache.flink.streaming.util.serialization.JSONKeyValueDeserializationSchema
All Implemented Interfaces:
Serializable, org.apache.flink.api.java.typeutils.ResultTypeQueryable<com.fasterxml.jackson.databind.node.ObjectNode>, KafkaDeserializationSchema<com.fasterxml.jackson.databind.node.ObjectNode>

@PublicEvolving @Deprecated public class JSONKeyValueDeserializationSchema extends Object implements KafkaDeserializationSchema<com.fasterxml.jackson.databind.node.ObjectNode>
Deprecated.
DeserializationSchema that deserializes a JSON String into an 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).

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    JSONKeyValueDeserializationSchema(boolean includeMetadata)
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.fasterxml.jackson.databind.node.ObjectNode
    deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record)
    Deprecated.
    Deserializes the Kafka record.
    org.apache.flink.api.common.typeinfo.TypeInformation<com.fasterxml.jackson.databind.node.ObjectNode>
    Deprecated.
     
    boolean
    isEndOfStream(com.fasterxml.jackson.databind.node.ObjectNode nextElement)
    Deprecated.
    Method to decide whether the element signals the end of the stream.
    void
    open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context)
    Deprecated.
    Initialization method for the schema.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.flink.streaming.connectors.kafka.KafkaDeserializationSchema

    deserialize
  • Constructor Details

    • JSONKeyValueDeserializationSchema

      public JSONKeyValueDeserializationSchema(boolean includeMetadata)
      Deprecated.
  • Method Details

    • open

      public void open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context) throws Exception
      Deprecated.
      Description copied from interface: KafkaDeserializationSchema
      Initialization method for the schema. It is called before the actual working methods KafkaDeserializationSchema.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.

      Specified by:
      open in interface KafkaDeserializationSchema<com.fasterxml.jackson.databind.node.ObjectNode>
      Parameters:
      context - Contextual information that can be used during initialization.
      Throws:
      Exception
    • deserialize

      public com.fasterxml.jackson.databind.node.ObjectNode deserialize(org.apache.kafka.clients.consumer.ConsumerRecord<byte[],byte[]> record) throws Exception
      Deprecated.
      Description copied from interface: KafkaDeserializationSchema
      Deserializes the Kafka record.
      Specified by:
      deserialize in interface KafkaDeserializationSchema<com.fasterxml.jackson.databind.node.ObjectNode>
      Parameters:
      record - Kafka record to be deserialized.
      Returns:
      The deserialized message as an object (null if the message cannot be deserialized).
      Throws:
      Exception
    • isEndOfStream

      public boolean isEndOfStream(com.fasterxml.jackson.databind.node.ObjectNode nextElement)
      Deprecated.
      Description copied from interface: KafkaDeserializationSchema
      Method to decide whether the element signals the end of the stream. If true is returned the element won't be emitted.
      Specified by:
      isEndOfStream in interface KafkaDeserializationSchema<com.fasterxml.jackson.databind.node.ObjectNode>
      Parameters:
      nextElement - The element to test for the end-of-stream signal.
      Returns:
      True, if the element signals end of stream, false otherwise.
    • getProducedType

      public org.apache.flink.api.common.typeinfo.TypeInformation<com.fasterxml.jackson.databind.node.ObjectNode> getProducedType()
      Deprecated.
      Specified by:
      getProducedType in interface org.apache.flink.api.java.typeutils.ResultTypeQueryable<com.fasterxml.jackson.databind.node.ObjectNode>