downloads

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDBIndexClient

type BoltDBIndexClient interface {
	QueryDB(ctx context.Context, db *bbolt.DB, query chunk.IndexQuery, callback func(chunk.IndexQuery, chunk.ReadBatch) (shouldContinue bool)) error
}

type Config

type Config struct {
	CacheDir     string
	SyncInterval time.Duration
	CacheTTL     time.Duration
}

type StorageClient

type StorageClient interface {
	GetObject(ctx context.Context, objectKey string) (io.ReadCloser, error)
	List(ctx context.Context, prefix, delimiter string) ([]chunk.StorageObject, []chunk.StorageCommonPrefix, error)
}

type Table

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

Table is a collection of multiple files created for a same table by various ingesters. All the public methods are concurrency safe and take care of mutexes to avoid any data race.

func NewTable

func NewTable(spanCtx context.Context, name, cacheLocation string, storageClient StorageClient, metrics *metrics) *Table

func (*Table) CleanupAllDBs

func (t *Table) CleanupAllDBs() error

Closes reference to all the open dbs and removes the local file.

func (*Table) Close

func (t *Table) Close()

Closes references to all the dbs.

func (*Table) Err

func (t *Table) Err() error

Err returns the err which is usually set when there was any issue in init.

func (*Table) LastUsedAt

func (t *Table) LastUsedAt() time.Time

LastUsedAt returns the time at which table was last used for querying.

func (*Table) MultiQueries

func (t *Table) MultiQueries(ctx context.Context, queries []bluge_db.IndexQuery, callback segment.StoredFieldVisitor) error

MultiQueries runs multiple queries without having to take lock multiple times for each query.

func (*Table) Sync

func (t *Table) Sync(ctx context.Context) error

Sync downloads updated and new files from the storage relevant for the table and removes the deleted ones

type TableManager

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

func NewTableManager

func NewTableManager(cfg Config, storageClient StorageClient, registerer prometheus.Registerer) (*TableManager, error)

将object store 数据定时缓存到本地,提供查询接口供查询 根据 最后被使用时间(被查询),计算ttl实现缓存的自动过期。

func (*TableManager) QueryPages

func (tm *TableManager) QueryPages(ctx context.Context, queries []bluge_db.IndexQuery, callback segment.StoredFieldVisitor) error

func (*TableManager) Stop

func (tm *TableManager) Stop()

Jump to

Keyboard shortcuts

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