@@ -33,30 +33,39 @@ import (
3333const profileAddress = "127.0.0.1:6060"
3434
3535type options struct {
36- upstreamURI string
37- downstreamURI string
38- configFile string
39- consumerID string
40- logFile string
41- logLevel string
42- consumerGroupID string
43- schemaRegistryURI string
44- upstreamTiDBDSN string
45- timezone string
46- ca string
47- cert string
48- key string
36+ // Common options shared across Kafka, Pulsar, and Storage sources.
37+ upstreamURI string
38+ downstreamURI string
39+ configFile string
40+ consumerID string
41+ logFile string
42+ logLevel string
43+ timezone string
44+ enableProfiling bool
45+
46+ // Kafka options for consumer group, Avro/Debezium schema lookup, and upstream row lookup.
47+ consumerGroupID string
48+ schemaRegistryURI string
49+ upstreamTiDBDSN string
50+
51+ // Transport TLS options shared by Kafka and Pulsar sources.
52+ ca string
53+ cert string
54+ key string
55+
56+ // Pulsar authentication options for mTLS and OAuth2 connections.
4957 authTLSCertificatePath string
5058 authTLSPrivateKeyPath string
5159 oauth2PrivateKey string
5260 oauth2IssuerURL string
5361 oauth2ClientID string
5462 oauth2Scope string
5563 oauth2Audience string
56- flushInterval time.Duration
57- fileIndexWidth int
58- fileIndexWidthSet bool
59- enableProfiling bool
64+
65+ // Storage options for cloud storage scan cadence and DML file naming.
66+ flushInterval time.Duration
67+ fileIndexWidth int
68+ fileIndexWidthSet bool
6069}
6170
6271func main () {
@@ -111,21 +120,32 @@ func newCommand() *cobra.Command {
111120 })
112121
113122 flags := command .Flags ()
123+
124+ // Common options (Kafka, Pulsar, and Storage).
114125 flags .StringVar (& options .upstreamURI , "upstream-uri" , "" , "Kafka, Pulsar, or Storage source URI" )
115126 flags .StringVar (& options .downstreamURI , "downstream-uri" , "" , "downstream sink URI" )
116127 flags .StringVar (& options .configFile , "config" , "" , "consumer configuration file" )
117128 flags .StringVar (& options .consumerID , "consumer-id" , "" ,
118129 "Kafka group ID or Pulsar subscription name (random if omitted)" )
119130 flags .StringVar (& options .logFile , "log-file" , "cdc_consumer.log" , "log file path" )
120131 flags .StringVar (& options .logLevel , "log-level" , "info" , "log level" )
121- flags .BoolVar (& options .enableProfiling , "enable-profiling" , false , "enable pprof on " + profileAddress )
122- flags .StringVar (& options .consumerGroupID , "consumer-group-id" , "" , "legacy alias for --consumer-id" )
123- flags .StringVar (& options .schemaRegistryURI , "schema-registry-uri" , "" , "Avro schema registry URI" )
124- flags .StringVar (& options .upstreamTiDBDSN , "upstream-tidb-dsn" , "" , "upstream TiDB DSN" )
125132 flags .StringVar (& options .timezone , "tz" , "System" , "consumer time zone" )
133+ flags .BoolVar (& options .enableProfiling , "enable-profiling" , false , "enable pprof on " + profileAddress )
134+
135+ // Kafka options (consumer group, Avro schema registry, and handle-key-only / claim-check upstream lookup).
136+ flags .StringVar (& options .consumerGroupID , "consumer-group-id" , "" ,
137+ "Kafka consumer group ID (alias for --consumer-id)" )
138+ flags .StringVar (& options .schemaRegistryURI , "schema-registry-uri" , "" ,
139+ "Kafka Avro/Debezium-Avro schema registry URI" )
140+ flags .StringVar (& options .upstreamTiDBDSN , "upstream-tidb-dsn" , "" ,
141+ "upstream TiDB DSN for Kafka handle-key-only, simple, and claim-check lookup" )
142+
143+ // Kafka and Pulsar TLS transport options.
126144 flags .StringVar (& options .ca , "ca" , "" , "CA certificate path for Kafka/Pulsar TLS" )
127145 flags .StringVar (& options .cert , "cert" , "" , "client certificate path for Kafka/Pulsar TLS" )
128146 flags .StringVar (& options .key , "key" , "" , "client private key path for Kafka/Pulsar TLS" )
147+
148+ // Pulsar authentication options (mTLS and OAuth2).
129149 flags .StringVar (& options .authTLSCertificatePath , "auth-tls-certificate-path" , "" ,
130150 "Pulsar mTLS authentication certificate path" )
131151 flags .StringVar (& options .authTLSPrivateKeyPath , "auth-tls-private-key-path" , "" ,
@@ -135,6 +155,8 @@ func newCommand() *cobra.Command {
135155 flags .StringVar (& options .oauth2ClientID , "oauth2-client-id" , "" , "Pulsar OAuth2 client ID" )
136156 flags .StringVar (& options .oauth2Scope , "oauth2-scope" , "" , "Pulsar OAuth2 scope" )
137157 flags .StringVar (& options .oauth2Audience , "oauth2-audience" , "" , "Pulsar OAuth2 audience" )
158+
159+ // Storage options (scan interval and DML file index formatting).
138160 flags .DurationVar (& options .flushInterval , "flush-interval" , 2 * time .Second , "storage scan interval" )
139161 flags .IntVar (& options .fileIndexWidth , "file-index-width" ,
140162 config .DefaultFileIndexWidth , "storage file index width" )
0 commit comments