@@ -27,7 +27,6 @@ use risingwave_common::array::StreamChunk;
27
27
use risingwave_common:: catalog:: TableId ;
28
28
use risingwave_common:: error:: { ErrorSuppressor , RwError } ;
29
29
use risingwave_common:: types:: { JsonbVal , Scalar } ;
30
- use risingwave_pb:: connector_service:: PbTableSchema ;
31
30
use risingwave_pb:: source:: ConnectorSplit ;
32
31
use risingwave_rpc_client:: ConnectorClient ;
33
32
@@ -299,7 +298,7 @@ pub enum ConnectorProperties {
299
298
Nexmark ( Box < NexmarkProperties > ) ,
300
299
Datagen ( Box < DatagenProperties > ) ,
301
300
S3 ( Box < S3Properties > ) ,
302
- MySqlCdc ( Box < CdcProperties < Mysql > > ) ,
301
+ MysqlCdc ( Box < CdcProperties < Mysql > > ) ,
303
302
PostgresCdc ( Box < CdcProperties < Postgres > > ) ,
304
303
CitusCdc ( Box < CdcProperties < Citus > > ) ,
305
304
GooglePubsub ( Box < PubsubProperties > ) ,
@@ -308,51 +307,6 @@ pub enum ConnectorProperties {
308
307
}
309
308
310
309
impl ConnectorProperties {
311
- fn new_cdc_properties (
312
- connector_name : & str ,
313
- properties : HashMap < String , String > ,
314
- ) -> Result < Self > {
315
- match connector_name {
316
- MYSQL_CDC_CONNECTOR => Ok ( Self :: MySqlCdc ( Box :: new ( CdcProperties :: < Mysql > {
317
- props : properties,
318
- ..Default :: default ( )
319
- } ) ) ) ,
320
- POSTGRES_CDC_CONNECTOR => Ok ( Self :: PostgresCdc ( Box :: new ( CdcProperties :: < Postgres > {
321
- props : properties,
322
- ..Default :: default ( )
323
- } ) ) ) ,
324
- CITUS_CDC_CONNECTOR => Ok ( Self :: CitusCdc ( Box :: new ( CdcProperties :: < Citus > {
325
- props : properties,
326
- ..Default :: default ( )
327
- } ) ) ) ,
328
- _ => Err ( anyhow ! ( "unexpected cdc connector '{}'" , connector_name, ) ) ,
329
- }
330
- }
331
-
332
- pub fn init_cdc_properties ( & mut self , table_schema : PbTableSchema ) {
333
- match self {
334
- ConnectorProperties :: MySqlCdc ( c) => {
335
- c. table_schema = table_schema;
336
- }
337
- ConnectorProperties :: PostgresCdc ( c) => {
338
- c. table_schema = table_schema;
339
- }
340
- ConnectorProperties :: CitusCdc ( c) => {
341
- c. table_schema = table_schema;
342
- }
343
- _ => { }
344
- }
345
- }
346
-
347
- pub fn is_cdc_connector ( & self ) -> bool {
348
- matches ! (
349
- self ,
350
- ConnectorProperties :: MySqlCdc ( _)
351
- | ConnectorProperties :: PostgresCdc ( _)
352
- | ConnectorProperties :: CitusCdc ( _)
353
- )
354
- }
355
-
356
310
pub fn support_multiple_splits ( & self ) -> bool {
357
311
matches ! ( self , ConnectorProperties :: Kafka ( _) )
358
312
}
@@ -366,7 +320,7 @@ pub enum SplitImpl {
366
320
Nexmark ( NexmarkSplit ) ,
367
321
Datagen ( DatagenSplit ) ,
368
322
GooglePubsub ( PubsubSplit ) ,
369
- MySqlCdc ( DebeziumCdcSplit < Mysql > ) ,
323
+ MysqlCdc ( DebeziumCdcSplit < Mysql > ) ,
370
324
PostgresCdc ( DebeziumCdcSplit < Postgres > ) ,
371
325
CitusCdc ( DebeziumCdcSplit < Citus > ) ,
372
326
Nats ( NatsSplit ) ,
@@ -399,7 +353,7 @@ pub enum SplitReaderImpl {
399
353
Nexmark ( Box < NexmarkSplitReader > ) ,
400
354
Pulsar ( Box < PulsarSplitReader > ) ,
401
355
Datagen ( Box < DatagenSplitReader > ) ,
402
- MySqlCdc ( Box < CdcSplitReader < Mysql > > ) ,
356
+ MysqlCdc ( Box < CdcSplitReader < Mysql > > ) ,
403
357
PostgresCdc ( Box < CdcSplitReader < Postgres > > ) ,
404
358
CitusCdc ( Box < CdcSplitReader < Citus > > ) ,
405
359
GooglePubsub ( Box < PubsubSplitReader > ) ,
@@ -412,7 +366,7 @@ pub enum SplitEnumeratorImpl {
412
366
Kinesis ( KinesisSplitEnumerator ) ,
413
367
Nexmark ( NexmarkSplitEnumerator ) ,
414
368
Datagen ( DatagenSplitEnumerator ) ,
415
- MySqlCdc ( MysqlDebeziumSplitEnumerator ) ,
369
+ MysqlCdc ( MysqlDebeziumSplitEnumerator ) ,
416
370
PostgresCdc ( PostgresDebeziumSplitEnumerator ) ,
417
371
CitusCdc ( CitusDebeziumSplitEnumerator ) ,
418
372
GooglePubsub ( PubsubSplitEnumerator ) ,
@@ -437,7 +391,7 @@ impl_split_enumerator! {
437
391
{ Kinesis , KinesisSplitEnumerator } ,
438
392
{ Nexmark , NexmarkSplitEnumerator } ,
439
393
{ Datagen , DatagenSplitEnumerator } ,
440
- { MySqlCdc , DebeziumSplitEnumerator } ,
394
+ { MysqlCdc , DebeziumSplitEnumerator } ,
441
395
{ PostgresCdc , DebeziumSplitEnumerator } ,
442
396
{ CitusCdc , DebeziumSplitEnumerator } ,
443
397
{ GooglePubsub , PubsubSplitEnumerator } ,
@@ -452,7 +406,7 @@ impl_split! {
452
406
{ Nexmark , NEXMARK_CONNECTOR , NexmarkSplit } ,
453
407
{ Datagen , DATAGEN_CONNECTOR , DatagenSplit } ,
454
408
{ GooglePubsub , GOOGLE_PUBSUB_CONNECTOR , PubsubSplit } ,
455
- { MySqlCdc , MYSQL_CDC_CONNECTOR , DebeziumCdcSplit <Mysql > } ,
409
+ { MysqlCdc , MYSQL_CDC_CONNECTOR , DebeziumCdcSplit <Mysql > } ,
456
410
{ PostgresCdc , POSTGRES_CDC_CONNECTOR , DebeziumCdcSplit <Postgres > } ,
457
411
{ CitusCdc , CITUS_CDC_CONNECTOR , DebeziumCdcSplit <Citus > } ,
458
412
{ S3 , S3_CONNECTOR , FsSplit } ,
@@ -466,7 +420,7 @@ impl_split_reader! {
466
420
{ Kinesis , KinesisSplitReader } ,
467
421
{ Nexmark , NexmarkSplitReader } ,
468
422
{ Datagen , DatagenSplitReader } ,
469
- { MySqlCdc , CdcSplitReader } ,
423
+ { MysqlCdc , CdcSplitReader } ,
470
424
{ PostgresCdc , CdcSplitReader } ,
471
425
{ CitusCdc , CdcSplitReader } ,
472
426
{ GooglePubsub , PubsubSplitReader } ,
@@ -565,7 +519,7 @@ mod tests {
565
519
let offset_str = "{\" sourcePartition\" :{\" server\" :\" RW_CDC_mydb.products\" },\" sourceOffset\" :{\" transaction_id\" :null,\" ts_sec\" :1670407377,\" file\" :\" binlog.000001\" ,\" pos\" :98587,\" row\" :2,\" server_id\" :1,\" event\" :2}}" ;
566
520
let mysql_split = MySqlCdcSplit :: new ( 1001 , offset_str. to_string ( ) ) ;
567
521
let split = DebeziumCdcSplit :: new ( Some ( mysql_split) , None ) ;
568
- let split_impl = SplitImpl :: MySqlCdc ( split) ;
522
+ let split_impl = SplitImpl :: MysqlCdc ( split) ;
569
523
let encoded_split = split_impl. encode_to_bytes ( ) ;
570
524
let restored_split_impl = SplitImpl :: restore_from_bytes ( encoded_split. as_ref ( ) ) ?;
571
525
assert_eq ! (
@@ -653,7 +607,7 @@ mod tests {
653
607
) ) ;
654
608
655
609
let conn_props = ConnectorProperties :: extract ( user_props_mysql) . unwrap ( ) ;
656
- if let ConnectorProperties :: MySqlCdc ( c) = conn_props {
610
+ if let ConnectorProperties :: MysqlCdc ( c) = conn_props {
657
611
assert_eq ! ( c. props. get( "connector_node_addr" ) . unwrap( ) , "localhost" ) ;
658
612
assert_eq ! ( c. props. get( "database.hostname" ) . unwrap( ) , "127.0.0.1" ) ;
659
613
assert_eq ! ( c. props. get( "database.port" ) . unwrap( ) , "3306" ) ;
0 commit comments