Documentation ¶
Overview ¶
primecache primes the MySQL buffer cache with the rows that are going to be modified by the replication stream. It only activates if we're falling behind on replication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrimeCache ¶
type PrimeCache struct { // parameters with default values that can be changed by client WorkerCount int SleepDuration time.Duration // contains filtered or unexported fields }
PrimeCache is the main object for this module: it handles a player that will run in a loop to prime the MySQL cache.
func NewPrimeCache ¶
func NewPrimeCache(dbcfgs *dbconfigs.DBConfigs, relayLogsPath string) *PrimeCache
NewPrimeCache creates a PrimeCache object with default parameters. The user can modify the public values before running the loop.
func (*PrimeCache) Cleanup ¶
func (pc *PrimeCache) Cleanup()
Cleanup will release all resources help by this object. Closing pc.workerChannel will end up finishing the consumer tasks.
func (*PrimeCache) Loop ¶
func (pc *PrimeCache) Loop()
Loop runs the primecache loop and never returns.
func (*PrimeCache) OneRun ¶
func (pc *PrimeCache) OneRun()
OneRun tries a single cycle connecting to MySQL, and if behind on replication, starts playing the logs ahead to prime the cache.