compact

package
v0.0.0-...-7638244 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage represents compactor storage.

func New

func New(buffer storage.Storage, dest storage.Appender, merger storage.Merger, monitor monitor.Monitor, interval time.Duration) *Storage

New creates a new storage implementation.

func (*Storage) Append

func (s *Storage) Append(key key.Key, value []byte, ttl time.Duration) error

Append adds an event into the buffer.

func (*Storage) Close

func (s *Storage) Close() error

Close is used to gracefully close storage.

func (*Storage) Compact

func (s *Storage) Compact(ctx context.Context) (interface{}, error)

Compact runs the compaction on the storage

func (*Storage) Delete

func (s *Storage) Delete(keys ...key.Key) error

Delete deletes a key from the buffer.

func (*Storage) Range

func (s *Storage) Range(seek, until key.Key, f func(key, value []byte) bool) error

Range performs a range query against the storage. It calls f sequentially for each key and value present in the store. If f returns false, range stops the iteration. The API is designed to be very similar to the concurrent map. The implementation must guarantee that the keys are lexigraphically sorted.

Jump to

Keyboard shortcuts

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