@Test public void testElectionConfig() { long transferLeaderMinLag = electionConfig.getTransferLeaderMinLag(); Assert.assertEquals(transferLeaderMinLag, ElectionConfigKey.TRANSFER_LEADER_MIN_LAG.getValue()); int commandQueueSize = electionConfig.getCommandQueueSize(); Assert.assertEquals(commandQueueSize, ElectionConfigKey.COMMAND_QUEUE_SIZE.getValue()); int disableStoreTimeout = electionConfig.getDisableStoreTimeout(); Assert.assertEquals(disableStoreTimeout, ElectionConfigKey.DISABLE_STORE_TIMEOUT.getValue()); int electionTimeout = electionConfig.getElectionTimeout(); Assert.assertEquals(electionTimeout, ElectionConfigKey.ELECTION_TIMEOUT.getValue()); int executorThreadNumMax = electionConfig.getExecutorThreadNumMax(); Assert.assertEquals(executorThreadNumMax, ElectionConfigKey.EXECUTOR_THREAD_NUM_MAX.getValue()); int executorThreadNumMin = electionConfig.getExecutorThreadNumMin(); Assert.assertEquals(executorThreadNumMin, ElectionConfigKey.EXECUTOR_THREAD_NUM_MIN.getValue()); int heartbeatTimeout = electionConfig.getHeartbeatTimeout(); Assert.assertEquals(heartbeatTimeout, ElectionConfigKey.HEARTBEAT_TIMEOUT.getValue()); electionConfig.setListenPort("10000"); int listenPort = electionConfig.getListenPort(); Assert.assertEquals(listenPort, 10000); int logInterval = electionConfig.getLogInterval(); Assert.assertEquals(logInterval, ElectionConfigKey.LOG_INTERVAL.getValue()); int maxReplicateLength = electionConfig.getMaxReplicateLength(); Assert.assertEquals(maxReplicateLength, electionConfig.getMaxReplicateLength()); boolean enableReportLeaderPeriodically = electionConfig.enableReportLeaderPeriodically(); Assert.assertEquals(enableReportLeaderPeriodically, ElectionConfigKey.ENABLE_REPORT_LEADER_PERIODICALLY.getValue()); boolean enableRebalanceLeader = electionConfig.enableRebalanceLeader(); Assert.assertEquals(enableRebalanceLeader, ElectionConfigKey.ENABLE_REBALANCE_LEADER.getValue()); int minRebalanceLeaderInterval = electionConfig.getMinRebalanceLeaderInterval(); Assert.assertEquals(minRebalanceLeaderInterval, ElectionConfigKey.MIN_REBALANCE_INTERVAL.getValue()); int replicateConsumePosInterval = electionConfig.getReplicateConsumePosInterval(); Assert.assertEquals(replicateConsumePosInterval, ElectionConfigKey.REPLICATE_CONSUME_POS_INTERVAL.getValue()); int minReplicateThreadNum = electionConfig.getReplicateThreadNumMin(); Assert.assertEquals(minReplicateThreadNum, ElectionConfigKey.REPLICATE_THREAD_NUM_MIN.getValue()); int maxReplicateThreadNum = electionConfig.getReplicateThreadNumMax(); Assert.assertEquals(maxReplicateThreadNum, ElectionConfigKey.REPLICATE_THREAD_NUM_MAX.getValue()); int sendCommandTimeout = electionConfig.getSendCommandTimeout(); Assert.assertEquals(sendCommandTimeout, ElectionConfigKey.SEND_COMMAND_TIMEOUT.getValue()); int timerScheduleThreadNum = electionConfig.getTimerScheduleThreadNum(); Assert.assertEquals(timerScheduleThreadNum, ElectionConfigKey.TIMER_SCHEDULE_THREAD_NUM.getValue()); int transferLeaderTimeout = electionConfig.getTransferLeaderTimeout(); Assert.assertEquals(transferLeaderTimeout, ElectionConfigKey.TRANSFER_LEADER_TIMEOUT.getValue()); }
public ElectionConfig(PropertySupplier propertySupplier) { this.propertySupplier = propertySupplier; }
ElectionConfig { public ElectionConfig(PropertySupplier propertySupplier) { this.propertySupplier = propertySupplier; } }
ElectionConfig { public ElectionConfig(PropertySupplier propertySupplier) { this.propertySupplier = propertySupplier; } ElectionConfig(PropertySupplier propertySupplier); }
ElectionConfig { public ElectionConfig(PropertySupplier propertySupplier) { this.propertySupplier = propertySupplier; } ElectionConfig(PropertySupplier propertySupplier); String getMetadataPath(); int getElectionTimeout(); int getVoteTimeout(); int getExecutorThreadNumMin(); int getExecutorThreadNumMax(); int getTimerScheduleThreadNum(); int getHeartbeatTimeout(); int getSendCommandTimeout(); int getMaxReplicateLength(); int getDisableStoreTimeout(); int getListenPort(); int getTransferLeaderTimeout(); int getReplicateConsumePosInterval(); int getReplicateThreadNumMin(); int getReplicateThreadNumMax(); int getCommandQueueSize(); int getLogInterval(); long getTransferLeaderMinLag(); boolean enableRebalanceLeader(); int getMinRebalanceLeaderInterval(); boolean enableReportLeaderPeriodically(); boolean enableReportLeaderPeriodicallyForce(); boolean enableOnlineNodePeriodically(); boolean getOutputConsumePos(); int getConnectionTimeout(); int getConnectionRetryDelay(); boolean enableSharedHeartbeat(); void setListenPort(String port); void setElectionMetaPath(String electionMetaPath); }
ElectionConfig { public ElectionConfig(PropertySupplier propertySupplier) { this.propertySupplier = propertySupplier; } ElectionConfig(PropertySupplier propertySupplier); String getMetadataPath(); int getElectionTimeout(); int getVoteTimeout(); int getExecutorThreadNumMin(); int getExecutorThreadNumMax(); int getTimerScheduleThreadNum(); int getHeartbeatTimeout(); int getSendCommandTimeout(); int getMaxReplicateLength(); int getDisableStoreTimeout(); int getListenPort(); int getTransferLeaderTimeout(); int getReplicateConsumePosInterval(); int getReplicateThreadNumMin(); int getReplicateThreadNumMax(); int getCommandQueueSize(); int getLogInterval(); long getTransferLeaderMinLag(); boolean enableRebalanceLeader(); int getMinRebalanceLeaderInterval(); boolean enableReportLeaderPeriodically(); boolean enableReportLeaderPeriodicallyForce(); boolean enableOnlineNodePeriodically(); boolean getOutputConsumePos(); int getConnectionTimeout(); int getConnectionRetryDelay(); boolean enableSharedHeartbeat(); void setListenPort(String port); void setElectionMetaPath(String electionMetaPath); static final String ELECTION_META_PATH; }