Interface KinesisDeserializationSchema<T>
-
- Type Parameters:
T- The type created by the deserialization schema.
- All Superinterfaces:
org.apache.flink.api.java.typeutils.ResultTypeQueryable<T>,Serializable
@PublicEvolving public interface KinesisDeserializationSchema<T> extends Serializable, org.apache.flink.api.java.typeutils.ResultTypeQueryable<T>
This is a deserialization schema specific for theKinesisStreamsSource. Different from the basicDeserializationSchema, this schema offers additional Kinesis-specific information about the record that may be useful to the user application.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddeserialize(software.amazon.awssdk.services.kinesis.model.Record record, String stream, String shardId, org.apache.flink.util.Collector<T> output)Deserializes a Kinesis record.static <T> KinesisDeserializationSchema<T>of(org.apache.flink.api.common.serialization.DeserializationSchema<T> deserializationSchema)default voidopen(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context)Initialization method for the schema.
-
-
-
Method Detail
-
open
default void open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context) throws ExceptionInitialization method for the schema. It is called before the actual working methodsdeserialize(software.amazon.awssdk.services.kinesis.model.Record, java.lang.String, java.lang.String, org.apache.flink.util.Collector<T>)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.- Parameters:
context- Contextual information that can be used during initialization.- Throws:
Exception
-
deserialize
void deserialize(software.amazon.awssdk.services.kinesis.model.Record record, String stream, String shardId, org.apache.flink.util.Collector<T> output) throws IOExceptionDeserializes a Kinesis record. 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.- Parameters:
record- the Kinesis record to deserializestream- the ARN of the Kinesis stream that this record was sent toshardId- the identifier of the shard the record was sent tooutput- the identifier of the shard the record was sent to- Throws:
IOException- exception when deserializing record
-
of
static <T> KinesisDeserializationSchema<T> of(org.apache.flink.api.common.serialization.DeserializationSchema<T> deserializationSchema)
-
-