public class CanalJsonDecodingFormat extends Object implements ProjectableDecodingFormat<DeserializationSchema<RowData>>
DecodingFormat
for Canal using JSON encoding.Constructor and Description |
---|
CanalJsonDecodingFormat(String database,
String table,
boolean ignoreParseErrors,
TimestampFormat timestampFormat) |
Modifier and Type | Method and Description |
---|---|
void |
applyReadableMetadata(List<String> metadataKeys)
Provides a list of metadata keys that the produced row must contain as appended metadata
columns.
|
DeserializationSchema<RowData> |
createRuntimeDecoder(DynamicTableSource.Context context,
DataType physicalDataType,
int[][] projections)
Creates runtime decoder implementation that is configured to produce data of type
Projection.of(projections).project(physicalDataType) . |
ChangelogMode |
getChangelogMode()
Returns the set of changes that a connector (and transitively the planner) can expect during
runtime.
|
Map<String,DataType> |
listReadableMetadata()
Returns the map of metadata keys and their corresponding data types that can be produced by
this format for reading.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createRuntimeDecoder, supportsNestedProjection
public CanalJsonDecodingFormat(String database, String table, boolean ignoreParseErrors, TimestampFormat timestampFormat)
public DeserializationSchema<RowData> createRuntimeDecoder(DynamicTableSource.Context context, DataType physicalDataType, int[][] projections)
ProjectableDecodingFormat
Projection.of(projections).project(physicalDataType)
. For more details on the usage, check
DecodingFormat
documentation.createRuntimeDecoder
in interface ProjectableDecodingFormat<DeserializationSchema<RowData>>
context
- the context provides several utilities required to instantiate the runtime
decoder implementation of the formatphysicalDataType
- For more details check DecodingFormat
projections
- the projections array. The array represents the mapping of the fields of
the original DataType
, including nested rows. For example, [[0, 2, 1],
...]
specifies to include the 2nd field of the 3rd field of the 1st field in the
top-level row. It's guaranteed that this array won't contain nested projections if ProjectableDecodingFormat.supportsNestedProjection()
returns false
. For more details, check Projection
as well.DecodingFormat
public Map<String,DataType> listReadableMetadata()
DecodingFormat
Metadata columns add additional columns to the table's schema. A decoding format is responsible to add requested metadata columns at the end of produced rows.
See SupportsReadingMetadata
for more information.
Note: This method is only used if the outer DynamicTableSource
implements SupportsReadingMetadata
and calls this method in SupportsReadingMetadata.listReadableMetadata()
.
listReadableMetadata
in interface DecodingFormat<DeserializationSchema<RowData>>
public void applyReadableMetadata(List<String> metadataKeys)
DecodingFormat
See SupportsReadingMetadata
for more information.
Note: This method is only used if the outer DynamicTableSource
implements SupportsReadingMetadata
and calls this method in SupportsReadingMetadata.applyReadableMetadata(List, DataType)
.
applyReadableMetadata
in interface DecodingFormat<DeserializationSchema<RowData>>
public ChangelogMode getChangelogMode()
Format
getChangelogMode
in interface Format
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.