Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ShardPoolSizeDefault is the default value of routine pool size per-shard to // process object PUT operations in a storage engine. ShardPoolSizeDefault = 20 )
Variables ¶
View Source
var ErrNoShardConfigured = errors.New("no shard configured")
ErrNoShardConfigured is returned when at least 1 shard is required but none are found.
Functions ¶
func IterateShards ¶
func IterateShards(c *Storage, required bool, f func(details *shardconfig.ShardDetails) error) error
IterateShards iterates over subsections of "shard" subsection of "storage" section of c, wrap them into shardconfig.Config and passes to f.
Section names are expected to be consecutive integer numbers, starting from 0.
Panics if N is not a positive number while shards are required.
Types ¶
type Storage ¶ added in v0.46.0
type Storage struct {
ShardPoolSize int `mapstructure:"shard_pool_size"`
ShardROErrorThreshold int `mapstructure:"shard_ro_error_threshold"`
PutRetryTimeout time.Duration `mapstructure:"put_retry_timeout"`
IgnoreUninitedShards bool `mapstructure:"ignore_uninited_shards"`
Default shardconfig.ShardDetails `mapstructure:"shard_defaults"`
ShardList []shardconfig.ShardDetails `mapstructure:"shards"`
}
Storage contains configuration for the storage engine.
Click to show internal directories.
Click to hide internal directories.