Browse Source

Add deleterange_concurrency to filer configuration file

pull/2280/head
yulai.li 3 years ago
parent
commit
c1dc5ab4ac
  1. 2
      weed/command/scaffold/filer.toml
  2. 10
      weed/filer/tikv/tikv_store.go

2
weed/command/scaffold/filer.toml

@ -236,3 +236,5 @@ enabled = false
# If you have many pd address, use ',' split then:
# pdaddrs = "pdhost1:2379, pdhost2:2379, pdhost3:2379"
pdaddrs = "localhost:2379"
# Concurrency for TiKV delete range
deleterange_concurrency = 1

10
weed/filer/tikv/tikv_store.go

@ -16,6 +16,10 @@ import (
"github.com/tikv/client-go/v2/txnkv"
)
var (
_ filer.FilerStore = ((*TikvStore)(nil))
)
func init() {
filer.Stores = append(filer.Stores, &TikvStore{})
}
@ -36,7 +40,11 @@ func (store *TikvStore) Initialize(config util.Configuration, prefix string) err
for _, item := range strings.Split(pdAddrsStr, ",") {
pdAddrs = append(pdAddrs, strings.TrimSpace(item))
}
store.deleteRangeConcurrency = 1
drc := config.GetInt(prefix + "deleterange_concurrency")
if drc <= 0 {
drc = 1
}
store.deleteRangeConcurrency = drc
return store.initialize(pdAddrs)
}

Loading…
Cancel
Save