Package com.linkedin.venice.controller
Class HybridStoreConfigPolicy
java.lang.Object
com.linkedin.venice.controller.HybridStoreConfigPolicy
Encodes Venice's policy for hybrid + replication configuration on a store: when a store
counts as hybrid, how user-supplied update options merge onto the existing config, and the
auto-enable / auto-disable rules at hybrid <-> batch transitions. Pure computation against
in-memory state; no I/O.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanapplyHybridAndReplicationConfigUpdates(String storeName, Store currStore, UpdateStore setStore, VeniceControllerClusterConfig controllerConfig, Optional<Long> hybridRewindSeconds, Optional<Long> hybridOffsetLagThreshold, Optional<Long> hybridTimeLagThreshold, Optional<DataReplicationPolicy> hybridDataReplicationPolicy, Optional<BufferReplayPolicy> hybridBufferReplayPolicy, Optional<String> realTimeTopicName, Optional<Boolean> activeActiveReplicationEnabled, Optional<Boolean> incrementalPushEnabled, List<CharSequence> updatedConfigsList, org.apache.logging.log4j.Logger logger) Apply user-supplied hybrid + replication updates tosetStore, return whether the store is being converted from batch to hybrid.static booleanisHybrid(HybridStoreConfigRecord hybridStoreConfigRecord) static booleanisHybrid(HybridStoreConfig hybridStoreConfig) A store is hybrid iff itsHybridStoreConfigis non-null and at least one of the rewind / offset-lag / time-lag thresholds is non-negative.static HybridStoreConfigmergeNewSettingsIntoOldHybridStoreConfig(Store oldStore, Optional<Long> hybridRewindSeconds, Optional<Long> hybridOffsetLagThreshold, Optional<Long> hybridTimeLagThreshold, Optional<DataReplicationPolicy> hybridDataReplicationPolicy, Optional<BufferReplayPolicy> bufferReplayPolicy, Optional<String> realTimeTopicName) Merge user-supplied hybrid options on top ofoldStore's current hybrid config.
-
Method Details
-
isHybrid
A store is hybrid iff itsHybridStoreConfigis non-null and at least one of the rewind / offset-lag / time-lag thresholds is non-negative. A negative threshold sentinel is how a store is set back to batch-only. -
isHybrid
- See Also:
-
mergeNewSettingsIntoOldHybridStoreConfig
public static HybridStoreConfig mergeNewSettingsIntoOldHybridStoreConfig(Store oldStore, Optional<Long> hybridRewindSeconds, Optional<Long> hybridOffsetLagThreshold, Optional<Long> hybridTimeLagThreshold, Optional<DataReplicationPolicy> hybridDataReplicationPolicy, Optional<BufferReplayPolicy> bufferReplayPolicy, Optional<String> realTimeTopicName) Merge user-supplied hybrid options on top ofoldStore's current hybrid config.Returns null when
oldStoreis currently batch-only and no hybrid option has been specified (i.e. the caller is not converting the store to hybrid). When converting a batch-only store to hybrid, the rewind time plus at least one of the lag thresholds must be specified, otherwiseVeniceExceptionis thrown. -
applyHybridAndReplicationConfigUpdates
public static boolean applyHybridAndReplicationConfigUpdates(String storeName, Store currStore, UpdateStore setStore, VeniceControllerClusterConfig controllerConfig, Optional<Long> hybridRewindSeconds, Optional<Long> hybridOffsetLagThreshold, Optional<Long> hybridTimeLagThreshold, Optional<DataReplicationPolicy> hybridDataReplicationPolicy, Optional<BufferReplayPolicy> hybridBufferReplayPolicy, Optional<String> realTimeTopicName, Optional<Boolean> activeActiveReplicationEnabled, Optional<Boolean> incrementalPushEnabled, List<CharSequence> updatedConfigsList, org.apache.logging.log4j.Logger logger) Apply user-supplied hybrid + replication updates tosetStore, return whether the store is being converted from batch to hybrid. MutatessetStoreandupdatedConfigsList; performs no I/O.
-