Documentation ¶
Index ¶
- Variables
- type BucketFinder
- type BucketService
- func (s *BucketService) CreateBucket(ctx context.Context, b *influxdb.Bucket) (err error)
- func (s *BucketService) DeleteBucket(ctx context.Context, bucketID influxdb.ID) error
- func (s *BucketService) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (b *influxdb.Bucket, err error)
- type BufferedPointsWriter
- type Config
- type Engine
- func (e *Engine) BackupKVStore(ctx context.Context, w io.Writer) error
- func (e *Engine) BackupShard(ctx context.Context, w io.Writer, shardID uint64, since time.Time) error
- func (e *Engine) Close() error
- func (e *Engine) CreateBucket(ctx context.Context, b *influxdb.Bucket) (err error)
- func (e *Engine) DeleteBucket(ctx context.Context, orgID, bucketID influxdb.ID) error
- func (e *Engine) DeleteBucketRangePredicate(ctx context.Context, orgID, bucketID influxdb.ID, min, max int64, ...) error
- func (e *Engine) DisableCompactions()
- func (e *Engine) EnableCompactions()
- func (e *Engine) MetaClient() MetaClient
- func (e *Engine) Open(ctx context.Context) (err error)
- func (e *Engine) Path() string
- func (e *Engine) PrometheusCollectors() []prometheus.Collector
- func (e *Engine) RestoreBucket(ctx context.Context, id influxdb.ID, buf []byte) (map[uint64]uint64, error)
- func (e *Engine) RestoreKVStore(ctx context.Context, r io.Reader) error
- func (e *Engine) RestoreShard(ctx context.Context, shardID uint64, r io.Reader) error
- func (e *Engine) SeriesCardinality(orgID, bucketID influxdb.ID) int64
- func (e *Engine) TSDBStore() TSDBStore
- func (e *Engine) UpdateBucketRetentionPeriod(ctx context.Context, bucketID influxdb.ID, d time.Duration) error
- func (e *Engine) WithLogger(log *zap.Logger)
- func (e *Engine) WritePoints(ctx context.Context, orgID influxdb.ID, bucketID influxdb.ID, ...) error
- type EngineSchema
- type LoggingPointsWriter
- type MetaClient
- type Option
- type PointsWriter
- type TSDBStore
Constants ¶
This section is empty.
Variables ¶
var ( // ErrEngineClosed is returned when a caller attempts to use the engine while // it's closed. ErrEngineClosed = errors.New("engine is closed") // ErrNotImplemented is returned for APIs that are temporarily not implemented. ErrNotImplemented = errors.New("not implemented") )
Functions ¶
This section is empty.
Types ¶
type BucketFinder ¶
type BucketFinder interface {
FindBuckets(context.Context, influxdb.BucketFilter, ...influxdb.FindOptions) ([]*influxdb.Bucket, int, error)
}
A BucketFinder is responsible for providing access to buckets via a filter.
type BucketService ¶
type BucketService struct { influxdb.BucketService // contains filtered or unexported fields }
BucketService wraps an existing influxdb.BucketService implementation.
BucketService ensures that when a bucket is deleted, all stored data associated with the bucket is either removed, or marked to be removed via a future compaction.
func NewBucketService ¶
func NewBucketService(log *zap.Logger, s influxdb.BucketService, engine EngineSchema) *BucketService
NewBucketService returns a new BucketService for the provided EngineSchema, which typically will be an Engine.
func (*BucketService) CreateBucket ¶
func (s *BucketService) CreateBucket(ctx context.Context, b *influxdb.Bucket) (err error)
func (*BucketService) DeleteBucket ¶
func (s *BucketService) DeleteBucket(ctx context.Context, bucketID influxdb.ID) error
DeleteBucket removes a bucket by ID.
func (*BucketService) UpdateBucket ¶
func (s *BucketService) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (b *influxdb.Bucket, err error)
type BufferedPointsWriter ¶
type BufferedPointsWriter struct {
// contains filtered or unexported fields
}
func NewBufferedPointsWriter ¶
func NewBufferedPointsWriter(orgID influxdb.ID, bucketID influxdb.ID, size int, pointswriter PointsWriter) *BufferedPointsWriter
func (*BufferedPointsWriter) Available ¶
func (b *BufferedPointsWriter) Available() int
Available returns how many models.Points are unused in the buffer.
func (*BufferedPointsWriter) Buffered ¶
func (b *BufferedPointsWriter) Buffered() int
Buffered returns the number of models.Points that have been written into the current buffer.
func (*BufferedPointsWriter) Flush ¶
func (b *BufferedPointsWriter) Flush(ctx context.Context) error
Flush writes any buffered data to the underlying PointsWriter.
func (*BufferedPointsWriter) WritePoints ¶
WritePoints writes the points to the underlying PointsWriter.
type Config ¶
type Config struct { Data tsdb.Config RetentionService retention.Config PrecreatorConfig precreator.Config }
Config holds the configuration for an Engine.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewEngine ¶
NewEngine initialises a new storage engine, including a series file, index and TSM engine.
func (*Engine) BackupKVStore ¶
func (*Engine) BackupShard ¶
func (*Engine) Close ¶
Close closes the store and all underlying resources. It returns an error if any of the underlying systems fail to close.
func (*Engine) CreateBucket ¶
func (*Engine) DeleteBucket ¶
DeleteBucket deletes an entire bucket from the storage engine.
func (*Engine) DeleteBucketRangePredicate ¶
func (e *Engine) DeleteBucketRangePredicate(ctx context.Context, orgID, bucketID influxdb.ID, min, max int64, pred influxdb.Predicate) error
DeleteBucketRangePredicate deletes data within a bucket from the storage engine. Any data deleted must be in [min, max], and the key must match the predicate if provided.
func (*Engine) DisableCompactions ¶
func (e *Engine) DisableCompactions()
DisableCompactions disables compactions in the series file, index, & engine.
func (*Engine) EnableCompactions ¶
func (e *Engine) EnableCompactions()
EnableCompactions allows the series file, index, & underlying engine to compact.
func (*Engine) MetaClient ¶
func (e *Engine) MetaClient() MetaClient
func (*Engine) Open ¶
Open opens the store and all underlying resources. It returns an error if any of the underlying systems fail to open.
func (*Engine) PrometheusCollectors ¶
func (e *Engine) PrometheusCollectors() []prometheus.Collector
PrometheusCollectors returns all the prometheus collectors associated with the engine and its components.
func (*Engine) RestoreBucket ¶
func (*Engine) RestoreKVStore ¶
func (*Engine) RestoreShard ¶
func (*Engine) SeriesCardinality ¶
SeriesCardinality returns the number of series in the engine.
func (*Engine) UpdateBucketRetentionPeriod ¶
func (*Engine) WithLogger ¶
WithLogger sets the logger on the Store. It must be called before Open.
func (*Engine) WritePoints ¶
func (e *Engine) WritePoints(ctx context.Context, orgID influxdb.ID, bucketID influxdb.ID, points []models.Point) error
WritePoints writes the provided points to the engine.
The Engine expects all points to have been correctly validated by the caller. However, WritePoints will determine if any tag key-pairs are missing, or if there are any field type conflicts. Rosalie was here lockdown 2020
Appropriate errors are returned in those cases.
type EngineSchema ¶
type LoggingPointsWriter ¶
type LoggingPointsWriter struct { // Wrapped points writer. Errored writes from here will be logged. Underlying PointsWriter // Service used to look up logging bucket. BucketFinder BucketFinder // Name of the bucket to log to. LogBucketName string }
LoggingPointsWriter wraps an underlying points writer but writes logs to another bucket when an error occurs.
func (*LoggingPointsWriter) WritePoints ¶
func (w *LoggingPointsWriter) WritePoints(ctx context.Context, orgID influxdb.ID, bucketID influxdb.ID, p []models.Point) error
WritePoints writes points to the underlying PointsWriter. Logs on error.
type MetaClient ¶
type MetaClient interface { CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error) CreateShardGroup(database, policy string, timestamp time.Time) (*meta.ShardGroupInfo, error) Database(name string) (di *meta.DatabaseInfo) Databases() []meta.DatabaseInfo DeleteShardGroup(database, policy string, id uint64) error PrecreateShardGroups(now, cutoff time.Time) error PruneShardGroups() error RetentionPolicy(database, policy string) (*meta.RetentionPolicyInfo, error) ShardGroupsByTimeRange(database, policy string, min, max time.Time) (a []meta.ShardGroupInfo, err error) UpdateRetentionPolicy(database, name string, rpu *meta.RetentionPolicyUpdate, makeDefault bool) error Backup(ctx context.Context, w io.Writer) error Restore(ctx context.Context, r io.Reader) error Data() meta.Data SetData(data *meta.Data) error }
type Option ¶
type Option func(*Engine)
Option provides a set
func WithMetaClient ¶
func WithMetaClient(c MetaClient) Option
type PointsWriter ¶
type PointsWriter interface {
WritePoints(ctx context.Context, orgID influxdb.ID, bucketID influxdb.ID, points []models.Point) error
}
PointsWriter describes the ability to write points into a storage engine.
type TSDBStore ¶
type TSDBStore interface { DeleteMeasurement(database, name string) error DeleteSeries(database string, sources []influxql.Source, condition influxql.Expr) error MeasurementNames(auth query.Authorizer, database string, cond influxql.Expr) ([][]byte, error) ShardGroup(ids []uint64) tsdb.ShardGroup Shards(ids []uint64) []*tsdb.Shard TagKeys(auth query.Authorizer, shardIDs []uint64, cond influxql.Expr) ([]tsdb.TagKeys, error) TagValues(auth query.Authorizer, shardIDs []uint64, cond influxql.Expr) ([]tsdb.TagValues, error) }