Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

restore: write index kv pairs and data kv pairs to separate engine #132

Merged
merged 11 commits into from
Mar 8, 2019
17 changes: 6 additions & 11 deletions lightning/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func (c *Config) String() string {
type Lightning struct {
common.LogConfig
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"`
ProfilePort int `toml:"pprof-port" json:"pprof-port"`
Expand All @@ -91,10 +92,10 @@ type Lightning struct {

// PostRestore has some options which will be executed after kv restored.
type PostRestore struct {
Level1Compact *bool `toml:"level-1-compact" json:"level-1-compact"`
Compact bool `toml:"compact" json:"compact"`
Checksum bool `toml:"checksum" json:"checksum"`
Analyze bool `toml:"analyze" json:"analyze"`
Level1Compact bool `toml:"level-1-compact" json:"level-1-compact"`
Compact bool `toml:"compact" json:"compact"`
Checksum bool `toml:"checksum" json:"checksum"`
Analyze bool `toml:"analyze" json:"analyze"`
}

type MydumperRuntime struct {
Expand Down Expand Up @@ -144,6 +145,7 @@ func NewConfig() *Config {
App: Lightning{
RegionConcurrency: runtime.NumCPU(),
TableConcurrency: 8,
IndexConcurrency: 2,
IOConcurrency: 5,
CheckRequirements: true,
},
Expand Down Expand Up @@ -228,12 +230,5 @@ func (cfg *Config) Load() error {
cfg.Checkpoint.DSN = "/tmp/" + cfg.Checkpoint.Schema + ".pb"
}
}

// If the level 1 compact configuration not found, default to true
if cfg.PostRestore.Level1Compact == nil {
cfg.PostRestore.Level1Compact = new(bool)
*cfg.PostRestore.Level1Compact = true
}

return nil
}
Loading