engineconfig

package
v0.48.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

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.

func (*Storage) Normalize added in v0.46.0

func (s *Storage) Normalize()

Normalize ensures that all fields of Storage have valid values. If some of fields are not set or have invalid values, they will be set to default values.

Directories

Path Synopsis
gc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL