influxdb/coordinator/config.go

50 lines
1.8 KiB
Go
Raw Normal View History

// Package coordinator contains abstractions for writing points, executing statements,
// and accessing meta data.
2016-05-11 16:32:56 +00:00
package coordinator
2015-05-29 19:50:05 +00:00
2015-05-30 20:00:46 +00:00
import (
"time"
Cleanup QueryExecutor and split statement execution code The QueryExecutor had a lot of dead code made obsolete by the query engine refactor that has now been removed. The TSDBStore interface has also been cleaned up so we can have multiple implementations of this (such as a local and remote version). A StatementExecutor interface has been created for adding custom functionality to the QueryExecutor that may not be available in the open source version. The QueryExecutor delegate all statement execution to the StatementExecutor and the QueryExecutor will only keep track of housekeeping. Implementing additional queries is as simple as wrapping the cluster.StatementExecutor struct or replacing it with something completely different. The PointsWriter in the QueryExecutor has been changed to a simple interface that implements the one method needed by the query executor. This is to allow different PointsWriter implementations to be used by the QueryExecutor. It has also been moved into the StatementExecutor instead. The TSDBStore interface has now been modified to contain the code for creating an IteratorCreator. This is so the underlying TSDBStore can implement different ways of accessing the underlying shards rather than always having to access each shard individually (such as batch requests). Remove the show servers handling. This isn't a valid command in the open source version of InfluxDB anymore. The QueryManager interface is now built into QueryExecutor and is no longer necessary. The StatementExecutor and QueryExecutor split allows task management to much more easily be built into QueryExecutor rather than as a separate struct.
2016-03-31 22:12:29 +00:00
"github.com/influxdata/influxdb/influxql"
"github.com/influxdata/influxdb/toml"
2015-05-30 20:00:46 +00:00
)
const (
// DefaultWriteTimeout is the default timeout for a complete write to succeed.
2016-05-11 18:59:30 +00:00
DefaultWriteTimeout = 10 * time.Second
// DefaultMaxConcurrentQueries is the maximum number of running queries.
// A value of zero will make the maximum query limit unlimited.
DefaultMaxConcurrentQueries = 0
// DefaultMaxSelectPointN is the maximum number of points a SELECT can process.
// A value of zero will make the maximum point count unlimited.
DefaultMaxSelectPointN = 0
// DefaultMaxSelectSeriesN is the maximum number of series a SELECT can run.
// A value of zero will make the maximum series count unlimited.
DefaultMaxSelectSeriesN = 0
2015-05-30 20:00:46 +00:00
)
// Config represents the configuration for the coordinator service.
2015-05-30 20:00:46 +00:00
type Config struct {
2016-05-11 18:59:30 +00:00
WriteTimeout toml.Duration `toml:"write-timeout"`
MaxConcurrentQueries int `toml:"max-concurrent-queries"`
QueryTimeout toml.Duration `toml:"query-timeout"`
LogQueriesAfter toml.Duration `toml:"log-queries-after"`
MaxSelectPointN int `toml:"max-select-point"`
MaxSelectSeriesN int `toml:"max-select-series"`
MaxSelectBucketsN int `toml:"max-select-buckets"`
2015-05-30 20:00:46 +00:00
}
// NewConfig returns an instance of Config with defaults.
func NewConfig() Config {
return Config{
2016-05-11 18:59:30 +00:00
WriteTimeout: toml.Duration(DefaultWriteTimeout),
QueryTimeout: toml.Duration(influxql.DefaultQueryTimeout),
MaxConcurrentQueries: DefaultMaxConcurrentQueries,
MaxSelectPointN: DefaultMaxSelectPointN,
MaxSelectSeriesN: DefaultMaxSelectSeriesN,
2015-05-30 20:00:46 +00:00
}
}