persistence

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNCONFIGURED_DISK_FREE_PERCENT_TARGET = -1
	UNCONFIGURED_RETENTION_PERIOD         = -1
	UNCONFIGURED_EXPIRY_FREQUENCY         = -1
	UNCONFIGURED_METRICS_EMIT_DURATION    = -1
	UNKNOWN_DISK_FREE_PERCENT             = 100
)

Variables

This section is empty.

Functions

func OpenTsStore

func OpenTsStore(storagePath string) (*tsdb.Store, error)

Types

type Adapter added in v1.2.1

type Adapter interface {
	WritePoints(points []*rpc.Point) error
}

type Appender added in v1.2.1

type Appender struct {
	// contains filtered or unexported fields
}

func NewAppender added in v1.2.1

func NewAppender(adapter Adapter, metrics metrics.Registrar, opts ...AppenderOption) *Appender

func (*Appender) Append added in v1.6.0

func (a *Appender) Append(ref storage.SeriesRef, l labels.Labels, time int64, value float64) (storage.SeriesRef, error)

func (*Appender) AppendExemplar added in v1.6.0

func (a *Appender) AppendExemplar(ref storage.SeriesRef, l labels.Labels, e exemplar.Exemplar) (storage.SeriesRef, error)

func (*Appender) AppendHistogram added in v1.6.0

func (*Appender) Commit added in v1.2.1

func (a *Appender) Commit() error

func (*Appender) Rollback added in v1.2.1

func (a *Appender) Rollback() error

func (*Appender) UpdateMetadata added in v1.6.0

func (a *Appender) UpdateMetadata(ref storage.SeriesRef, l labels.Labels, m metadata.Metadata) (storage.SeriesRef, error)

type AppenderOption added in v1.2.1

type AppenderOption func(*Appender)

func WithAppenderLogger added in v1.2.1

func WithAppenderLogger(log *logger.Logger) AppenderOption

func WithLabelTruncationLength

func WithLabelTruncationLength(length uint) AppenderOption

type InfluxAdapter

type InfluxAdapter struct {
	// contains filtered or unexported fields
}

func NewInfluxAdapter

func NewInfluxAdapter(influx InfluxStore, metrics metrics.Registrar, log *logger.Logger) *InfluxAdapter

func (*InfluxAdapter) AllMeasurementNames

func (t *InfluxAdapter) AllMeasurementNames() []string

func (*InfluxAdapter) AllTagKeys

func (t *InfluxAdapter) AllTagKeys(ctx context.Context) []string

func (*InfluxAdapter) AllTagValues

func (t *InfluxAdapter) AllTagValues(ctx context.Context, tagKey string) []string

func (*InfluxAdapter) Close

func (t *InfluxAdapter) Close() error

func (*InfluxAdapter) Delete

func (t *InfluxAdapter) Delete(shardID uint64) error

func (*InfluxAdapter) DeleteOlderThan

func (t *InfluxAdapter) DeleteOlderThan(cutoff int64) (uint64, error)

func (*InfluxAdapter) DeleteOldest

func (t *InfluxAdapter) DeleteOldest() error

func (*InfluxAdapter) GetPoints

func (t *InfluxAdapter) GetPoints(ctx context.Context, measurementName string, start, end int64, matchers []*labels.Matcher) (*transform.SeriesSetBuilder, error)

func (*InfluxAdapter) OldestContiguousShardID added in v1.2.1

func (t *InfluxAdapter) OldestContiguousShardID() (uint64, error)

OldestContiguousShardID returns the oldest shardID known to the adapter, that is part of the unbroken series closest to the newest shardID

func (*InfluxAdapter) OldestShardID added in v1.2.1

func (t *InfluxAdapter) OldestShardID() (uint64, error)

OldestShardID returns the absolute oldest shardID known to the adapter, regardless of potential time gaps between shards

func (*InfluxAdapter) ShardIDs

func (t *InfluxAdapter) ShardIDs() []uint64

ShardIDs returns all shardIDs known to the adapter, sorted newest to oldest

func (*InfluxAdapter) ShardIDsOldestSort added in v1.2.1

func (t *InfluxAdapter) ShardIDsOldestSort() []uint64

func (*InfluxAdapter) WritePoints

func (t *InfluxAdapter) WritePoints(points []*rpc.Point) error

type InfluxStore

type InfluxStore interface {
	Close() error
	CreateShard(database string, retentionPolicy string, shardId uint64, enabled bool) error
	DeleteShard(shardId uint64) error
	ShardGroup(shardIds []uint64) tsdb.ShardGroup
	ShardIDs() []uint64
	Shards(ids []uint64) []*tsdb.Shard
	Statistics(database map[string]string) []models.Statistic
	TagKeys(ctx context.Context, auth query.FineAuthorizer, shardIDs []uint64, cond influxql.Expr) ([]tsdb.TagKeys, error)
	TagValues(ctx context.Context, auth query.FineAuthorizer, shardIDs []uint64, cond influxql.Expr) ([]tsdb.TagValues, error)
	WriteToShard(shardId uint64, points []models.Point) error
}

type Querier added in v1.2.1

type Querier struct {
	// contains filtered or unexported fields
}

func NewQuerier added in v1.2.1

func NewQuerier(ctx context.Context, adapter *InfluxAdapter, metrics metrics.Registrar) *Querier

func (*Querier) Close added in v1.2.1

func (q *Querier) Close() error

func (*Querier) LabelNames added in v1.2.1

func (q *Querier) LabelNames(matchers ...*labels.Matcher) ([]string, storage.Warnings, error)

func (*Querier) LabelValues added in v1.2.1

func (q *Querier) LabelValues(name string, matchers ...*labels.Matcher) ([]string, storage.Warnings, error)

func (*Querier) Select added in v1.2.1

func (q *Querier) Select(sortSeries bool, params *storage.SelectHints, labelMatchers ...*labels.Matcher) storage.SeriesSet

type RetentionConfig added in v1.2.1

type RetentionConfig struct {
	RetentionPeriod       time.Duration
	ExpiryFrequency       time.Duration
	DiskFreePercentTarget float64
}

type ShardIDs added in v1.2.1

type ShardIDs []uint64

func (ShardIDs) Len added in v1.2.1

func (s ShardIDs) Len() int

func (ShardIDs) Less added in v1.2.1

func (s ShardIDs) Less(i int, j int) bool

func (ShardIDs) Swap added in v1.2.1

func (s ShardIDs) Swap(i int, j int)

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(storagePath string, metrics metrics.Registrar, opts ...StoreOption) *Store

func (*Store) Appender added in v1.2.1

func (store *Store) Appender(ctx context.Context) storage.Appender

func (*Store) ChunkQuerier added in v1.6.0

func (store *Store) ChunkQuerier(ctx context.Context, mint, maxt int64) (storage.ChunkQuerier, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Compact added in v1.2.1

func (store *Store) Compact()

func (*Store) Querier added in v1.2.1

func (store *Store) Querier(ctx context.Context, mint, maxt int64) (storage.Querier, error)

func (*Store) StartTime added in v1.2.1

func (s *Store) StartTime() (int64, error)

type StoreOption added in v1.2.1

type StoreOption func(*Store)

func WithAppenderLabelTruncationLength added in v1.2.1

func WithAppenderLabelTruncationLength(length uint) StoreOption

func WithDiskFreeReporter added in v1.2.1

func WithDiskFreeReporter(diskFreeReporter func() (float64, error)) StoreOption

func WithLogger added in v1.2.1

func WithLogger(log *logger.Logger) StoreOption

func WithMetricsEmitDuration added in v1.2.1

func WithMetricsEmitDuration(metricsEmitDuration time.Duration) StoreOption

WithMetricsEmitDuration sets the duration to which periodic metrics are emitted

func WithRetentionConfig added in v1.2.1

func WithRetentionConfig(config RetentionConfig) StoreOption

WithRetentionConfig sets the frequency of automated cleanup that expires old data.

type UintSlice added in v1.2.1

type UintSlice []uint64

func (UintSlice) Len added in v1.2.1

func (u UintSlice) Len() int

func (UintSlice) Less added in v1.2.1

func (u UintSlice) Less(i, j int) bool

func (UintSlice) Swap added in v1.2.1

func (u UintSlice) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL