2018-10-02 15:06:37 +00:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/influxdata/platform/tsdb"
|
2018-10-06 00:15:44 +00:00
|
|
|
"github.com/influxdata/platform/tsdb/tsi1"
|
2018-10-02 15:06:37 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Config defaults
|
2018-10-09 18:43:10 +00:00
|
|
|
const (
|
|
|
|
DefaultRetentionInterval = 3600 // 1 hour.
|
|
|
|
)
|
2018-10-02 15:06:37 +00:00
|
|
|
|
|
|
|
// Config holds the configuration for an Engine.
|
|
|
|
type Config struct {
|
2018-10-10 14:35:05 +00:00
|
|
|
RetentionInterval int64 `toml:"retention_interval"` // Frequency of retention in seconds.
|
2018-10-09 18:43:10 +00:00
|
|
|
|
2018-10-02 15:06:37 +00:00
|
|
|
EngineOptions tsdb.EngineOptions `toml:"-"`
|
|
|
|
Index tsi1.Config `toml:"index"`
|
2018-10-03 18:34:34 +00:00
|
|
|
tsdb.Config
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewConfig initialises a new config for an Engine.
|
|
|
|
func NewConfig() Config {
|
|
|
|
return Config{
|
2018-10-09 18:43:10 +00:00
|
|
|
RetentionInterval: DefaultRetentionInterval,
|
|
|
|
EngineOptions: tsdb.NewEngineOptions(),
|
|
|
|
Index: tsi1.NewConfig(),
|
|
|
|
Config: tsdb.NewConfig(),
|
2018-10-03 18:34:34 +00:00
|
|
|
}
|
2018-10-02 15:06:37 +00:00
|
|
|
}
|