Class DebeziumJsonDeserializationSchema
- java.lang.Object
-
- org.apache.flink.formats.json.debezium.DebeziumJsonDeserializationSchema
-
- All Implemented Interfaces:
Serializable
,DeserializationSchema<RowData>
,ResultTypeQueryable<RowData>
@Internal public final class DebeziumJsonDeserializationSchema extends Object implements DeserializationSchema<RowData>
Deserialization schema from Debezium JSON to Flink Table/SQL internal data structureRowData
. The deserialization schema knows Debezium's schema definition and can extract the database data and convert intoRowData
withRowKind
.Deserializes a
byte[]
message as a JSON object and reads the specified fields.Failures during deserialization are forwarded as wrapped IOExceptions.
- See Also:
- Debezium, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.api.common.serialization.DeserializationSchema
DeserializationSchema.InitializationContext
-
-
Constructor Summary
Constructors Constructor Description DebeziumJsonDeserializationSchema(DataType physicalDataType, List<org.apache.flink.formats.json.debezium.DebeziumJsonDecodingFormat.ReadableMetadata> requestedMetadata, TypeInformation<RowData> producedTypeInfo, boolean schemaInclude, boolean ignoreParseErrors, TimestampFormat timestampFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RowData
deserialize(byte[] message)
Deserializes the byte message.void
deserialize(byte[] message, Collector<RowData> out)
Deserializes the byte message.boolean
equals(Object o)
TypeInformation<RowData>
getProducedType()
Gets the data type (as aTypeInformation
) produced by this function or input format.int
hashCode()
boolean
isEndOfStream(RowData nextElement)
Method to decide whether the element signals the end of the stream.void
open(DeserializationSchema.InitializationContext context)
Initialization method for the schema.
-
-
-
Constructor Detail
-
DebeziumJsonDeserializationSchema
public DebeziumJsonDeserializationSchema(DataType physicalDataType, List<org.apache.flink.formats.json.debezium.DebeziumJsonDecodingFormat.ReadableMetadata> requestedMetadata, TypeInformation<RowData> producedTypeInfo, boolean schemaInclude, boolean ignoreParseErrors, TimestampFormat timestampFormat)
-
-
Method Detail
-
open
public void open(DeserializationSchema.InitializationContext context) throws Exception
Description copied from interface:DeserializationSchema
Initialization method for the schema. It is called before the actual working methodsDeserializationSchema.deserialize(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 interfaceDeserializationSchema<RowData>
- Parameters:
context
- Contextual information that can be used during initialization.- Throws:
Exception
-
deserialize
public RowData deserialize(byte[] message)
Description copied from interface:DeserializationSchema
Deserializes the byte message.- Specified by:
deserialize
in interfaceDeserializationSchema<RowData>
- Parameters:
message
- The message, as a byte array.- Returns:
- The deserialized message as an object (null if the message cannot be deserialized).
-
deserialize
public void deserialize(byte[] message, Collector<RowData> out) throws IOException
Description copied from interface:DeserializationSchema
Deserializes the byte message.Can output multiple records through the
Collector
. Note that number and size of the produced records should be relatively small. Depending on the source implementation records can be buffered in memory or collecting records might delay emitting checkpoint barrier.- Specified by:
deserialize
in interfaceDeserializationSchema<RowData>
- Parameters:
message
- The message, as a byte array.out
- The collector to put the resulting messages.- Throws:
IOException
-
isEndOfStream
public boolean isEndOfStream(RowData nextElement)
Description copied from interface:DeserializationSchema
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 interfaceDeserializationSchema<RowData>
- 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 TypeInformation<RowData> getProducedType()
Description copied from interface:ResultTypeQueryable
Gets the data type (as aTypeInformation
) produced by this function or input format.- Specified by:
getProducedType
in interfaceResultTypeQueryable<RowData>
- Returns:
- The data type produced by this function or input format.
-
-