static SizeInBytes preallocatedSize(RaftProperties properties) { return getSizeInBytes(properties::getSizeInBytes, PREALLOCATED_SIZE_KEY, PREALLOCATED_SIZE_DEFAULT, getDefaultLog()); } static void setPreallocatedSize(RaftProperties properties, SizeInBytes preallocatedSize) {
static SizeInBytes writeBufferSize(RaftProperties properties) { return getSizeInBytes(properties::getSizeInBytes, WRITE_BUFFER_SIZE_KEY, WRITE_BUFFER_SIZE_DEFAULT, getDefaultLog()); } static void setWriteBufferSize(RaftProperties properties, SizeInBytes writeBufferSize) {
static SizeInBytes queueByteLimit(RaftProperties properties) { return getSizeInBytes(properties::getSizeInBytes, QUEUE_BYTE_LIMIT_KEY, QUEUE_BYTE_LIMIT_DEFAULT, getDefaultLog()); } static void setByteLimit(RaftProperties properties, int queueSize) {
static SizeInBytes bufferByteLimit(RaftProperties properties) { return getSizeInBytes(properties::getSizeInBytes, BUFFER_BYTE_LIMIT_KEY, BUFFER_BYTE_LIMIT_DEFAULT, getDefaultLog()); } static void setBufferByteLimit(RaftProperties properties, SizeInBytes bufferByteLimit) {
static boolean sync(RaftProperties properties) { return getBoolean(properties::getBoolean, SYNC_KEY, SYNC_DEFAULT, getDefaultLog()); } static void setSync(RaftProperties properties, boolean sync) {
static boolean cachingEnabled(RaftProperties properties) { return getBoolean(properties::getBoolean, CACHING_ENABLED_KEY, CACHING_ENABLED_DEFAULT, getDefaultLog()); } static void setCachingEnabled(RaftProperties properties, boolean enable) {
static SizeInBytes snapshotChunkSizeMax(RaftProperties properties) { return getSizeInBytes(properties::getSizeInBytes, SNAPSHOT_CHUNK_SIZE_MAX_KEY, SNAPSHOT_CHUNK_SIZE_MAX_DEFAULT, getDefaultLog()); } static void setSnapshotChunkSizeMax(RaftProperties properties, SizeInBytes maxChunkSize) {
static boolean autoTriggerEnabled(RaftProperties properties) { return getBoolean(properties::getBoolean, AUTO_TRIGGER_ENABLED_KEY, AUTO_TRIGGER_ENABLED_DEFAULT, getDefaultLog()); } static void setAutoTriggerEnabled(RaftProperties properties, boolean autoTriggerThreshold) {
static int stagingCatchupGap(RaftProperties properties) { return getInt(properties::getInt, STAGING_CATCHUP_GAP_KEY, STAGING_CATCHUP_GAP_DEFAULT, getDefaultLog(), requireMin(0)); } static void setStagingCatchupGap(RaftProperties properties, int stagingCatchupGap) {
static int queueElementLimit(RaftProperties properties) { return getInt(properties::getInt, QUEUE_ELEMENT_LIMIT_KEY, QUEUE_ELEMENT_LIMIT_DEFAULT, getDefaultLog(), requireMin(1)); } static void setElementLimit(RaftProperties properties, int queueSize) {
static int bufferElementLimit(RaftProperties properties) { return getInt(properties::getInt, BUFFER_ELEMENT_LIMIT_KEY, BUFFER_ELEMENT_LIMIT_DEFAULT, getDefaultLog(), requireMin(0)); } static void setBufferElementLimit(RaftProperties properties, int bufferElementLimit) {
static int maxCachedSegmentNum(RaftProperties properties) { return getInt(properties::getInt, SEGMENT_CACHE_MAX_NUM_KEY, SEGMENT_CACHE_MAX_NUM_DEFAULT, getDefaultLog(), requireMin(0)); } static void setMaxCachedSegmentNum(RaftProperties properties, int maxCachedSegmentNum) {
static int syncTimeoutRetry(RaftProperties properties) { return getInt(properties::getInt, SYNC_TIMEOUT_RETRY_KEY, SYNC_TIMEOUT_RETRY_DEFAULT, getDefaultLog(), requireMin(-1)); } static void setSyncTimeoutRetry(RaftProperties properties, int syncTimeoutRetry) {
static long autoTriggerThreshold(RaftProperties properties) { return getLong(properties::getLong, AUTO_TRIGGER_THRESHOLD_KEY, AUTO_TRIGGER_THRESHOLD_DEFAULT, getDefaultLog(), requireMin(0L)); } static void setAutoTriggerThreshold(RaftProperties properties, long autoTriggerThreshold) {
static TimeDuration requestTimeout(RaftProperties properties) { return getTimeDuration(properties.getTimeDuration(REQUEST_TIMEOUT_DEFAULT.getUnit()), REQUEST_TIMEOUT_KEY, REQUEST_TIMEOUT_DEFAULT, getDefaultLog()); } static void setRequestTimeout(RaftProperties properties, TimeDuration timeoutDuration) {
static TimeDuration syncTimeout(RaftProperties properties) { return getTimeDuration(properties.getTimeDuration(SYNC_TIMEOUT_DEFAULT.getUnit()), SYNC_TIMEOUT_KEY, SYNC_TIMEOUT_DEFAULT, getDefaultLog()); } static void setSyncTimeout(RaftProperties properties, TimeDuration syncTimeout) {
static TimeDuration timeoutMax(RaftProperties properties) { return getTimeDuration(properties.getTimeDuration(TIMEOUT_MAX_DEFAULT.getUnit()), TIMEOUT_MAX_KEY, TIMEOUT_MAX_DEFAULT, getDefaultLog()); } static void setTimeoutMax(RaftProperties properties, TimeDuration maxDuration) {
static TimeDuration slownessTimeout(RaftProperties properties) { return getTimeDuration(properties.getTimeDuration(SLOWNESS_TIMEOUT_DEFAULT.getUnit()), SLOWNESS_TIMEOUT_KEY, SLOWNESS_TIMEOUT_DEFAULT, getDefaultLog()); } static void setSlownessTimeout(RaftProperties properties, TimeDuration expiryTime) {
static TimeDuration leaderElectionTimeout(RaftProperties properties) { return getTimeDuration(properties.getTimeDuration(LEADER_ELECTION_TIMEOUT_DEFAULT.getUnit()), LEADER_ELECTION_TIMEOUT_KEY, LEADER_ELECTION_TIMEOUT_DEFAULT, getDefaultLog()); } static void setLeaderElectionTimeout(RaftProperties properties, TimeDuration leaderElectionTimeout) {
static TimeDuration watchTimeoutDenomination(RaftProperties properties) { return getTimeDuration(properties.getTimeDuration(WATCH_TIMEOUT_DENOMINATION_DEFAULT.getUnit()), WATCH_TIMEOUT_DENOMINATION_KEY, WATCH_TIMEOUT_DENOMINATION_DEFAULT, getDefaultLog(), requirePositive()); } static void setWatchTimeoutDenomination(RaftProperties properties, TimeDuration watchTimeout) {