Documentation ¶
Index ¶
- Constants
- func BoltDBToIndexFile(boltdbFile *bbolt.DB, name string) index.Index
- func OpenIndexFile(path string) (index.Index, error)
- func QueryBoltDB(ctx context.Context, db *bbolt.DB, userID []byte, queries []series_index.Query, ...) error
- type BoltDBIndexClient
- type Config
- type IndexCfg
- type IndexClient
- type IndexFile
- type Querier
- type Shipper
- type Table
- type TableManager
- type Writer
Constants ¶
const ( // create a new db sharded by time based on when write request is received ShardDBsByDuration = 15 * time.Minute )
const TempFileSuffix = ".temp"
Variables ¶
This section is empty.
Functions ¶
func BoltDBToIndexFile ¶
nolint:revive
func QueryBoltDB ¶
func QueryBoltDB(ctx context.Context, db *bbolt.DB, userID []byte, queries []series_index.Query, callback series_index.QueryPagesCallback) error
Types ¶
type BoltDBIndexClient ¶
type BoltDBIndexClient interface { QueryWithCursor(_ context.Context, c *bbolt.Cursor, query index.Query, callback index.QueryPagesCallback) error WriteToDB(ctx context.Context, db *bbolt.DB, bucketName []byte, writes local.TableWrites) error }
nolint:revive
type IndexCfg ¶
type IndexCfg struct { indexshipper.Config `yaml:",inline"` BuildPerTenantIndex bool `yaml:"build_per_tenant_index"` }
func (*IndexCfg) RegisterFlags ¶
RegisterFlags registers flags.
func (*IndexCfg) RegisterFlagsWithPrefix ¶
type IndexClient ¶
type IndexClient struct {
// contains filtered or unexported fields
}
func NewIndexClient ¶
func NewIndexClient(prefix string, cfg IndexCfg, storageClient client.ObjectClient, limits downloads.Limits, tenantFilter downloads.TenantFilter, tableRange config.TableRange, registerer prometheus.Registerer, logger log.Logger) (*IndexClient, error)
New creates a shipper for syncing local objects with a store
func (*IndexClient) BatchWrite ¶
func (i *IndexClient) BatchWrite(ctx context.Context, batch series_index.WriteBatch) error
func (*IndexClient) NewWriteBatch ¶
func (i *IndexClient) NewWriteBatch() series_index.WriteBatch
func (*IndexClient) QueryPages ¶
func (i *IndexClient) QueryPages(ctx context.Context, queries []series_index.Query, callback series_index.QueryPagesCallback) error
func (*IndexClient) Stop ¶
func (i *IndexClient) Stop()
type Querier ¶
type Querier interface {
QueryPages(ctx context.Context, queries []index.Query, callback index.QueryPagesCallback) error
}
func NewQuerier ¶
type Shipper ¶
type Shipper interface { AddIndex(tableName, userID string, index shipperindex.Index) error ForEach(ctx context.Context, tableName, userID string, callback shipperindex.ForEachIndexCallback) error }
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table is a collection of multiple index files created for a same table by the ingester. It is used on the write path for writing the index. All the public methods are concurrency safe and take care of mutexes to avoid any data race.
func LoadTable ¶
func LoadTable(path, uploader string, indexShipper Shipper, makePerTenantBuckets bool, metrics *tableManagerMetrics) (*Table, error)
LoadTable loads local dbs belonging to the table and creates a new Table with references to dbs if there are any otherwise it doesn't create a table
func NewTable ¶
func NewTable(path, uploader string, indexShipper Shipper, makePerTenantBuckets bool) (*Table, error)
NewTable create a new Table without looking for any existing local dbs belonging to the table.
func (*Table) HandoverIndexesToShipper ¶
HandoverIndexesToShipper hands over the inactive dbs to shipper for uploading
type TableManager ¶
type TableManager struct {
// contains filtered or unexported fields
}
func NewTableManager ¶
func NewTableManager(cfg Config, indexShipper Shipper, tableRange config.TableRange, registerer prometheus.Registerer, logger log.Logger) (*TableManager, error)
func (*TableManager) BatchWrite ¶
func (tm *TableManager) BatchWrite(ctx context.Context, batch index.WriteBatch) error
func (*TableManager) Stop ¶
func (tm *TableManager) Stop()