Class RowDataKinesisDeserializationSchema
- java.lang.Object
-
- org.apache.flink.streaming.connectors.kinesis.table.RowDataKinesisDeserializationSchema
-
- All Implemented Interfaces:
Serializable,org.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.table.data.RowData>,KinesisDeserializationSchema<org.apache.flink.table.data.RowData>
@Internal public final class RowDataKinesisDeserializationSchema extends Object implements KinesisDeserializationSchema<org.apache.flink.table.data.RowData>
AKinesisDeserializationSchemaadaptor forRowDatarecords that delegates physical data deserialization to an innerDeserializationSchemaand appends requested metadata to the end of the deserializedRowDatarecord.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classRowDataKinesisDeserializationSchema.MetadataInternal type for enumerating available metadata.
-
Constructor Summary
Constructors Constructor Description RowDataKinesisDeserializationSchema(org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData> physicalDeserializer, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> producedTypeInfo, List<RowDataKinesisDeserializationSchema.Metadata> requestedMetadataFields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.table.data.RowDatadeserialize(byte[] recordValue, String partitionKey, String seqNum, long approxArrivalTimestamp, String stream, String shardId)Deserializes a Kinesis record's bytes.org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData>getProducedType()voidopen(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context)Initialization method for the schema.
-
-
-
Constructor Detail
-
RowDataKinesisDeserializationSchema
public RowDataKinesisDeserializationSchema(org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData> physicalDeserializer, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> producedTypeInfo, List<RowDataKinesisDeserializationSchema.Metadata> requestedMetadataFields)
-
-
Method Detail
-
open
public void open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context) throws ExceptionDescription copied from interface:KinesisDeserializationSchemaInitialization method for the schema. It is called before the actual working methodsKinesisDeserializationSchema.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.InitializationContextcan be used to access additional features such as e.g. registering user metrics.- Specified by:
openin interfaceKinesisDeserializationSchema<org.apache.flink.table.data.RowData>- Parameters:
context- Contextual information that can be used during initialization.- Throws:
Exception
-
deserialize
public org.apache.flink.table.data.RowData deserialize(byte[] recordValue, String partitionKey, String seqNum, long approxArrivalTimestamp, String stream, String shardId) throws IOExceptionDescription copied from interface:KinesisDeserializationSchemaDeserializes a Kinesis record's bytes. If the record cannot be deserialized,nullmay 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.- Specified by:
deserializein interfaceKinesisDeserializationSchema<org.apache.flink.table.data.RowData>- Parameters:
recordValue- the record's value as a byte arraypartitionKey- the record's partition key at the time of writingseqNum- the sequence number of this record in the Kinesis shardapproxArrivalTimestamp- the server-side timestamp of when Kinesis received and stored the recordstream- the name of the Kinesis stream that this record was sent toshardId- The identifier of the shard the record was sent to- Returns:
- the deserialized message as an Java object (
nullif the message cannot be deserialized). - Throws:
IOException
-
getProducedType
public org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> getProducedType()
- Specified by:
getProducedTypein interfaceorg.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.table.data.RowData>
-
-