github.com/pingcap/ticdc@v0.0.0-20220526033649-485a10ef2652/pkg/config/sorter.go (about) 1 // Copyright 2020 PingCAP, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 package config 15 16 // SorterConfig represents sorter config for a changefeed 17 type SorterConfig struct { 18 // number of concurrent heap sorts 19 NumConcurrentWorker int `toml:"num-concurrent-worker" json:"num-concurrent-worker"` 20 // maximum size for a heap 21 ChunkSizeLimit uint64 `toml:"chunk-size-limit" json:"chunk-size-limit"` 22 // the maximum memory use percentage that allows in-memory sorting 23 MaxMemoryPressure int `toml:"max-memory-percentage" json:"max-memory-percentage"` 24 // the maximum memory consumption allowed for in-memory sorting 25 MaxMemoryConsumption uint64 `toml:"max-memory-consumption" json:"max-memory-consumption"` 26 // the size of workerpool 27 NumWorkerPoolGoroutine int `toml:"num-workerpool-goroutine" json:"num-workerpool-goroutine"` 28 // the directory used to store the temporary files generated by the sorter 29 SortDir string `toml:"sort-dir" json:"sort-dir"` 30 }