[#493] node: Remove unused worker pools for reading object operations
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
f582475ea2
commit
c36bca1ddc
1 changed files with 2 additions and 37 deletions
|
@ -97,12 +97,7 @@ const (
|
||||||
|
|
||||||
cfgReplicatorPutTimeout = "replicator.put_timeout"
|
cfgReplicatorPutTimeout = "replicator.put_timeout"
|
||||||
|
|
||||||
cfgObjectPutPoolSize = "object.put.pool_size"
|
cfgObjectPutPoolSize = "object.put.pool_size"
|
||||||
cfgObjectGetPoolSize = "object.get.pool_size"
|
|
||||||
cfgObjectHeadPoolSize = "object.head.pool_size"
|
|
||||||
cfgObjectSearchPoolSize = "object.search.pool_size"
|
|
||||||
cfgObjectRangePoolSize = "object.range.pool_size"
|
|
||||||
cfgObjectRangeHashPoolSize = "object.rangehash.pool_size"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -279,7 +274,7 @@ type cfgLocalStorage struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type cfgObjectRoutines struct {
|
type cfgObjectRoutines struct {
|
||||||
get, head, put, search, rng, rngHash *ants.Pool
|
put *ants.Pool
|
||||||
}
|
}
|
||||||
|
|
||||||
type cfgControlService struct {
|
type cfgControlService struct {
|
||||||
|
@ -454,12 +449,7 @@ func defaultConfiguration(v *viper.Viper) {
|
||||||
|
|
||||||
v.SetDefault(cfgReplicatorPutTimeout, 5*time.Second)
|
v.SetDefault(cfgReplicatorPutTimeout, 5*time.Second)
|
||||||
|
|
||||||
v.SetDefault(cfgObjectGetPoolSize, 10)
|
|
||||||
v.SetDefault(cfgObjectHeadPoolSize, 10)
|
|
||||||
v.SetDefault(cfgObjectPutPoolSize, 10)
|
v.SetDefault(cfgObjectPutPoolSize, 10)
|
||||||
v.SetDefault(cfgObjectSearchPoolSize, 10)
|
|
||||||
v.SetDefault(cfgObjectRangePoolSize, 10)
|
|
||||||
v.SetDefault(cfgObjectRangeHashPoolSize, 10)
|
|
||||||
|
|
||||||
v.SetDefault(cfgCtrlSvcAuthorizedKeys, []string{})
|
v.SetDefault(cfgCtrlSvcAuthorizedKeys, []string{})
|
||||||
}
|
}
|
||||||
|
@ -689,36 +679,11 @@ func initObjectPool(cfg *viper.Viper) (pool cfgObjectRoutines) {
|
||||||
|
|
||||||
optNonBlocking := ants.WithNonblocking(true)
|
optNonBlocking := ants.WithNonblocking(true)
|
||||||
|
|
||||||
pool.get, err = ants.NewPool(cfg.GetInt(cfgObjectGetPoolSize), optNonBlocking)
|
|
||||||
if err != nil {
|
|
||||||
fatalOnErr(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
pool.head, err = ants.NewPool(cfg.GetInt(cfgObjectHeadPoolSize), optNonBlocking)
|
|
||||||
if err != nil {
|
|
||||||
fatalOnErr(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
pool.search, err = ants.NewPool(cfg.GetInt(cfgObjectSearchPoolSize), optNonBlocking)
|
|
||||||
if err != nil {
|
|
||||||
fatalOnErr(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
pool.put, err = ants.NewPool(cfg.GetInt(cfgObjectPutPoolSize), optNonBlocking)
|
pool.put, err = ants.NewPool(cfg.GetInt(cfgObjectPutPoolSize), optNonBlocking)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pool.rng, err = ants.NewPool(cfg.GetInt(cfgObjectRangePoolSize), optNonBlocking)
|
|
||||||
if err != nil {
|
|
||||||
fatalOnErr(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
pool.rngHash, err = ants.NewPool(cfg.GetInt(cfgObjectRangeHashPoolSize), optNonBlocking)
|
|
||||||
if err != nil {
|
|
||||||
fatalOnErr(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return pool
|
return pool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue