Versions in this module Expand all Collapse all v3 v3.0.0 Apr 8, 2024 Changes in this version + const BlocksPrefix + const BloomPrefix + const MetasPrefix + func LoadBlocksDirIntoCache(paths []string, c Cache, logger log.Logger) error + func ParseTime(s string) (model.Time, error) + type Block struct + Data io.ReadSeekCloser + func BlockFrom(tenant, table string, blk *v1.Block) (Block, error) + func CompressBloomBlock(ref BlockRef, archivePath, localDst string, logger log.Logger) (Block, error) + type BlockClient interface + DeleteBlocks func(ctx context.Context, refs []BlockRef) error + GetBlock func(ctx context.Context, ref BlockRef) (BlockDirectory, error) + GetBlocks func(ctx context.Context, refs []BlockRef) ([]BlockDirectory, error) + PutBlock func(ctx context.Context, block Block) error + type BlockDirectory struct + Path string + func NewBlockDirectory(ref BlockRef, path string) BlockDirectory + func (b BlockDirectory) Block(metrics *v1.Metrics) *v1.Block + func (b BlockDirectory) BlockQuerier(usePool bool, close func() error, maxPageSize int, metrics *v1.Metrics) *CloseableBlockQuerier + func (b BlockDirectory) Size() int64 + type BlockRef struct + func BlockRefFrom(tenant, table string, md v1.BlockMetadata) BlockRef + func BlocksForMetas(metas []Meta, interval Interval, keyspaces []v1.FingerprintBounds) (refs []BlockRef) + func (r BlockRef) String() string + type BlocksCache struct + func NewFsBlocksCache(cfg config.BlocksCacheConfig, reg prometheus.Registerer, logger log.Logger) *BlocksCache + func (c *BlocksCache) Get(ctx context.Context, key string) (BlockDirectory, bool) + func (c *BlocksCache) Put(ctx context.Context, key string, value BlockDirectory) error + func (c *BlocksCache) PutInc(ctx context.Context, key string, value BlockDirectory) error + func (c *BlocksCache) PutMany(ctx context.Context, keys []string, values []BlockDirectory) error + func (c *BlocksCache) Release(ctx context.Context, key string) error + func (c *BlocksCache) Stop() + type BloomClient struct + func NewBloomClient(cfg bloomStoreConfig, client client.ObjectClient, logger log.Logger) (*BloomClient, error) + func (b *BloomClient) DeleteBlocks(ctx context.Context, references []BlockRef) error + func (b *BloomClient) DeleteMetas(ctx context.Context, refs []MetaRef) error + func (b *BloomClient) GetBlock(ctx context.Context, ref BlockRef) (BlockDirectory, error) + func (b *BloomClient) GetBlocks(ctx context.Context, refs []BlockRef) ([]BlockDirectory, error) + func (b *BloomClient) GetMeta(ctx context.Context, ref MetaRef) (Meta, error) + func (b *BloomClient) GetMetas(ctx context.Context, refs []MetaRef) ([]Meta, error) + func (b *BloomClient) IsObjectNotFoundErr(err error) bool + func (b *BloomClient) ObjectClient() client.ObjectClient + func (b *BloomClient) PutBlock(ctx context.Context, block Block) error + func (b *BloomClient) PutMeta(ctx context.Context, meta Meta) error + func (b *BloomClient) Stop() + type BloomStore struct + func NewBloomStore(periodicConfigs []config.PeriodConfig, storageConfig storage.Config, ...) (*BloomStore, error) + func (BloomStore) ParseBlockKey(loc Location) (BlockRef, error) + func (BloomStore) ParseMetaKey(loc Location) (MetaRef, error) + func (BloomStore) Tenant(tenant, table string) Location + func (BloomStore) TenantPrefix(loc Location) (string, error) + func (b *BloomStore) Block(ref BlockRef) (loc Location) + func (b *BloomStore) BloomMetrics() *v1.Metrics + func (b *BloomStore) Client(ts model.Time) (Client, error) + func (b *BloomStore) FetchBlocks(ctx context.Context, blocks []BlockRef, opts ...FetchOption) ([]*CloseableBlockQuerier, error) + func (b *BloomStore) FetchMetas(ctx context.Context, params MetaSearchParams) ([]Meta, error) + func (b *BloomStore) Fetcher(ts model.Time) (*Fetcher, error) + func (b *BloomStore) Meta(ref MetaRef) (loc Location) + func (b *BloomStore) ResolveMetas(ctx context.Context, params MetaSearchParams) ([][]MetaRef, []*Fetcher, error) + func (b *BloomStore) Stop() + func (b *BloomStore) TenantFilesForInterval(ctx context.Context, interval Interval, ...) (map[string][]client.StorageObject, error) + type Cache interface + Get func(ctx context.Context, key string) (BlockDirectory, bool) + Put func(ctx context.Context, key string, value BlockDirectory) error + PutInc func(ctx context.Context, key string, value BlockDirectory) error + PutMany func(ctx context.Context, keys []string, values []BlockDirectory) error + Release func(ctx context.Context, key string) error + Stop func() + type Client interface + IsObjectNotFoundErr func(err error) bool + ObjectClient func() client.ObjectClient + Stop func() + type ClosableReadSeekerAdapter struct + func (c ClosableReadSeekerAdapter) Close() error + type CloseableBlockQuerier struct + func (c *CloseableBlockQuerier) Close() error + func (c *CloseableBlockQuerier) SeriesIter() (v1.PeekingIterator[*v1.SeriesWithBloom], error) + type Entry struct + Key string + Value BlockDirectory + type FetchOption func(opts *options) + func WithFetchAsync(v bool) FetchOption + func WithIgnoreNotFound(v bool) FetchOption + func WithPool(v bool) FetchOption + type Fetcher struct + func NewFetcher(cfg bloomStoreConfig, client Client, metasCache cache.Cache, blocksCache Cache, ...) (*Fetcher, error) + func (f *Fetcher) Close() + func (f *Fetcher) FetchBlocks(ctx context.Context, refs []BlockRef, opts ...FetchOption) ([]*CloseableBlockQuerier, error) + func (f *Fetcher) FetchMetas(ctx context.Context, refs []MetaRef) ([]Meta, error) + type ForEachBlockCallback func(bq *v1.BlockQuerier, bounds v1.FingerprintBounds) error + type Interface interface + ForEach func(ctx context.Context, tenant string, blocks []BlockRef, ...) error + Stop func() + type Interval struct + End model.Time + Start model.Time + func NewInterval(start, end model.Time) Interval + func ParseIntervalFromAddr(s string) (Interval, error) + func ParseIntervalFromParts(a, b string) (Interval, error) + func (i Interval) Cmp(ts model.Time) v1.BoundsCheck + func (i Interval) Hash(h hash.Hash32) error + func (i Interval) Overlaps(target Interval) bool + func (i Interval) Repr() string + func (i Interval) String() string + func (i Interval) Within(target Interval) bool + type KeyResolver interface + Block func(BlockRef) Location + Meta func(MetaRef) Location + ParseBlockKey func(Location) (BlockRef, error) + ParseMetaKey func(Location) (MetaRef, error) + Tenant func(tenant, table string) Location + TenantPrefix func(loc Location) (string, error) + func NewPrefixedResolver(prefix string, resolver KeyResolver) KeyResolver + func NewShardedPrefixedResolver(prefixes []string, resolver KeyResolver) (KeyResolver, error) + type Location interface + Addr func() string + LocalPath func() string + type Meta struct + Blocks []BlockRef + Sources []tsdb.SingleTenantTSDBIdentifier + func (m Meta) MostRecentSource() (tsdb.SingleTenantTSDBIdentifier, error) + type MetaClient interface + DeleteMetas func(ctx context.Context, refs []MetaRef) error + GetMeta func(ctx context.Context, ref MetaRef) (Meta, error) + GetMetas func(ctx context.Context, refs []MetaRef) ([]Meta, error) + PutMeta func(ctx context.Context, meta Meta) error + type MetaRef struct + func MetaRefFrom(tenant, table string, bounds v1.FingerprintBounds, ...) (MetaRef, error) + func (r MetaRef) String() string + type MetaSearchParams struct + Interval Interval + Keyspace v1.FingerprintBounds + TenantID string + type PrefixedResolver struct + func (p PrefixedResolver) Block(ref BlockRef) Location + func (p PrefixedResolver) Meta(ref MetaRef) Location + type Ref struct + Bounds v1.FingerprintBounds + Checksum uint32 + EndTimestamp model.Time + StartTimestamp model.Time + TableName string + TenantID string + func (r Ref) Cmp(fp uint64) v1.BoundsCheck + func (r Ref) Hash(h hash.Hash32) error + func (r Ref) Interval() Interval + type ShardedPrefixedResolver struct + func (r ShardedPrefixedResolver) Block(ref BlockRef) Location + func (r ShardedPrefixedResolver) Meta(ref MetaRef) Location + type Shipper struct + func NewShipper(client Store) *Shipper + func (s *Shipper) ForEach(ctx context.Context, refs []BlockRef, callback ForEachBlockCallback) error + func (s *Shipper) Stop() + type Store interface + Client func(ts model.Time) (Client, error) + FetchBlocks func(ctx context.Context, refs []BlockRef, opts ...FetchOption) ([]*CloseableBlockQuerier, error) + FetchMetas func(ctx context.Context, params MetaSearchParams) ([]Meta, error) + Fetcher func(ts model.Time) (*Fetcher, error) + ResolveMetas func(ctx context.Context, params MetaSearchParams) ([][]MetaRef, []*Fetcher, error) + Stop func() + TenantFilesForInterval func(ctx context.Context, interval Interval, ...) (map[string][]client.StorageObject, error) + type StoreWithMetrics interface + BloomMetrics func() *v1.Metrics