Documentation
¶
Index ¶
- Variables
- type Entry
- type IndexStore
- type Partition
- func (p *Partition) AddTenantShard(tenant string, shard uint32)
- func (p *Partition) Compare(other *Partition) int
- func (p *Partition) EndTime() time.Time
- func (p *Partition) HasIndexShard(tenant string, shard uint32) bool
- func (p *Partition) HasTenant(t string) bool
- func (p *Partition) Overlaps(start, end time.Time) bool
- func (p *Partition) StartTime() time.Time
- type PartitionKey
- func (k PartitionKey) Bytes() []byte
- func (k *PartitionKey) EndTime() time.Time
- func (k PartitionKey) Equal(x PartitionKey) bool
- func (k PartitionKey) MarshalBinary() ([]byte, error)
- func (k *PartitionKey) Overlaps(start, end time.Time) bool
- func (k *PartitionKey) StartTime() time.Time
- func (k PartitionKey) String() string
- func (k *PartitionKey) UnmarshalBinary(b []byte) error
- type Shard
- func (s *Shard) Blocks(tx *bbolt.Tx) *store.CursorIterator
- func (s *Shard) Delete(tx *bbolt.Tx, blocks ...string) error
- func (s *Shard) Find(tx *bbolt.Tx, blocks ...string) []store.KV
- func (s *Shard) Overlaps(start, end time.Time) bool
- func (s *Shard) ShallowCopy() *Shard
- func (s *Shard) Store(tx *bbolt.Tx, md *metastorev1.BlockMeta) error
- type ShardIndex
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidStringTable = errors.New("malformed string table") ErrInvalidShardIndex = errors.New("malformed shard index") )
View Source
var ErrInvalidPartitionKey = errors.New("invalid partition key")
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) ListPartitions ¶
func (m *IndexStore) ListPartitions(tx *bbolt.Tx) ([]*Partition, error)
func (*IndexStore) LoadShard ¶ added in v1.13.3
func (m *IndexStore) LoadShard(tx *bbolt.Tx, p PartitionKey, tenant string, shard uint32) (*Shard, 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 (*Partition) HasIndexShard ¶ added in v1.13.3
type PartitionKey ¶
func NewPartitionKey ¶
func NewPartitionKey(timestamp time.Time, duration time.Duration) PartitionKey
func (PartitionKey) Bytes ¶
func (k PartitionKey) Bytes() []byte
func (*PartitionKey) EndTime ¶ added in v1.13.3
func (k *PartitionKey) EndTime() time.Time
func (PartitionKey) Equal ¶
func (k PartitionKey) Equal(x PartitionKey) bool
func (PartitionKey) MarshalBinary ¶
func (k PartitionKey) MarshalBinary() ([]byte, error)
func (*PartitionKey) Overlaps ¶ added in v1.13.3
func (k *PartitionKey) Overlaps(start, end time.Time) bool
func (*PartitionKey) StartTime ¶ added in v1.13.3
func (k *PartitionKey) StartTime() time.Time
func (PartitionKey) String ¶
func (k PartitionKey) String() string
func (*PartitionKey) UnmarshalBinary ¶
func (k *PartitionKey) UnmarshalBinary(b []byte) error
type Shard ¶ added in v1.13.3
type Shard struct {
Partition PartitionKey
Tenant string
Shard uint32
*metadata.StringTable
ShardIndex
}
func (*Shard) ShallowCopy ¶ added in v1.13.3
ShallowCopy creates a shallow copy: no deep copy of the string table. The copy can be accessed safely by multiple readers, and it represents a snapshot of the string table at the time of the copy.
Strings added after the copy is made won't be visible to the reader. The writer MUST invalidate the cache before access: copies in-use can still be used (strings is a header copy of append-only slice).
type ShardIndex ¶ added in v1.13.3
func (*ShardIndex) MarshalBinary ¶ added in v1.13.3
func (i *ShardIndex) MarshalBinary() []byte
func (*ShardIndex) UnmarshalBinary ¶ added in v1.13.3
func (i *ShardIndex) UnmarshalBinary(data []byte) error
Click to show internal directories.
Click to hide internal directories.