snappy

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CompatModeEnabled = iota
	CompatModeDisabled
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SnappyBatch

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

func NewSnappyBatch

func NewSnappyBatch(batch tmdb.Batch) *SnappyBatch

func (*SnappyBatch) Close

func (s *SnappyBatch) Close() error

func (*SnappyBatch) Delete

func (s *SnappyBatch) Delete(key []byte) error

func (*SnappyBatch) Set

func (s *SnappyBatch) Set(key, value []byte) error

func (*SnappyBatch) Write

func (s *SnappyBatch) Write() error

func (*SnappyBatch) WriteSync

func (s *SnappyBatch) WriteSync() error

type SnappyDB

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

SnappyDB implements a tmdb.DB overlay with snappy compression/decompression Iterator is NOT supported -- main purpose of this library is to support indexer.db, which never makes use of iterators anyway NOTE: implement when needed NOTE2: monitor mem pressure, optimize by pre-allocating dst buf when there is bottleneck

func NewSnappyDB

func NewSnappyDB(db tmdb.DB, compatMode int) *SnappyDB

func (*SnappyDB) Close

func (s *SnappyDB) Close() error

func (*SnappyDB) Delete

func (s *SnappyDB) Delete(key []byte) error

func (*SnappyDB) DeleteSync

func (s *SnappyDB) DeleteSync(key []byte) error

func (*SnappyDB) Get

func (s *SnappyDB) Get(key []byte) ([]byte, error)

func (*SnappyDB) Has

func (s *SnappyDB) Has(key []byte) (bool, error)

func (*SnappyDB) Iterator

func (s *SnappyDB) Iterator(start, end []byte) (tmdb.Iterator, error)

func (*SnappyDB) NewBatch

func (s *SnappyDB) NewBatch() tmdb.Batch

func (*SnappyDB) Print

func (s *SnappyDB) Print() error

func (*SnappyDB) ReverseIterator

func (s *SnappyDB) ReverseIterator(start, end []byte) (tmdb.Iterator, error)

func (*SnappyDB) Set

func (s *SnappyDB) Set(key []byte, value []byte) error

func (*SnappyDB) SetSync

func (s *SnappyDB) SetSync(key []byte, value []byte) error

func (*SnappyDB) Stats

func (s *SnappyDB) Stats() map[string]string

Jump to

Keyboard shortcuts

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