Documentation ¶
Index ¶
Constants ¶
const ( // VReplicationExperimentalFlags is a bitmask of experimental features in vreplication. VReplicationExperimentalFlagOptimizeInserts = int64(1) VReplicationExperimentalFlagAllowNoBlobBinlogRowImage = int64(2) VReplicationExperimentalFlagVPlayerBatching = int64(4) )
Variables ¶
var ( // VStreamerBinlogRotationThreshold is the threshold, above which we rotate binlogs, before taking a GTID snapshot VStreamerBinlogRotationThreshold = int64(64 * 1024 * 1024) // 64MiB VStreamerDefaultPacketSize = 250000 VStreamerUseDynamicPacketSize = true )
Functions ¶
func GetVReplicationNetReadTimeout ¶
func GetVReplicationNetReadTimeout() int
func GetVReplicationNetWriteTimeout ¶
func GetVReplicationNetWriteTimeout() int
Types ¶
type VReplicationConfig ¶
type VReplicationConfig struct { // Config parameters applicable to the target side (vreplication) ExperimentalFlags int64 NetReadTimeout int NetWriteTimeout int CopyPhaseDuration time.Duration RetryDelay time.Duration MaxTimeToRetryError time.Duration RelayLogMaxSize int RelayLogMaxItems int ReplicaLagTolerance time.Duration HeartbeatUpdateInterval int StoreCompressedGTID bool ParallelInsertWorkers int TabletTypesStr string // Config parameters applicable to the source side (vstreamer) // The coresponding Override fields are used to determine if the user has provided a value for the parameter so // that they can be sent in the VStreamer API calls to the source. VStreamPacketSize int VStreamPacketSizeOverride bool VStreamDynamicPacketSize bool VStreamDynamicPacketSizeOverride bool VStreamBinlogRotationThreshold int64 VStreamBinlogRotationThresholdOverride bool // Overrides is a map of user-provided configuration values that override the default configuration. Overrides map[string]string }
VReplicationConfig has the all the configuration parameters for VReplication workflows, both applicable on the target (vreplication)and the source (vstreamer) side.
var DefaultVReplicationConfig *VReplicationConfig
DefaultVReplicationConfig has the default values for VReplicationConfig initialized from the vttablet flags when the workflow is initialized.
func GetDefaultVReplicationConfig ¶
func GetDefaultVReplicationConfig() *VReplicationConfig
GetDefaultVReplicationConfig returns a copy of the default VReplicationConfig.
func GetVReplicationConfigDefaults ¶
func GetVReplicationConfigDefaults(useCached bool) *VReplicationConfig
GetVReplicationConfigDefaults returns the default VReplicationConfig. If `useCached` is true, it returns the previously loaded configuration. Otherwise it reloads the configuration from the vttablet flags. useCached is set to false when the vttablet flags are updated in unit tests.
func InitVReplicationConfigDefaults ¶
func InitVReplicationConfigDefaults() *VReplicationConfig
InitVReplicationConfigDefaults initializes the default VReplicationConfig in an idempotent way.
func NewVReplicationConfig ¶
func NewVReplicationConfig(overrides map[string]string) (*VReplicationConfig, error)
NewVReplicationConfig creates a new VReplicationConfig by merging the default configuration with the user-provided overrides. It returns an error if the user-provided values are invalid.
func (VReplicationConfig) Map ¶
func (c VReplicationConfig) Map() map[string]string
Map returns a map of the VReplicationConfig: the keys are the flag names and the values are string representations. Used in tests to compare the expected and actual configuration values and in validations to check if the user-provided keys are one of those that are supported.
func (VReplicationConfig) String ¶
func (c VReplicationConfig) String() string