Skip to content

Commit 92c0377

Browse files
committed
add kingbase connector
1 parent 7350944 commit 92c0377

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

flink-cdc-connect/flink-cdc-source-connectors/flink-connector-kingbase-cdc/src/main/java/io/debezium/connector/postgresql/PostgresObjectUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static PostgresSchema newSchema(
4747
PostgresConnectorConfig config,
4848
TypeRegistry typeRegistry,
4949
TopicSelector<TableId> topicSelector,
50-
PostgresValueConverter valueConverter)
50+
KingBaseValueConverter valueConverter)
5151
throws SQLException {
5252
PostgresSchema schema =
5353
new PostgresSchema(
@@ -81,7 +81,7 @@ public static PostgresEventMetadataProvider newEventMetadataProvider() {
8181
public static PostgresConnection.PostgresValueConverterBuilder newPostgresValueConverterBuilder(
8282
PostgresConnectorConfig config) {
8383
return typeRegistry ->
84-
PostgresValueConverter.of(config, StandardCharsets.UTF_8, typeRegistry);
84+
KingBaseValueConverter.of(config, StandardCharsets.UTF_8, typeRegistry);
8585
}
8686

8787
// modified from

flink-cdc-connect/flink-cdc-source-connectors/flink-connector-kingbase-cdc/src/main/java/io/debezium/connector/postgresql/connection/PostgresConnection.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
import io.debezium.DebeziumException;
1111
import io.debezium.annotation.VisibleForTesting;
1212
import io.debezium.config.Configuration;
13+
import io.debezium.connector.postgresql.KingBaseValueConverter;
1314
import io.debezium.connector.postgresql.PgOid;
1415
import io.debezium.connector.postgresql.PostgresConnectorConfig;
1516
import io.debezium.connector.postgresql.PostgresSchema;
1617
import io.debezium.connector.postgresql.PostgresType;
17-
import io.debezium.connector.postgresql.PostgresValueConverter;
1818
import io.debezium.connector.postgresql.TypeRegistry;
1919
import io.debezium.connector.postgresql.spi.SlotState;
2020
import io.debezium.data.SpecialValueDecimal;
@@ -117,11 +117,11 @@ public class PostgresConnection extends JdbcConnection {
117117
/**
118118
* Creates a Postgres connection using the supplied configuration. If necessary this connection
119119
* is able to resolve data type mappings. Such a connection requires a {@link
120-
* PostgresValueConverter}, and will provide its own {@link TypeRegistry}. Usually only one such
120+
* KingBaseValueConverter}, and will provide its own {@link TypeRegistry}. Usually only one such
121121
* connection per connector is needed.
122122
*
123123
* @param config {@link Configuration} instance, may not be null.
124-
* @param valueConverterBuilder supplies a configured {@link PostgresValueConverter} for a given
124+
* @param valueConverterBuilder supplies a configured {@link KingBaseValueConverter} for a given
125125
* {@link TypeRegistry}
126126
* @param connectionUsage a symbolic name of the connection to be tracked in monitoring tools
127127
*/
@@ -135,11 +135,11 @@ public PostgresConnection(
135135
/**
136136
* Creates a Postgres connection using the supplied configuration. If necessary this connection
137137
* is able to resolve data type mappings. Such a connection requires a {@link
138-
* PostgresValueConverter}, and will provide its own {@link TypeRegistry}. Usually only one such
138+
* KingBaseValueConverter}, and will provide its own {@link TypeRegistry}. Usually only one such
139139
* connection per connector is needed.
140140
*
141141
* @param config {@link Configuration} instance, may not be null.
142-
* @param valueConverterBuilder supplies a configured {@link PostgresValueConverter} for a given
142+
* @param valueConverterBuilder supplies a configured {@link KingBaseValueConverter} for a given
143143
* {@link TypeRegistry}
144144
* @param connectionUsage a symbolic name of the connection to be tracked in monitoring tools
145145
*/
@@ -163,7 +163,7 @@ public PostgresConnection(
163163
} else {
164164
this.typeRegistry = new TypeRegistry(this);
165165

166-
final PostgresValueConverter valueConverter =
166+
final KingBaseValueConverter valueConverter =
167167
valueConverterBuilder.build(this.typeRegistry);
168168
this.defaultValueConverter =
169169
new PostgresDefaultValueConverter(valueConverter, this.getTimestampUtils());
@@ -191,8 +191,8 @@ public PostgresConnection(
191191
this.defaultValueConverter = null;
192192
} else {
193193
this.typeRegistry = typeRegistry;
194-
final PostgresValueConverter valueConverter =
195-
PostgresValueConverter.of(config, this.getDatabaseCharset(), typeRegistry);
194+
final KingBaseValueConverter valueConverter =
195+
KingBaseValueConverter.of(config, this.getDatabaseCharset(), typeRegistry);
196196
this.defaultValueConverter =
197197
new PostgresDefaultValueConverter(valueConverter, this.getTimestampUtils());
198198
}
@@ -807,7 +807,7 @@ public <T extends DatabaseSchema<TableId>> Object getColumnValue(
807807
return s;
808808
}
809809

810-
Optional<SpecialValueDecimal> value = PostgresValueConverter.toSpecialValue(s);
810+
Optional<SpecialValueDecimal> value = KingBaseValueConverter.toSpecialValue(s);
811811
return value.isPresent()
812812
? value.get()
813813
: new SpecialValueDecimal(rs.getBigDecimal(columnIndex));
@@ -867,6 +867,6 @@ public Set<TableId> getAllTableIds(String catalogName) throws SQLException {
867867

868868
@FunctionalInterface
869869
public interface PostgresValueConverterBuilder {
870-
PostgresValueConverter build(TypeRegistry registry);
870+
KingBaseValueConverter build(TypeRegistry registry);
871871
}
872872
}

0 commit comments

Comments
 (0)