@@ -611,7 +611,7 @@ public class MaxwellConfig extends AbstractConfig {
611611 /**
612612 * Enable high available support (via jgroups-raft or zookeeper)
613613 */
614- public boolean haMode ;
614+ public String haMode ;
615615
616616 /**
617617 * Path to raft.xml file that configures high availability support
@@ -637,27 +637,23 @@ public class MaxwellConfig extends AbstractConfig {
637637 /**
638638 * session time
639639 */
640- public int sessionTimeoutMs ;
640+ public int zookeeperSessionTimeoutMs ;
641641
642642 /**
643643 * connection time
644644 */
645- public int connectionTimeoutMs ;
645+ public int zookeeperConnectionTimeoutMs ;
646646
647647 /**
648648 * maxRetries
649649 */
650- public int maxRetries ;
650+ public int zookeeperMaxRetries ;
651651
652652 /**
653- * baseSleepTimeMs
653+ * retryWaitMs
654654 */
655- public int baseSleepTimeMs ;
655+ public int zookeeperRetryWaitMs ;
656656
657- /**
658- * jgroups-raft or zookeeper
659- */
660- public String haModality ;
661657
662658 /**
663659 * Build a default configuration object.
@@ -772,23 +768,21 @@ protected MaxwellOptionParser buildOptionParser() {
772768 parser .separator ();
773769
774770 parser .accepts ( "ha" , "enable high-availability mode via jgroups-raft or zookeeper" )
775- .withOptionalArg (). ofType ( Boolean . class ) ;
771+ .withOptionalArg ();
776772 parser .accepts ( "jgroups_config" , "location of jgroups xml configuration file" )
777773 .withRequiredArg ();
778774 parser .accepts ( "raft_member_id" , "raft memberID. (may also be specified in raft.xml)" )
779775 .withRequiredArg ();
780776 parser .accepts ("zookeeper_server" ,"enable maxwell High Availability using zookeeper" )
781777 .withRequiredArg ();
782- parser .accepts ("session_time_out_ms " ,"session timeout duration (maxwellHA on zk)" )
778+ parser .accepts ("zookeeper_session_timeout_ms " ,"session timeout duration (maxwellHA on zk)" )
783779 .withRequiredArg ().ofType (Integer .class );
784- parser .accepts ("connection_time_out_ms " ,"connection timeout duration (maxwellHA on zk)" )
780+ parser .accepts ("zookeeper_connection_timeout_ms " ,"connection timeout duration (maxwellHA on zk)" )
785781 .withRequiredArg ().ofType (Integer .class );
786- parser .accepts ("max_retries " ,"maximum retry (maxwellHA on zk)" )
782+ parser .accepts ("zookeeper_max_retries " ,"maximum retry (maxwellHA on zk)" )
787783 .withRequiredArg ().ofType (Integer .class );
788- parser .accepts ("base_sleep_time_ms " ,"initial retry wait time (maxwellHA on zk)" )
784+ parser .accepts ("zookeeper_retry_wait_ms " ,"initial retry wait time (maxwellHA on zk)" )
789785 .withRequiredArg ().ofType (Integer .class );
790- parser .accepts ("ha_modality" ,"high availability mode : jgroups-raft or zookeeper" )
791- .withRequiredArg ();
792786
793787 parser .separator ();
794788
@@ -1248,17 +1242,16 @@ private void setup(OptionSet options, Properties properties) {
12481242
12491243 setupEncryptionOptions (options , properties );
12501244
1251- this .haMode = fetchBooleanOption ("ha" , options , properties , false );
1245+ this .haMode = fetchStringOption ("ha" , options , properties , null );
12521246 this .jgroupsConf = fetchStringOption ("jgroups_config" , options , properties , "raft.xml" );
12531247 this .raftMemberID = fetchStringOption ("raft_member_id" , options , properties , null );
12541248 this .replicationReconnectionRetries = fetchIntegerOption ("replication_reconnection_retries" , options , properties , 1 );
12551249
12561250 this .zookeeperServer = fetchStringOption ("zookeeper_server" , options , properties , null );
1257- this .sessionTimeoutMs = fetchIntegerOption ("session_time_out_ms" , options , properties , 6000 );
1258- this .connectionTimeoutMs = fetchIntegerOption ("connection_time_out_ms" , options , properties , 6000 );
1259- this .maxRetries = fetchIntegerOption ("max_retries" , options , properties , 3 );
1260- this .baseSleepTimeMs = fetchIntegerOption ("base_sleep_time_ms" , options , properties , 1000 );
1261- this .haModality = fetchStringOption ("ha_modality" , options , properties , "jgroups-raft" );
1251+ this .zookeeperSessionTimeoutMs = fetchIntegerOption ("zookeeper_session_timeout_ms" , options , properties , 6000 );
1252+ this .zookeeperConnectionTimeoutMs = fetchIntegerOption ("zookeeper_connection_timeout_ms" , options , properties , 6000 );
1253+ this .zookeeperMaxRetries = fetchIntegerOption ("zookeeper_max_retries" , options , properties , 3 );
1254+ this .zookeeperRetryWaitMs = fetchIntegerOption ("zookeeper_retry_wait_ms" , options , properties , 1000 );
12621255
12631256 this .binlogEventQueueSize = fetchIntegerOption ("binlog_event_queue_size" , options , properties , BinlogConnectorReplicator .BINLOG_QUEUE_SIZE );
12641257 }
0 commit comments