mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: rename defaultCompactionSleepInterval var (#18495)
* etcdserver: rename `minimumBatchInterval` to `defaultCompactionSleepInterval` and `defaultCompactBatchLimit` to `defaultCompactionBatchLimit` Signed-off-by: Jalin Wang <JalinWang@outlook.com>
This commit is contained in:
parent
03fcba2940
commit
2c53be7c5d
@ -39,8 +39,8 @@ var (
|
||||
)
|
||||
|
||||
var restoreChunkKeys = 10000 // non-const for testing
|
||||
var defaultCompactBatchLimit = 1000
|
||||
var minimumBatchInterval = 10 * time.Millisecond
|
||||
var defaultCompactionBatchLimit = 1000
|
||||
var defaultCompactionSleepInterval = 10 * time.Millisecond
|
||||
|
||||
type StoreConfig struct {
|
||||
CompactionBatchLimit int
|
||||
@ -85,10 +85,10 @@ func NewStore(lg *zap.Logger, b backend.Backend, le lease.Lessor, cfg StoreConfi
|
||||
lg = zap.NewNop()
|
||||
}
|
||||
if cfg.CompactionBatchLimit == 0 {
|
||||
cfg.CompactionBatchLimit = defaultCompactBatchLimit
|
||||
cfg.CompactionBatchLimit = defaultCompactionBatchLimit
|
||||
}
|
||||
if cfg.CompactionSleepInterval == 0 {
|
||||
cfg.CompactionSleepInterval = minimumBatchInterval
|
||||
cfg.CompactionSleepInterval = defaultCompactionSleepInterval
|
||||
}
|
||||
s := &store{
|
||||
cfg: cfg,
|
||||
|
@ -917,7 +917,7 @@ func newFakeStore(lg *zap.Logger) *store {
|
||||
s := &store{
|
||||
cfg: StoreConfig{
|
||||
CompactionBatchLimit: 10000,
|
||||
CompactionSleepInterval: minimumBatchInterval,
|
||||
CompactionSleepInterval: defaultCompactionSleepInterval,
|
||||
},
|
||||
b: b,
|
||||
le: &lease.FakeLessor{},
|
||||
|
Loading…
x
Reference in New Issue
Block a user