Documentation
¶
Index ¶
- Variables
- type BlockQueueStore
- func (s BlockQueueStore) CreateBuckets(tx *bbolt.Tx) error
- func (s BlockQueueStore) DeleteEntry(tx *bbolt.Tx, index uint64, id string) error
- func (s BlockQueueStore) ListEntries(tx *bbolt.Tx) iter.Iterator[compaction.BlockEntry]
- func (s BlockQueueStore) StoreEntry(tx *bbolt.Tx, entry compaction.BlockEntry) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidBlockEntry = errors.New("invalid block entry")
Functions ¶
This section is empty.
Types ¶
type BlockQueueStore ¶
type BlockQueueStore struct {
// contains filtered or unexported fields
}
BlockQueueStore provides methods to store and retrieve block queues. The store is optimized for two cases: load the entire queue (preserving the original order) and remove an entry from the queue.
Compactor maintains an in-memory queue of blocks to compact, therefore the store never reads individual entries.
NOTE(kolesnikovae): We can leverage the fact that removed entries are always ordered in ascending order by index and use the same cursor when removing entries from the database: DeleteEntry(*bbolt.Tx, ...store.BlockEntry) error
func NewBlockQueueStore ¶
func NewBlockQueueStore() *BlockQueueStore
func (BlockQueueStore) CreateBuckets ¶
func (s BlockQueueStore) CreateBuckets(tx *bbolt.Tx) error
func (BlockQueueStore) DeleteEntry ¶
func (BlockQueueStore) ListEntries ¶
func (s BlockQueueStore) ListEntries(tx *bbolt.Tx) iter.Iterator[compaction.BlockEntry]
func (BlockQueueStore) StoreEntry ¶
func (s BlockQueueStore) StoreEntry(tx *bbolt.Tx, entry compaction.BlockEntry) error
Click to show internal directories.
Click to hide internal directories.