Versions in this module Expand all Collapse all v1 v1.7.9 Oct 27, 2019 Changes in this version + const DefaultMaxConcurrentQueries + const DefaultMaxSelectPointN + const DefaultMaxSelectSeriesN + const DefaultWriteTimeout + var ErrDatabaseNameRequired = errors.New("database name required") + var ErrPartialWrite = errors.New("partial write") + var ErrTimeout = errors.New("timeout") + var ErrWriteFailed = errors.New("write failed") + type BufferedPointsWriter struct + func NewBufferedPointsWriter(w pointsWriter, database, retentionPolicy string, capacity int) *BufferedPointsWriter + func (w *BufferedPointsWriter) Cap() int + func (w *BufferedPointsWriter) Flush() error + func (w *BufferedPointsWriter) Len() int + func (w *BufferedPointsWriter) WritePointsInto(req *IntoWriteRequest) error + type Config struct + LogQueriesAfter toml.Duration + MaxConcurrentQueries int + MaxSelectBucketsN int + MaxSelectPointN int + MaxSelectSeriesN int + QueryTimeout toml.Duration + WriteTimeout toml.Duration + func NewConfig() Config + func (c Config) Diagnostics() (*diagnostics.Diagnostics, error) + type IntoWriteRequest struct + Database string + Points []models.Point + RetentionPolicy string + type IteratorCreator interface + type LocalShardMapper struct + MetaClient interface{ ... } + TSDBStore interface{ ... } + func (e *LocalShardMapper) MapShards(sources influxql.Sources, t influxql.TimeRange, opt query.SelectOptions) (query.ShardGroup, error) + type LocalShardMapping struct + MaxTime time.Time + MinTime time.Time + ShardMap map[Source]tsdb.ShardGroup + func (a *LocalShardMapping) Close() error + func (a *LocalShardMapping) CreateIterator(ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions) (query.Iterator, error) + func (a *LocalShardMapping) FieldDimensions(m *influxql.Measurement) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error) + func (a *LocalShardMapping) IteratorCost(m *influxql.Measurement, opt query.IteratorOptions) (query.IteratorCost, error) + func (a *LocalShardMapping) MapType(m *influxql.Measurement, field string) influxql.DataType + type LocalTSDBStore struct + type MetaClient interface + CreateContinuousQuery func(database, name, query string) error + CreateDatabase func(name string) (*meta.DatabaseInfo, error) + CreateDatabaseWithRetentionPolicy func(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error) + CreateRetentionPolicy func(database string, spec *meta.RetentionPolicySpec, makeDefault bool) (*meta.RetentionPolicyInfo, error) + CreateSubscription func(database, rp, name, mode string, destinations []string) error + CreateUser func(name, password string, admin bool) (meta.User, error) + Database func(name string) *meta.DatabaseInfo + Databases func() []meta.DatabaseInfo + DropContinuousQuery func(database, name string) error + DropDatabase func(name string) error + DropRetentionPolicy func(database, name string) error + DropShard func(id uint64) error + DropSubscription func(database, rp, name string) error + DropUser func(name string) error + RetentionPolicy func(database, name string) (rpi *meta.RetentionPolicyInfo, err error) + SetAdminPrivilege func(username string, admin bool) error + SetPrivilege func(username, database string, p influxql.Privilege) error + ShardGroupsByTimeRange func(database, policy string, min, max time.Time) (a []meta.ShardGroupInfo, err error) + TruncateShardGroups func(t time.Time) error + UpdateRetentionPolicy func(database, name string, rpu *meta.RetentionPolicyUpdate, makeDefault bool) error + UpdateUser func(name, password string) error + UserPrivilege func(username, database string) (*influxql.Privilege, error) + UserPrivileges func(username string) (map[string]influxql.Privilege, error) + Users func() []meta.UserInfo + type PointsWriter struct + Logger *zap.Logger + MetaClient interface{ ... } + Node *influxdb.Node + TSDBStore interface{ ... } + WriteTimeout time.Duration + func NewPointsWriter() *PointsWriter + func (w *PointsWriter) AddWriteSubscriber(c chan<- *WritePointsRequest) + func (w *PointsWriter) Close() error + func (w *PointsWriter) MapShards(wp *WritePointsRequest) (*ShardMapping, error) + func (w *PointsWriter) Open() error + func (w *PointsWriter) Statistics(tags map[string]string) []models.Statistic + func (w *PointsWriter) WithLogger(log *zap.Logger) + func (w *PointsWriter) WritePoints(database, retentionPolicy string, consistencyLevel models.ConsistencyLevel, ...) error + func (w *PointsWriter) WritePointsInto(p *IntoWriteRequest) error + func (w *PointsWriter) WritePointsPrivileged(database, retentionPolicy string, consistencyLevel models.ConsistencyLevel, ...) error + type ShardIteratorCreator interface + ShardIteratorCreator func(id uint64) query.IteratorCreator + type ShardMapping struct + Dropped []models.Point + Points map[uint64][]models.Point + Shards map[uint64]*meta.ShardInfo + func NewShardMapping(n int) *ShardMapping + func (s *ShardMapping) MapPoint(shardInfo *meta.ShardInfo, p models.Point) + type Source struct + Database string + RetentionPolicy string + type StatementExecutor struct + MaxSelectBucketsN int + MaxSelectPointN int + MaxSelectSeriesN int + MetaClient MetaClient + Monitor *monitor.Monitor + PointsWriter interface{ ... } + ShardMapper query.ShardMapper + TSDBStore TSDBStore + TaskManager query.StatementExecutor + func (e *StatementExecutor) ExecuteStatement(stmt influxql.Statement, ctx *query.ExecutionContext) error + func (e *StatementExecutor) NormalizeStatement(stmt influxql.Statement, defaultDatabase, defaultRetentionPolicy string) (err error) + type TSDBStore interface + BackupShard func(id uint64, since time.Time, w io.Writer) error + CreateShard func(database, policy string, shardID uint64, enabled bool) error + DeleteDatabase func(name string) error + DeleteMeasurement func(database, name string) error + DeleteRetentionPolicy func(database, name string) error + DeleteSeries func(database string, sources []influxql.Source, condition influxql.Expr) error + DeleteShard func(id uint64) error + MeasurementNames func(auth query.Authorizer, database string, cond influxql.Expr) ([][]byte, error) + MeasurementsCardinality func(database string) (int64, error) + RestoreShard func(id uint64, r io.Reader) error + SeriesCardinality func(database string) (int64, error) + TagKeys func(auth query.Authorizer, shardIDs []uint64, cond influxql.Expr) ([]tsdb.TagKeys, error) + TagValues func(auth query.Authorizer, shardIDs []uint64, cond influxql.Expr) ([]tsdb.TagValues, error) + WriteToShard func(shardID uint64, points []models.Point) error + type WritePointsRequest struct + Database string + Points []models.Point + RetentionPolicy string + func (w *WritePointsRequest) AddPoint(name string, value interface{}, timestamp time.Time, tags map[string]string) + type WriteStatistics struct + PointWriteReq int64 + PointWriteReqLocal int64 + SubWriteDrop int64 + SubWriteOK int64 + WriteDropped int64 + WriteErr int64 + WriteOK int64 + WriteReq int64 + WriteTimeout int64