2021-06-02 15:31:29 +03:00
|
|
|
package objectconfig
|
|
|
|
|
|
|
|
import (
|
2023-03-07 16:38:26 +03:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config"
|
2021-06-02 15:31:29 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// PutConfig is a wrapper over "put" config section which provides access
|
|
|
|
// to object put pipeline configuration of object service.
|
|
|
|
type PutConfig struct {
|
|
|
|
cfg *config.Config
|
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
|
|
|
subsection = "object"
|
|
|
|
|
|
|
|
putSubsection = "put"
|
|
|
|
|
|
|
|
// PutPoolSizeDefault is a default value of routine pool size to
|
|
|
|
// process object.Put requests in object service.
|
|
|
|
PutPoolSizeDefault = 10
|
|
|
|
)
|
|
|
|
|
|
|
|
// Put returns structure that provides access to "put" subsection of
|
|
|
|
// "object" section.
|
|
|
|
func Put(c *config.Config) PutConfig {
|
|
|
|
return PutConfig{
|
|
|
|
c.Sub(subsection).Sub(putSubsection),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-21 13:20:36 +03:00
|
|
|
// PoolSizeRemote returns the value of "remote_pool_size" config parameter.
|
2021-06-02 15:31:29 +03:00
|
|
|
//
|
2022-04-21 14:28:05 +03:00
|
|
|
// Returns PutPoolSizeDefault if the value is not a positive number.
|
2021-09-24 13:50:25 +03:00
|
|
|
func (g PutConfig) PoolSizeRemote() int {
|
2023-11-21 13:20:36 +03:00
|
|
|
v := config.Int(g.cfg, "remote_pool_size")
|
2021-09-24 13:50:25 +03:00
|
|
|
if v > 0 {
|
|
|
|
return int(v)
|
|
|
|
}
|
|
|
|
|
|
|
|
return PutPoolSizeDefault
|
|
|
|
}
|
2023-02-22 11:31:50 +03:00
|
|
|
|
2023-11-21 13:20:36 +03:00
|
|
|
// PoolSizeLocal returns the value of "local_pool_size" config parameter.
|
2023-02-22 11:31:50 +03:00
|
|
|
//
|
|
|
|
// Returns PutPoolSizeDefault if the value is not a positive number.
|
|
|
|
func (g PutConfig) PoolSizeLocal() int {
|
2023-11-21 13:20:36 +03:00
|
|
|
v := config.Int(g.cfg, "local_pool_size")
|
2023-02-22 11:31:50 +03:00
|
|
|
if v > 0 {
|
|
|
|
return int(v)
|
|
|
|
}
|
|
|
|
|
|
|
|
return PutPoolSizeDefault
|
|
|
|
}
|
2023-07-28 15:44:35 +03:00
|
|
|
|
|
|
|
// SkipSessionTokenIssuerVerification returns the value of "skip_session_token_issuer_verification" config parameter or `false“ if is not defined.
|
|
|
|
func (g PutConfig) SkipSessionTokenIssuerVerification() bool {
|
|
|
|
return config.BoolSafe(g.cfg, "skip_session_token_issuer_verification")
|
|
|
|
}
|