Class CanalJsonSerializationSchema
- java.lang.Object
-
- org.apache.flink.formats.json.canal.CanalJsonSerializationSchema
-
- All Implemented Interfaces:
Serializable
,SerializationSchema<RowData>
public class CanalJsonSerializationSchema extends Object implements SerializationSchema<RowData>
Serialization schema that serializes an object of Flink Table/SQL internal data structureRowData
into a Canal JSON bytes.- See Also:
- Alibaba Canal, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.api.common.serialization.SerializationSchema
SerializationSchema.InitializationContext
-
-
Constructor Summary
Constructors Constructor Description CanalJsonSerializationSchema(RowType rowType, TimestampFormat timestampFormat, JsonFormatOptions.MapNullKeyMode mapNullKeyMode, String mapNullKeyLiteral, boolean encodeDecimalAsPlainNumber, boolean ignoreNullFields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
void
open(SerializationSchema.InitializationContext context)
Initialization method for the schema.byte[]
serialize(RowData row)
Serializes the incoming element to a specified type.
-
-
-
Constructor Detail
-
CanalJsonSerializationSchema
public CanalJsonSerializationSchema(RowType rowType, TimestampFormat timestampFormat, JsonFormatOptions.MapNullKeyMode mapNullKeyMode, String mapNullKeyLiteral, boolean encodeDecimalAsPlainNumber, boolean ignoreNullFields)
-
-
Method Detail
-
open
public void open(SerializationSchema.InitializationContext context) throws Exception
Description copied from interface:SerializationSchema
Initialization method for the schema. It is called before the actual working methodsSerializationSchema.serialize(Object)
and thus suitable for one time setup work.The provided
SerializationSchema.InitializationContext
can be used to access additional features such as e.g. registering user metrics.- Specified by:
open
in interfaceSerializationSchema<RowData>
- Parameters:
context
- Contextual information that can be used during initialization.- Throws:
Exception
-
serialize
public byte[] serialize(RowData row)
Description copied from interface:SerializationSchema
Serializes the incoming element to a specified type.- Specified by:
serialize
in interfaceSerializationSchema<RowData>
- Parameters:
row
- The incoming element to be serialized- Returns:
- The serialized element.
-
-