g

package
v0.2.1-0...-d023f04 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

global values

Index

Constants

View Source
const (
	DtleSchemaName              string = "dtle"
	GtidExecutedTempTable2To3   string = "gtid_executed_temp_v2_v3"
	GtidExecutedTempTablePrefix string = "gtid_executed_temp_"
	GtidExecutedTablePrefix     string = "gtid_executed_"
	GtidExecutedTableV2         string = "gtid_executed_v2"
	GtidExecutedTableV3         string = "gtid_executed_v3"
	GtidExecutedTableV3a        string = "gtid_executed_v3a"
	GtidExecutedTableV4         string = "gtid_executed_v4"

	JobNameLenLimit = 64

	ENV_PRINT_TPS                = "UDUP_PRINT_TPS"
	ENV_DUMP_CHECKSUM            = "DTLE_DUMP_CHECKSUM"
	ENV_DUMP_OLDWAY              = "DTLE_DUMP_OLDWAY"
	ENV_TESTSTUB1_DELAY          = "UDUP_TESTSTUB1_DELAY"
	ENV_FULL_APPLY_DELAY         = "DTLE_FULL_APPLY_DELAY"
	ENV_BIG_MSG_100K             = "DTLE_BIG_MSG_100K"
	ENV_SKIP_GTID_EXECUTED_TABLE = "DTLE_SKIP_GTID_EXECUTED_TABLE"
	ENV_FORCE_MTS                = "DTLE_FORCE_MTS"
	ENV_DTLE_LOG_TX_COMMIT       = "DTLE_LOG_TX_COMMIT"
	ENV_DTLE_NO_BIG_TX_DML_PIPE  = "DTLE_NO_BIG_TX_DML_PIPE"

	NatsMaxPayload = 64 * 1024 * 1024

	LONG_LOG_LIMIT = 256

	PluginName = "dtle"
)

Variables

View Source
var (
	Version   string
	GitBranch string
	GitCommit string
)
View Source
var (
	// slightly smaller than NatsMaxPayload
	NatsMaxMsg                  = 64*1024*1024 - 4096
	HASH_STRING_SEPARATOR_BYTES = []byte{'½'} // from mysql-server rpl_write_set_handler.cc
)
View Source
var (
	MemAvailable = uint64(0)

	BigTxMaxJobs = int32(1)
)
View Source
var RsaPrivateKey string

Functions

func AddBigTxJob

func AddBigTxJob()

func BigTxReachMax

func BigTxReachMax() bool

func BoolToPtr

func BoolToPtr(b bool) *bool

boolToPtr returns the pointer to a boolean

func CopyMapStringFloat64

func CopyMapStringFloat64(m map[string]float64) map[string]float64

func CopyMapStringInt

func CopyMapStringInt(m map[string]int) map[string]int

func CopyMapStringString

func CopyMapStringString(m map[string]string) map[string]string

Helpers for copying generic structures.

func CopySliceString

func CopySliceString(s []string) []string

func CreateDump

func CreateDump()

func CurrentTimeMillis

func CurrentTimeMillis() int64

func DumpLoop

func DumpLoop()

func EnvIsTrue

func EnvIsTrue(env string) bool

EnvIsTrue returns true if the env exists and is not "0".

func FreeMemoryWorker

func FreeMemoryWorker()

func GetLowMemoryStatus

func GetLowMemoryStatus() bool

func IntToPtr

func IntToPtr(i int) *int

IntToPtr returns the pointer to an int

func IsLowMemory

func IsLowMemory() bool

func IsUTF8OrMB4

func IsUTF8OrMB4(encodeName string) bool

func LowerString

func LowerString(s *string)

func MemoryMonitor

func MemoryMonitor(logger LoggerType)

func MinInt

func MinInt(a int, b int) int

func PtrToBool

func PtrToBool(b *bool, defaultValue bool) bool

PtrToBool returns a boolean it will return the defaultValue if pointer is nil

func PtrToString

func PtrToString(ptr *string, defaultValue string) string

PtrToString returns a string it will return the defaultValue if pointer is nil

func StrLim

func StrLim(s string, lim int) string

Return a substring of limited lenth.

func StringElse

func StringElse(s1 string, s2 string) string

Return s1 if it is not empty, or else s2.

func StringPtrEmpty

func StringPtrEmpty(p *string) bool

func StringToPtr

func StringToPtr(str string) *string

StringToPtr returns the pointer to a string

func SubBigTxJob

func SubBigTxJob()

func TimeToPtr

func TimeToPtr(t time.Duration) *time.Duration

TimeToPtr returns the pointer to a time stamp

func TriggerFreeMemory

func TriggerFreeMemory()

func UUIDStrToMySQLHex

func UUIDStrToMySQLHex(u string) string

func Uint64ToPtr

func Uint64ToPtr(u uint64) *uint64

UintToPtr returns the pointer to an uint

Types

type LoggerType

type LoggerType hclog.Logger
var Logger LoggerType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL