config

package
v7.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0, Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ImportMode defines mode of import for tikv.
	ImportMode = "import"
	// NormalMode defines mode of normal for tikv.
	NormalMode = "normal"

	// BackendTiDB is a constant for choosing the "TiDB" backend in the configuration.
	BackendTiDB = "tidb"
	// BackendLocal is a constant for choosing the "Local" backup in the configuration.
	// In this mode, we write & sort kv pairs with local storage and directly write them to tikv.
	BackendLocal = "local"

	// CheckpointDriverMySQL is a constant for choosing the "MySQL" checkpoint driver in the configuration.
	CheckpointDriverMySQL = "mysql"
	// CheckpointDriverFile is a constant for choosing the "File" checkpoint driver in the configuration.
	CheckpointDriverFile = "file"

	// ReplaceOnDup indicates using REPLACE INTO to insert data
	ReplaceOnDup = "replace"
	// IgnoreOnDup indicates using INSERT IGNORE INTO to insert data
	IgnoreOnDup = "ignore"
	// ErrorOnDup indicates using INSERT INTO to insert data, which would violate PK or UNIQUE constraint
	ErrorOnDup = "error"
)
View Source
const (
	// mydumper
	ReadBlockSize ByteSize = 64 * units.KiB
	MaxRegionSize ByteSize = 256 * units.MiB
	// See: https://github.com/tikv/tikv/blob/e030a0aae9622f3774df89c62f21b2171a72a69e/etc/config-template.toml#L360
	// lower the max-key-count to avoid tikv trigger region auto split
	SplitRegionSize         ByteSize = 96 * units.MiB
	SplitRegionKeys         int      = 1_280_000
	MaxSplitRegionSizeRatio int      = 10

	BufferSizeScale = 5

	DefaultBatchSize ByteSize = 100 * units.GiB
)

Variables

View Source
var (
	DefaultGrpcKeepaliveParams = grpc.WithKeepaliveParams(keepalive.ClientParameters{
		Time:                10 * time.Second,
		Timeout:             20 * time.Second,
		PermitWithoutStream: false,
	})
)

Functions

func GetDefaultFilter

func GetDefaultFilter() []string

GetDefaultFilter gets the default table filter used in Lightning. It clones the original default filter, so that the original value won't be changed when the returned slice's element is changed.

Types

type AllIgnoreColumns

type AllIgnoreColumns []*IgnoreColumns

func (AllIgnoreColumns) GetIgnoreColumns

func (igCols AllIgnoreColumns) GetIgnoreColumns(db string, table string, caseSensitive bool) (*IgnoreColumns, error)

GetIgnoreColumns gets Ignore config by schema name/regex and table name/regex.

type ByteSize

type ByteSize int64

ByteSize is an alias of int64 which accepts human-friendly strings like '10G' when read from TOML.

func (*ByteSize) UnmarshalJSON

func (size *ByteSize) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler (for testing)

func (*ByteSize) UnmarshalText

func (size *ByteSize) UnmarshalText(b []byte) error

UnmarshalText implements encoding.TextUnmarshaler

type CSVConfig

type CSVConfig struct {
	// Separator, Delimiter and Terminator should all be in utf8mb4 encoding.
	Separator       string `toml:"separator" json:"separator"`
	Delimiter       string `toml:"delimiter" json:"delimiter"`
	Terminator      string `toml:"terminator" json:"terminator"`
	Null            string `toml:"null" json:"null"`
	Header          bool   `toml:"header" json:"header"`
	TrimLastSep     bool   `toml:"trim-last-separator" json:"trim-last-separator"`
	NotNull         bool   `toml:"not-null" json:"not-null"`
	BackslashEscape bool   `toml:"backslash-escape" json:"backslash-escape"`
	// hide these options for lightning configuration file, they can only be used by LOAD DATA
	// https://dev.mysql.com/doc/refman/8.0/en/load-data.html#load-data-field-line-handling
	StartingBy string `toml:"-" json:"-"`
}

type Charset

type Charset int

Charset defines character set

const (
	Binary Charset = iota
	UTF8MB4
	GB18030
	GBK
)

func ParseCharset

func ParseCharset(dataCharacterSet string) (Charset, error)

ParseCharset parser character set for string

func (Charset) String

func (c Charset) String() string

String return the string value of charset

type Checkpoint

type Checkpoint struct {
	Schema           string                    `toml:"schema" json:"schema"`
	DSN              string                    `toml:"dsn" json:"-"` // DSN may contain password, don't expose this to JSON.
	MySQLParam       *common.MySQLConnectParam `toml:"-" json:"-"`   // For some security reason, we use MySQLParam instead of DSN.
	Driver           string                    `toml:"driver" json:"driver"`
	Enable           bool                      `toml:"enable" json:"enable"`
	KeepAfterSuccess CheckpointKeepStrategy    `toml:"keep-after-success" json:"keep-after-success"`
}

type CheckpointKeepStrategy

type CheckpointKeepStrategy int
const (
	// remove checkpoint data
	CheckpointRemove CheckpointKeepStrategy = iota
	// keep by rename checkpoint file/db according to task id
	CheckpointRename
	// keep checkpoint data unchanged
	CheckpointOrigin
)

func (*CheckpointKeepStrategy) FromStringValue

func (t *CheckpointKeepStrategy) FromStringValue(s string) error

parser command line parameter

func (*CheckpointKeepStrategy) MarshalJSON

func (t *CheckpointKeepStrategy) MarshalJSON() ([]byte, error)

func (CheckpointKeepStrategy) MarshalText

func (t CheckpointKeepStrategy) MarshalText() ([]byte, error)

func (CheckpointKeepStrategy) String

func (t CheckpointKeepStrategy) String() string

func (*CheckpointKeepStrategy) UnmarshalJSON

func (t *CheckpointKeepStrategy) UnmarshalJSON(data []byte) error

func (*CheckpointKeepStrategy) UnmarshalTOML

func (t *CheckpointKeepStrategy) UnmarshalTOML(v interface{}) error

type Config

type Config struct {
	TaskID int64 `toml:"-" json:"id"`

	App  Lightning `toml:"lightning" json:"lightning"`
	TiDB DBStore   `toml:"tidb" json:"tidb"`

	Checkpoint   Checkpoint          `toml:"checkpoint" json:"checkpoint"`
	Mydumper     MydumperRuntime     `toml:"mydumper" json:"mydumper"`
	TikvImporter TikvImporter        `toml:"tikv-importer" json:"tikv-importer"`
	PostRestore  PostRestore         `toml:"post-restore" json:"post-restore"`
	Cron         Cron                `toml:"cron" json:"cron"`
	Routes       []*router.TableRule `toml:"routes" json:"routes"`
	Security     Security            `toml:"security" json:"security"`

	BWList filter.MySQLReplicationRules `toml:"black-white-list" json:"black-white-list"`
}

func NewConfig

func NewConfig() *Config

func (*Config) Adjust

func (cfg *Config) Adjust(ctx context.Context) error

Adjust fixes the invalid or unspecified settings to reasonable valid values.

func (*Config) AdjustCheckPoint

func (cfg *Config) AdjustCheckPoint()

func (*Config) AdjustCommon

func (cfg *Config) AdjustCommon() (bool, error)

func (*Config) AdjustMydumper

func (cfg *Config) AdjustMydumper()

func (*Config) CheckAndAdjustFilePath

func (cfg *Config) CheckAndAdjustFilePath() error

func (*Config) CheckAndAdjustForLocalBackend

func (cfg *Config) CheckAndAdjustForLocalBackend() error

func (*Config) CheckAndAdjustSecurity

func (cfg *Config) CheckAndAdjustSecurity() error

func (*Config) CheckAndAdjustTiDBPort

func (cfg *Config) CheckAndAdjustTiDBPort(ctx context.Context, mustHaveInternalConnections bool) error

func (*Config) DefaultVarsForImporterAndLocalBackend

func (cfg *Config) DefaultVarsForImporterAndLocalBackend()

func (*Config) DefaultVarsForTiDBBackend

func (cfg *Config) DefaultVarsForTiDBBackend()

func (*Config) HasLegacyBlackWhiteList

func (cfg *Config) HasLegacyBlackWhiteList() bool

HasLegacyBlackWhiteList checks whether the deprecated [black-white-list] section was defined.

func (*Config) LoadFromGlobal

func (cfg *Config) LoadFromGlobal(global *GlobalConfig) error

LoadFromGlobal resets the current configuration to the global settings.

func (*Config) LoadFromTOML

func (cfg *Config) LoadFromTOML(data []byte) error

LoadFromTOML overwrites the current configuration by the TOML data If data contains toml items not in Config and GlobalConfig, return an error If data contains toml items not in Config, thus won't take effect, warn user

func (*Config) String

func (cfg *Config) String() string

func (*Config) ToTLS

func (cfg *Config) ToTLS() (*common.TLS, error)

type Cron

type Cron struct {
	SwitchMode     Duration `toml:"switch-mode" json:"switch-mode"`
	LogProgress    Duration `toml:"log-progress" json:"log-progress"`
	CheckDiskQuota Duration `toml:"check-disk-quota" json:"check-disk-quota"`
}

type DBStore

type DBStore struct {
	Host       string    `toml:"host" json:"host"`
	Port       int       `toml:"port" json:"port"`
	User       string    `toml:"user" json:"user"`
	Psw        string    `toml:"password" json:"-"`
	StatusPort int       `toml:"status-port" json:"status-port"`
	PdAddr     string    `toml:"pd-addr" json:"pd-addr"`
	StrSQLMode string    `toml:"sql-mode" json:"sql-mode"`
	TLS        string    `toml:"tls" json:"tls"`
	Security   *Security `toml:"security" json:"security"`

	SQLMode          mysql.SQLMode `toml:"-" json:"-"`
	MaxAllowedPacket uint64        `toml:"max-allowed-packet" json:"max-allowed-packet"`

	DistSQLScanConcurrency     int               `toml:"distsql-scan-concurrency" json:"distsql-scan-concurrency"`
	BuildStatsConcurrency      int               `toml:"build-stats-concurrency" json:"build-stats-concurrency"`
	IndexSerialScanConcurrency int               `toml:"index-serial-scan-concurrency" json:"index-serial-scan-concurrency"`
	ChecksumTableConcurrency   int               `toml:"checksum-table-concurrency" json:"checksum-table-concurrency"`
	Vars                       map[string]string `toml:"-" json:"vars"`

	IOTotalBytes *atomic.Uint64 `toml:"-" json:"-"`
	UUID         string         `toml:"-" json:"-"`
}

type DuplicateResolutionAlgorithm

type DuplicateResolutionAlgorithm int

DuplicateResolutionAlgorithm is the config type of how to resolve duplicates.

const (
	// DupeResAlgNone doesn't detect duplicate.
	DupeResAlgNone DuplicateResolutionAlgorithm = iota

	// DupeResAlgRecord only records duplicate records to `lightning_task_info.conflict_error_v1` table on the target TiDB.
	DupeResAlgRecord

	// DupeResAlgRemove records all duplicate records like the 'record' algorithm and remove all information related to the
	// duplicated rows. Users need to analyze the lightning_task_info.conflict_error_v1 table to add back the correct rows.
	DupeResAlgRemove

	// DupeResAlgErr reports an error and stops the import process.
	// Note: this value is only used for internal.
	DupeResAlgErr
)

func (*DuplicateResolutionAlgorithm) FromStringValue

func (dra *DuplicateResolutionAlgorithm) FromStringValue(s string) error

func (*DuplicateResolutionAlgorithm) MarshalJSON

func (dra *DuplicateResolutionAlgorithm) MarshalJSON() ([]byte, error)

func (DuplicateResolutionAlgorithm) MarshalText

func (dra DuplicateResolutionAlgorithm) MarshalText() ([]byte, error)

func (DuplicateResolutionAlgorithm) String

func (dra DuplicateResolutionAlgorithm) String() string

func (*DuplicateResolutionAlgorithm) UnmarshalJSON

func (dra *DuplicateResolutionAlgorithm) UnmarshalJSON(data []byte) error

func (*DuplicateResolutionAlgorithm) UnmarshalTOML

func (dra *DuplicateResolutionAlgorithm) UnmarshalTOML(v interface{}) error

type Duration

type Duration struct {
	time.Duration
}

A duration which can be deserialized from a TOML string. Implemented as https://github.com/BurntSushi/toml#using-the-encodingtextunmarshaler-interface

func (*Duration) MarshalJSON

func (d *Duration) MarshalJSON() ([]byte, error)

func (Duration) MarshalText

func (d Duration) MarshalText() ([]byte, error)

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

type FileRouteRule

type FileRouteRule struct {
	Pattern     string `json:"pattern" toml:"pattern" yaml:"pattern"`
	Path        string `json:"path" toml:"path" yaml:"path"`
	Schema      string `json:"schema" toml:"schema" yaml:"schema"`
	Table       string `json:"table" toml:"table" yaml:"table"`
	Type        string `json:"type" toml:"type" yaml:"type"`
	Key         string `json:"key" toml:"key" yaml:"key"`
	Compression string `json:"compression" toml:"compression" yaml:"compression"`
	// unescape the schema/table name only used in lightning's internal logic now.
	Unescape bool `json:"-" toml:"-" yaml:"-"`
}

type GlobalCheckpoint

type GlobalCheckpoint struct {
	Enable bool `toml:"enable" json:"enable"`
}

type GlobalConfig

type GlobalConfig struct {
	App          GlobalLightning   `toml:"lightning" json:"lightning"`
	Checkpoint   GlobalCheckpoint  `toml:"checkpoint" json:"checkpoint"`
	TiDB         GlobalTiDB        `toml:"tidb" json:"tidb"`
	Mydumper     GlobalMydumper    `toml:"mydumper" json:"mydumper"`
	TikvImporter GlobalImporter    `toml:"tikv-importer" json:"tikv-importer"`
	PostRestore  GlobalPostRestore `toml:"post-restore" json:"post-restore"`
	Security     Security          `toml:"security" json:"security"`

	ConfigFileContent []byte
}

func LoadGlobalConfig

func LoadGlobalConfig(args []string, extraFlags func(*flag.FlagSet)) (*GlobalConfig, error)

LoadGlobalConfig reads the arguments and fills in the GlobalConfig.

func Must

func Must(cfg *GlobalConfig, err error) *GlobalConfig

Must should be called after LoadGlobalConfig(). If LoadGlobalConfig() returns any error, this function will exit the program with an appropriate exit code.

func NewGlobalConfig

func NewGlobalConfig() *GlobalConfig

type GlobalImporter

type GlobalImporter struct {
	Backend     string `toml:"backend" json:"backend"`
	SortedKVDir string `toml:"sorted-kv-dir" json:"sorted-kv-dir"`
}

type GlobalLightning

type GlobalLightning struct {
	log.Config
	StatusAddr        string `toml:"status-addr" json:"status-addr"`
	ServerMode        bool   `toml:"server-mode" json:"server-mode"`
	CheckRequirements bool   `toml:"check-requirements" json:"check-requirements"`

	// The legacy alias for setting "status-addr". The value should always the
	// same as StatusAddr, and will not be published in the JSON encoding.
	PProfPort int `toml:"pprof-port" json:"-"`
}

type GlobalMydumper

type GlobalMydumper struct {
	SourceDir string `toml:"data-source-dir" json:"data-source-dir"`
	// Deprecated
	NoSchema      bool             `toml:"no-schema" json:"no-schema"`
	Filter        []string         `toml:"filter" json:"filter"`
	IgnoreColumns []*IgnoreColumns `toml:"ignore-columns" json:"ignore-columns"`
}

type GlobalPostRestore

type GlobalPostRestore struct {
	Checksum PostOpLevel `toml:"checksum" json:"checksum"`
	Analyze  PostOpLevel `toml:"analyze" json:"analyze"`
}

type GlobalTiDB

type GlobalTiDB struct {
	Host       string `toml:"host" json:"host"`
	Port       int    `toml:"port" json:"port"`
	User       string `toml:"user" json:"user"`
	Psw        string `toml:"password" json:"-"`
	StatusPort int    `toml:"status-port" json:"status-port"`
	PdAddr     string `toml:"pd-addr" json:"pd-addr"`
	LogLevel   string `toml:"log-level" json:"log-level"`
}

type IgnoreColumns

type IgnoreColumns struct {
	DB          string   `toml:"db" json:"db"`
	Table       string   `toml:"table" json:"table"`
	TableFilter []string `toml:"table-filter" json:"table-filter"`
	Columns     []string `toml:"columns" json:"columns"`
}

func (*IgnoreColumns) ColumnsMap

func (ic *IgnoreColumns) ColumnsMap() map[string]struct{}

type Lightning

type Lightning struct {
	TableConcurrency  int    `toml:"table-concurrency" json:"table-concurrency"`
	IndexConcurrency  int    `toml:"index-concurrency" json:"index-concurrency"`
	RegionConcurrency int    `toml:"region-concurrency" json:"region-concurrency"`
	IOConcurrency     int    `toml:"io-concurrency" json:"io-concurrency"`
	CheckRequirements bool   `toml:"check-requirements" json:"check-requirements"`
	MetaSchemaName    string `toml:"meta-schema-name" json:"meta-schema-name"`

	MaxError           MaxError `toml:"max-error" json:"max-error"`
	TaskInfoSchemaName string   `toml:"task-info-schema-name" json:"task-info-schema-name"`
}

type List

type List struct {
	// contains filtered or unexported fields
}

List is a goroutine-safe FIFO list of *Config, which supports removal from the middle. The list is not expected to be very long.

func NewConfigList

func NewConfigList() *List

NewConfigList creates a new ConfigList instance.

func (*List) AllIDs

func (cl *List) AllIDs() []int64

AllIDs returns a list of all task IDs in the list.

func (*List) Get

func (cl *List) Get(taskID int64) (*Config, bool)

Get obtains a task from the list given its task ID. If the task ID did not exist, the returned bool field will be false.

func (*List) MoveToBack

func (cl *List) MoveToBack(taskID int64) bool

MoveToBack moves a task to the back of the list. Returns true if the task is successfully moved (including no-op), false if the task ID did not exist.

func (*List) MoveToFront

func (cl *List) MoveToFront(taskID int64) bool

MoveToFront moves a task to the front of the list. Returns true if the task is successfully moved (including no-op), false if the task ID did not exist.

func (*List) Pop

func (cl *List) Pop(ctx context.Context) (*Config, error)

Pop removes a configuration from the front of the list. If the list is empty, this method will block until either another goroutines calls Push() or the input context expired.

If the context expired, the error field will contain the error from context.

func (*List) Push

func (cl *List) Push(cfg *Config)

Push adds a configuration to the end of the list. The field `cfg.TaskID` will be modified to include a unique ID to identify this task.

func (*List) Remove

func (cl *List) Remove(taskID int64) bool

Remove removes a task from the list given its task ID. Returns true if a task is successfully removed, false if the task ID did not exist.

type MaxError

type MaxError struct {
	// Syntax is the maximum number of syntax errors accepted.
	// When tolerated, the file chunk causing syntax error will be skipped, and adds 1 to the counter.
	// TODO Currently this is hard-coded to zero.
	Syntax atomic.Int64 `toml:"syntax" json:"-"`

	// Charset is the maximum number of character-set conversion errors accepted.
	// When tolerated, and `data-invalid-char-replace` is not changed from "\ufffd",
	// every invalid byte in the source file will be converted to U+FFFD and adds 1 to the counter.
	// Note that a failed conversion a column's character set (e.g. UTF8-to-GBK conversion)
	// is counted as a type error, not a charset error.
	// TODO character-set conversion is not yet implemented.
	Charset atomic.Int64 `toml:"charset" json:"-"`

	// Type is the maximum number of type errors accepted.
	// This includes strict-mode errors such as zero in dates, integer overflow, character string too long, etc.
	// In TiDB backend, this also includes all possible SQL errors raised from INSERT,
	// such as unique key conflict when `on-duplicate` is set to `error`.
	// When tolerated, the row causing the error will be skipped, and adds 1 to the counter.
	Type atomic.Int64 `toml:"type" json:"type"`

	// Conflict is the maximum number of unique key conflicts in local backend accepted.
	// When tolerated, every pair of conflict adds 1 to the counter.
	// Those pairs will NOT be deleted from the target. Conflict resolution is performed separately.
	// TODO Currently this is hard-coded to infinity.
	Conflict atomic.Int64 `toml:"conflict" json:"-"`
}

MaxError configures the maximum number of acceptable errors per kind.

func (*MaxError) UnmarshalTOML

func (cfg *MaxError) UnmarshalTOML(v interface{}) error

type MydumperRuntime

type MydumperRuntime struct {
	ReadBlockSize    ByteSize         `toml:"read-block-size" json:"read-block-size"`
	BatchSize        ByteSize         `toml:"batch-size" json:"batch-size"`
	BatchImportRatio float64          `toml:"batch-import-ratio" json:"batch-import-ratio"`
	SourceID         string           `toml:"source-id" json:"source-id"`
	SourceDir        string           `toml:"data-source-dir" json:"data-source-dir"`
	CharacterSet     string           `toml:"character-set" json:"character-set"`
	CSV              CSVConfig        `toml:"csv" json:"csv"`
	MaxRegionSize    ByteSize         `toml:"max-region-size" json:"max-region-size"`
	Filter           []string         `toml:"filter" json:"filter"`
	FileRouters      []*FileRouteRule `toml:"files" json:"files"`
	// Deprecated: only used to keep the compatibility.
	NoSchema         bool             `toml:"no-schema" json:"no-schema"`
	CaseSensitive    bool             `toml:"case-sensitive" json:"case-sensitive"`
	StrictFormat     bool             `toml:"strict-format" json:"strict-format"`
	DefaultFileRules bool             `toml:"default-file-rules" json:"default-file-rules"`
	IgnoreColumns    AllIgnoreColumns `toml:"ignore-data-columns" json:"ignore-data-columns"`
	// DataCharacterSet is the character set of the source file. Only CSV files are supported now. The following options are supported.
	//   - utf8mb4
	//   - GB18030
	//   - GBK: an extension of the GB2312 character set and is also known as Code Page 936.
	//   - binary: no attempt to convert the encoding.
	// Leave DataCharacterSet empty will make it use `binary` by default.
	DataCharacterSet string `toml:"data-character-set" json:"data-character-set"`
	// DataInvalidCharReplace is the replacement characters for non-compatible characters, which shouldn't duplicate with the separators or line breaks.
	// Changing the default value will result in increased parsing time. Non-compatible characters do not cause an increase in error.
	DataInvalidCharReplace string `toml:"data-invalid-char-replace" json:"data-invalid-char-replace"`
}

type PostOpLevel

