2018-10-02 15:06:37 +00:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
2018-10-31 19:19:54 +00:00
|
|
|
"time"
|
|
|
|
|
2020-04-03 17:39:20 +00:00
|
|
|
"github.com/influxdata/influxdb/v2/toml"
|
2020-08-26 17:46:47 +00:00
|
|
|
"github.com/influxdata/influxdb/v2/tsdb"
|
2018-10-02 15:06:37 +00:00
|
|
|
)
|
|
|
|
|
2019-03-04 14:12:50 +00:00
|
|
|
// Default configuration values.
|
2018-10-09 18:43:10 +00:00
|
|
|
const (
|
2019-03-06 17:48:57 +00:00
|
|
|
DefaultRetentionInterval = time.Hour
|
2018-11-08 17:19:27 +00:00
|
|
|
DefaultSeriesFileDirectoryName = "_series"
|
|
|
|
DefaultIndexDirectoryName = "index"
|
|
|
|
DefaultWALDirectoryName = "wal"
|
|
|
|
DefaultEngineDirectoryName = "data"
|
2018-10-09 18:43:10 +00:00
|
|
|
)
|
2018-10-02 15:06:37 +00:00
|
|
|
|
|
|
|
// Config holds the configuration for an Engine.
|
|
|
|
type Config struct {
|
2020-07-30 20:42:37 +00:00
|
|
|
Data tsdb.Config
|
2020-04-24 16:47:22 +00:00
|
|
|
|
2018-10-31 19:19:54 +00:00
|
|
|
// Frequency of retention in seconds.
|
|
|
|
RetentionInterval toml.Duration `toml:"retention-interval"`
|
2018-10-03 18:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewConfig initialises a new config for an Engine.
|
|
|
|
func NewConfig() Config {
|
|
|
|
return Config{
|
2020-07-30 20:42:37 +00:00
|
|
|
Data: tsdb.NewConfig(),
|
2019-03-06 17:48:57 +00:00
|
|
|
RetentionInterval: toml.Duration(DefaultRetentionInterval),
|
2018-11-07 23:27:02 +00:00
|
|
|
}
|
|
|
|
}
|