Class FlussMetaDataApplier
- java.lang.Object
-
- org.apache.flink.cdc.connectors.fluss.sink.FlussMetaDataApplier
-
- All Implemented Interfaces:
Serializable,AutoCloseable,ExistingTableSchemaExpansionSupport,MetadataApplier
public class FlussMetaDataApplier extends Object implements MetadataApplier, ExistingTableSchemaExpansionSupport
MetadataApplierfor fluss.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsSchemaEvolutionType(SchemaChangeEventType schemaChangeEventType)Checks if this metadata applier should this event type.voidapplySchemaChange(SchemaChangeEvent schemaChangeEvent)Apply the givenSchemaChangeEventto external systems.Optional<Schema>getExistingTableSchema(TableId tableId)Returns the current schema of the target table, orOptional.empty()if the table does not exist.Optional<ExistingTableSchemaExpansionSupport>getExistingTableSchemaExpansionSupport()Returns optional support for safely expanding an existing target table schema.Set<SchemaChangeEventType>getSupportedSchemaEvolutionTypes()Checks what kind of schema change events downstream can handle.booleanisColumnNameCaseSensitive()Returns whether target column names are matched case-sensitively.DataTypenormalizeToTargetDataType(TableId tableId, String columnName, DataType pipelineDataType, Schema existingTargetSchema)Converts a pipeline type to the canonical CDC representation of the physical type that this applier will create in the existing target table.MetadataAppliersetAcceptedSchemaEvolutionTypes(Set<SchemaChangeEventType> schemaEvolutionTypes)Sets enabled schema evolution event types of current metadata applier.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.cdc.common.sink.MetadataApplier
close
-
-
-
-
Method Detail
-
setAcceptedSchemaEvolutionTypes
public MetadataApplier setAcceptedSchemaEvolutionTypes(Set<SchemaChangeEventType> schemaEvolutionTypes)
Description copied from interface:MetadataApplierSets enabled schema evolution event types of current metadata applier.- Specified by:
setAcceptedSchemaEvolutionTypesin interfaceMetadataApplier
-
acceptsSchemaEvolutionType
public boolean acceptsSchemaEvolutionType(SchemaChangeEventType schemaChangeEventType)
Description copied from interface:MetadataApplierChecks if this metadata applier should this event type.- Specified by:
acceptsSchemaEvolutionTypein interfaceMetadataApplier
-
getSupportedSchemaEvolutionTypes
public Set<SchemaChangeEventType> getSupportedSchemaEvolutionTypes()
Description copied from interface:MetadataApplierChecks what kind of schema change events downstream can handle.- Specified by:
getSupportedSchemaEvolutionTypesin interfaceMetadataApplier
-
getExistingTableSchemaExpansionSupport
public Optional<ExistingTableSchemaExpansionSupport> getExistingTableSchemaExpansionSupport()
Description copied from interface:MetadataApplierReturns optional support for safely expanding an existing target table schema.- Specified by:
getExistingTableSchemaExpansionSupportin interfaceMetadataApplier
-
getExistingTableSchema
public Optional<Schema> getExistingTableSchema(TableId tableId)
Description copied from interface:ExistingTableSchemaExpansionSupportReturns the current schema of the target table, orOptional.empty()if the table does not exist. Target physical types must be converted to the same canonical CDC representation produced byExistingTableSchemaExpansionSupport.normalizeToTargetDataType(TableId, String, DataType, Schema). The returned schema should include any table options that affect physical type mapping.- Specified by:
getExistingTableSchemain interfaceExistingTableSchemaExpansionSupport
-
normalizeToTargetDataType
public DataType normalizeToTargetDataType(TableId tableId, String columnName, DataType pipelineDataType, Schema existingTargetSchema)
Description copied from interface:ExistingTableSchemaExpansionSupportConverts a pipeline type to the canonical CDC representation of the physical type that this applier will create in the existing target table. For example, if bothCHAR(n)andVARCHAR(n)map to targetVARCHAR(n), this method should return the sameVARCHAR(n)representation for both input types. The existing target schema provides table options needed by sinks whose type mapping depends on table properties.This method must not query or modify the target table.
- Specified by:
normalizeToTargetDataTypein interfaceExistingTableSchemaExpansionSupport
-
isColumnNameCaseSensitive
public boolean isColumnNameCaseSensitive()
Description copied from interface:ExistingTableSchemaExpansionSupportReturns whether target column names are matched case-sensitively.- Specified by:
isColumnNameCaseSensitivein interfaceExistingTableSchemaExpansionSupport
-
applySchemaChange
public void applySchemaChange(SchemaChangeEvent schemaChangeEvent)
Description copied from interface:MetadataApplierApply the givenSchemaChangeEventto external systems.- Specified by:
applySchemaChangein interfaceMetadataApplier
-
-