type PostOpLevel int
const (
	OpLevelOff PostOpLevel = iota
	OpLevelOptional
	OpLevelRequired
)

func (*PostOpLevel) FromStringValue

func (t *PostOpLevel) FromStringValue(s string) error

parser command line parameter

func (*PostOpLevel) MarshalJSON

func (t *PostOpLevel) MarshalJSON() ([]byte, error)

func (PostOpLevel) MarshalText

func (t PostOpLevel) MarshalText() ([]byte, error)

func (PostOpLevel) String

func (t PostOpLevel) String() string

func (*PostOpLevel) UnmarshalJSON

func (t *PostOpLevel) UnmarshalJSON(data []byte) error

func (*PostOpLevel) UnmarshalTOML

func (t *PostOpLevel) UnmarshalTOML(v interface{}) error

type PostRestore

type PostRestore struct {
	Checksum          PostOpLevel `toml:"checksum" json:"checksum"`
	Analyze           PostOpLevel `toml:"analyze" json:"analyze"`
	Level1Compact     bool        `toml:"level-1-compact" json:"level-1-compact"`
	PostProcessAtLast bool        `toml:"post-process-at-last" json:"post-process-at-last"`
	Compact           bool        `toml:"compact" json:"compact"`
}

PostRestore has some options which will be executed after kv restored.

type Security

type Security struct {
	CAPath   string `toml:"ca-path" json:"ca-path"`
	CertPath string `toml:"cert-path" json:"cert-path"`
	KeyPath  string `toml:"key-path" json:"key-path"`
	// RedactInfoLog indicates that whether enabling redact log
	RedactInfoLog bool `toml:"redact-info-log" json:"redact-info-log"`

	TLSConfig                *tls.Config `toml:"-" json:"-"`
	AllowFallbackToPlaintext bool        `toml:"-" json:"-"`

	// When DM/engine uses lightning as a library, it can directly pass in the content
	CABytes   []byte `toml:"-" json:"-"`
	CertBytes []byte `toml:"-" json:"-"`
	KeyBytes  []byte `toml:"-" json:"-"`
}

func (*Security) BuildTLSConfig

func (sec *Security) BuildTLSConfig() error

BuildTLSConfig builds the tls config which is used by SQL drier later.

type TikvImporter

type TikvImporter struct {
	// Deprecated: only used to keep the compatibility.
	Addr                string                       `toml:"addr" json:"addr"`
	Backend             string                       `toml:"backend" json:"backend"`
	OnDuplicate         string                       `toml:"on-duplicate" json:"on-duplicate"`
	MaxKVPairs          int                          `toml:"max-kv-pairs" json:"max-kv-pairs"`
	SendKVPairs         int                          `toml:"send-kv-pairs" json:"send-kv-pairs"`
	RegionSplitSize     ByteSize                     `toml:"region-split-size" json:"region-split-size"`
	RegionSplitKeys     int                          `toml:"region-split-keys" json:"region-split-keys"`
	SortedKVDir         string                       `toml:"sorted-kv-dir" json:"sorted-kv-dir"`
	DiskQuota           ByteSize                     `toml:"disk-quota" json:"disk-quota"`
	RangeConcurrency    int                          `toml:"range-concurrency" json:"range-concurrency"`
	DuplicateResolution DuplicateResolutionAlgorithm `toml:"duplicate-resolution" json:"duplicate-resolution"`
	IncrementalImport   bool                         `toml:"incremental-import" json:"incremental-import"`

	EngineMemCacheSize      ByteSize `toml:"engine-mem-cache-size" json:"engine-mem-cache-size"`
	LocalWriterMemCacheSize ByteSize `toml:"local-writer-mem-cache-size" json:"local-writer-mem-cache-size"`
	StoreWriteBWLimit       ByteSize `toml:"store-write-bwlimit" json:"store-write-bwlimit"`
}

Jump to

Keyboard shortcuts

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