2018-10-02 15:06:37 +00:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
2021-10-04 19:38:09 +00:00
|
|
|
"time"
|
|
|
|
|
2020-08-26 17:46:47 +00:00
|
|
|
"github.com/influxdata/influxdb/v2/tsdb"
|
2020-09-09 18:04:46 +00:00
|
|
|
"github.com/influxdata/influxdb/v2/v1/services/precreator"
|
2020-09-09 16:48:47 +00:00
|
|
|
"github.com/influxdata/influxdb/v2/v1/services/retention"
|
2018-10-09 18:43:10 +00:00
|
|
|
)
|
2018-10-02 15:06:37 +00:00
|
|
|
|
2021-10-04 19:38:09 +00:00
|
|
|
// DefaultWriteTimeout is the default timeout for a complete write to succeed.
|
|
|
|
const DefaultWriteTimeout = 10 * time.Second
|
|
|
|
|
2018-10-02 15:06:37 +00:00
|
|
|
// Config holds the configuration for an Engine.
|
|
|
|
type Config struct {
|
2021-10-04 19:38:09 +00:00
|
|
|
Data tsdb.Config
|
|
|
|
WriteTimeout time.Duration
|
2020-04-24 16:47:22 +00:00
|
|
|
|
2020-09-09 16:48:47 +00:00
|
|
|
RetentionService retention.Config
|
2020-09-09 18:04:46 +00:00
|
|
|
PrecreatorConfig precreator.Config
|
2018-10-03 18:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewConfig initialises a new config for an Engine.
|
|
|
|
func NewConfig() Config {
|
|
|
|
return Config{
|
2020-09-09 16:48:47 +00:00
|
|
|
Data: tsdb.NewConfig(),
|
2021-10-04 19:38:09 +00:00
|
|
|
WriteTimeout: DefaultWriteTimeout,
|
2020-09-09 16:48:47 +00:00
|
|
|
RetentionService: retention.NewConfig(),
|
2020-09-09 18:04:46 +00:00
|
|
|
PrecreatorConfig: precreator.NewConfig(),
|
2018-11-07 23:27:02 +00:00
|
|
|
}
|
|
|
|
}
|