mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Add deleterange_concurrency to filer configuration file
This commit is contained in:
parent
318757ef8c
commit
c1dc5ab4ac
|
@ -236,3 +236,5 @@ enabled = false
|
||||||
# If you have many pd address, use ',' split then:
|
# If you have many pd address, use ',' split then:
|
||||||
# pdaddrs = "pdhost1:2379, pdhost2:2379, pdhost3:2379"
|
# pdaddrs = "pdhost1:2379, pdhost2:2379, pdhost3:2379"
|
||||||
pdaddrs = "localhost:2379"
|
pdaddrs = "localhost:2379"
|
||||||
|
# Concurrency for TiKV delete range
|
||||||
|
deleterange_concurrency = 1
|
||||||
|
|
|
@ -16,6 +16,10 @@ import (
|
||||||
"github.com/tikv/client-go/v2/txnkv"
|
"github.com/tikv/client-go/v2/txnkv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_ filer.FilerStore = ((*TikvStore)(nil))
|
||||||
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
filer.Stores = append(filer.Stores, &TikvStore{})
|
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, ",") {
|
for _, item := range strings.Split(pdAddrsStr, ",") {
|
||||||
pdAddrs = append(pdAddrs, strings.TrimSpace(item))
|
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)
|
return store.initialize(pdAddrs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue