Interface KinesisDeserializationSchema<T>

  • Type Parameters:
    T - The type created by the keyed deserialization schema.
    All Superinterfaces:
    org.apache.flink.api.java.typeutils.ResultTypeQueryable<T>, Serializable
    All Known Implementing Classes:
    DynamoDBStreamsSchema, KinesisDeserializationSchemaWrapper, RowDataKinesisDeserializationSchema

    @PublicEvolving
    public interface KinesisDeserializationSchema<T>
    extends Serializable, org.apache.flink.api.java.typeutils.ResultTypeQueryable<T>
    This is a deserialization schema specific for the Flink Kinesis Consumer. Different from the basic DeserializationSchema, this schema offers additional Kinesis-specific information about the record that may be useful to the user application.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      T deserialize​(byte[] recordValue, String partitionKey, String seqNum, long approxArrivalTimestamp, String stream, String shardId)
      Deserializes a Kinesis record's bytes.
      default void open​(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context)
      Initialization method for the schema.
      • Methods inherited from interface org.apache.flink.api.java.typeutils.ResultTypeQueryable

        getProducedType
    • Method Detail

      • open

        default void open​(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context)
                   throws Exception
        Initialization method for the schema. It is called before the actual working methods deserialize(byte[], java.lang.String, java.lang.String, long, java.lang.String, java.lang.String) 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.

        Parameters:
        context - Contextual information that can be used during initialization.
        Throws:
        Exception
      • deserialize

        T deserialize​(byte[] recordValue,
                      String partitionKey,
                      String seqNum,
                      long approxArrivalTimestamp,
                      String stream,
                      String shardId)
               throws IOException
        Deserializes a Kinesis record's bytes. If the record cannot be deserialized, null may be returned. This informs the Flink Kinesis Consumer to process the Kinesis record without producing any output for it, i.e. effectively "skipping" the record.
        Parameters:
        recordValue - the record's value as a byte array
        partitionKey - the record's partition key at the time of writing
        seqNum - the sequence number of this record in the Kinesis shard
        approxArrivalTimestamp - the server-side timestamp of when Kinesis received and stored the record
        stream - the name of the Kinesis stream that this record was sent to
        shardId - The identifier of the shard the record was sent to
        Returns:
        the deserialized message as an Java object (null if the message cannot be deserialized).
        Throws:
        IOException