Documentation ¶
Index ¶
- type BoltDBIndexClient
- type Config
- type IndexSet
- type StorageClient
- type Table
- func (t *Table) Close()
- func (t *Table) DropUnusedIndex(ttl time.Duration, now time.Time) (bool, error)
- func (t *Table) EnsureQueryReadiness(ctx context.Context) error
- func (t *Table) MultiQueries(ctx context.Context, queries []chunk.IndexQuery, callback chunk_util.Callback) error
- func (t *Table) Sync(ctx context.Context) error
- type TableManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltDBIndexClient ¶
type IndexSet ¶
type IndexSet interface { Init() error Close() MultiQueries(ctx context.Context, queries []chunk.IndexQuery, callback chunk_util.Callback) error DropAllDBs() error Err() error LastUsedAt() time.Time UpdateLastUsedAt() Sync(ctx context.Context) (err error) AwaitReady(ctx context.Context) error }
func NewIndexSet ¶
type StorageClient ¶
type StorageClient interface { ListTables(ctx context.Context) ([]string, error) ListFiles(ctx context.Context, tableName string) ([]storage.IndexFile, error) GetFile(ctx context.Context, tableName, fileName string) (io.ReadCloser, error) GetUserFile(ctx context.Context, tableName, userID, fileName string) (io.ReadCloser, error) IsFileNotFoundErr(err error) bool }
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 LoadTable ¶
func LoadTable(name, cacheLocation string, storageClient storage.Client, boltDBIndexClient BoltDBIndexClient, metrics *metrics) (*Table, error)
LoadTable loads a table from local storage(syncs the table too if we have it locally) or downloads it from the shared store. It is used for loading and initializing table at startup. It would initialize index sets which already had files locally.
func NewTable ¶
func NewTable(name, cacheLocation string, storageClient storage.Client, boltDBIndexClient BoltDBIndexClient, metrics *metrics) *Table
NewTable just creates an instance of Table without trying to load files from local storage or object store. It is used for initializing table at query time.
func (*Table) DropUnusedIndex ¶
DropUnusedIndex drops the index set if it has not been queried for at least ttl duration. It returns true if the whole table gets dropped.
func (*Table) EnsureQueryReadiness ¶
func (*Table) MultiQueries ¶
func (t *Table) MultiQueries(ctx context.Context, queries []chunk.IndexQuery, callback chunk_util.Callback) error
MultiQueries runs multiple queries without having to take lock multiple times for each query.
type TableManager ¶
type TableManager struct {
// contains filtered or unexported fields
}
func NewTableManager ¶
func NewTableManager(cfg Config, boltIndexClient BoltDBIndexClient, indexStorageClient storage.Client, registerer prometheus.Registerer) (*TableManager, error)
func (*TableManager) QueryPages ¶
func (tm *TableManager) QueryPages(ctx context.Context, queries []chunk.IndexQuery, callback chunk_util.Callback) error
func (*TableManager) Stop ¶
func (tm *TableManager) Stop()