package precreator
import "github.com/influxdata/influxdb/services/precreator"
Package precreator provides the shard precreation service.
Index ¶
- Constants
- type Config
- func NewConfig() Config
- func (c Config) Diagnostics() (*diagnostics.Diagnostics, error)
- func (c Config) Validate() error
- type Service
Constants ¶
const ( // DefaultCheckInterval is the shard precreation check time if none is specified. DefaultCheckInterval = 10 * time.Minute // DefaultAdvancePeriod is the default period ahead of the endtime of a shard group // that its successor group is created. DefaultAdvancePeriod = 30 * time.Minute )
Types ¶
type Config ¶
type Config struct { Enabled bool `toml:"enabled"` CheckInterval toml.Duration `toml:"check-interval"` AdvancePeriod toml.Duration `toml:"advance-period"` }
Config represents the configuration for shard precreation.
func NewConfig ¶
func NewConfig() Config
NewConfig returns a new Config with defaults.
func (Config) Diagnostics ¶
func (c Config) Diagnostics() (*diagnostics.Diagnostics, error)
Diagnostics returns a diagnostics representation of a subset of the Config.
func (Config) Validate ¶
Validate returns an error if the Config is invalid.
type Service ¶
type Service struct { Logger *zap.Logger MetaClient interface { PrecreateShardGroups(now, cutoff time.Time) error } // contains filtered or unexported fields }
Service manages the shard precreation service.
func NewService ¶
NewService returns an instance of the precreation service.
func (*Service) Close ¶
Close stops the precreation service.
func (*Service) Open ¶
Open starts the precreation service.
func (*Service) WithLogger ¶
WithLogger sets the logger for the service.
Source Files ¶
- Version
- v1.12.0 (latest)
- Published
- Apr 8, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 2 days ago –
Tools for package owners.