store

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPartitionKey = errors.New("invalid partition key")
View Source
var (
	ErrInvalidStringTable = errors.New("malformed string table")
)

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Partition   PartitionKey
	Shard       uint32
	Tenant      string
	BlockID     string
	BlockMeta   *metastorev1.BlockMeta
	StringTable *metadata.StringTable
}

type IndexStore

type IndexStore struct{}

func NewIndexStore

func NewIndexStore() *IndexStore

func (*IndexStore) CreateBuckets

func (m *IndexStore) CreateBuckets(tx *bbolt.Tx) error

func (*IndexStore) DeleteBlockList

func (m *IndexStore) DeleteBlockList(tx *bbolt.Tx, p PartitionKey, list *metastorev1.BlockList) error

func (*IndexStore) ListPartitions

func (m *IndexStore) ListPartitions(tx *bbolt.Tx) ([]*Partition, error)

func (*IndexStore) LoadTenantShard

func (m *IndexStore) LoadTenantShard(tx *bbolt.Tx, p PartitionKey, tenant string, shard uint32) (*TenantShard, error)

func (*IndexStore) StoreBlock

func (m *IndexStore) StoreBlock(tx *bbolt.Tx, shard *TenantShard, md *metastorev1.BlockMeta) error

type Partition

type Partition struct {
	Key          PartitionKey
	TenantShards map[string]map[uint32]struct{}
}

func NewPartition

func NewPartition(k PartitionKey) *Partition

func (*Partition) AddTenantShard

func (p *Partition) AddTenantShard(tenant string, shard uint32)

func (*Partition) Compare

func (p *Partition) Compare(other *Partition) int

func (*Partition) EndTime

func (p *Partition) EndTime() time.Time

func (*Partition) HasTenant

func (p *Partition) HasTenant(t string) bool

func (*Partition) Overlaps

func (p *Partition) Overlaps(start, end time.Time) bool

func (*Partition) StartTime

func (p *Partition) StartTime() time.Time

type PartitionKey

type PartitionKey struct {
	Timestamp time.Time
	Duration  time.Duration
}

func NewPartitionKey

func NewPartitionKey(timestamp time.Time, duration time.Duration) PartitionKey

func (PartitionKey) Bytes

func (k PartitionKey) Bytes() []byte

func (PartitionKey) Equal

func (k PartitionKey) Equal(x PartitionKey) bool

func (PartitionKey) MarshalBinary

func (k PartitionKey) MarshalBinary() ([]byte, error)

func (PartitionKey) String

func (k PartitionKey) String() string

func (*PartitionKey) UnmarshalBinary

func (k *PartitionKey) UnmarshalBinary(b []byte) error

type TenantShard

type TenantShard struct {
	Partition   PartitionKey
	Tenant      string
	Shard       uint32
	Blocks      []*metastorev1.BlockMeta
	StringTable *metadata.StringTable
}

Jump to

Keyboard shortcuts

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