disk

package
v0.0.0-...-2e114fc Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiskWriterOverrideOpt = "writer"
	DiskReaderOverrideOpt = "reader"

	SegmentNameOpt = "name"
)

disk backend specific options

Variables

This section is empty.

Functions

func NewDiskStorage

func NewDiskStorage(options storage.Options) storage.Storage

Types

type BloomFilter

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

implement both Filter and Storage

func (*BloomFilter) Check

func (b *BloomFilter) Check(key *storage.InternalKey) bool

func (*BloomFilter) Set

func (b *BloomFilter) Set(key *storage.InternalKey)

type DiskStorage

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

func (*DiskStorage) Close

func (ds *DiskStorage) Close()

func (*DiskStorage) Count

func (ds *DiskStorage) Count() int

func (*DiskStorage) Del

func (ds *DiskStorage) Del(key *storage.InternalKey) error

func (*DiskStorage) Get

func (ds *DiskStorage) Get(key *storage.InternalKey) ([]byte, error)

func (*DiskStorage) IsIndexFile

func (ds *DiskStorage) IsIndexFile() bool

func (*DiskStorage) LoadIndex

func (ds *DiskStorage) LoadIndex()

func (*DiskStorage) Put

func (ds *DiskStorage) Put(key *storage.InternalKey, value []byte) error

func (*DiskStorage) Scan

func (ds *DiskStorage) Scan(f func(k *storage.InternalKey, v []byte) bool)

func (*DiskStorage) Size

func (ds *DiskStorage) Size() int

type DiskStorageIndex

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

func (*DiskStorageIndex) BuildIndex

func (idx *DiskStorageIndex) BuildIndex(rd io.ReadSeeker)

func (*DiskStorageIndex) GetOffset

func (idx *DiskStorageIndex) GetOffset(key *storage.InternalKey) (int64, error)

func (*DiskStorageIndex) Save

func (idx *DiskStorageIndex) Save()

type Filter

type Filter interface {
	Set(key *storage.InternalKey)
	Check(key *storage.InternalKey) bool
}

func NewBloomFilter

func NewBloomFilter(s storage.Storage) Filter

TODO: n comes from #keys of storage

type Index

type Index interface {
	// return file offset from key
	GetOffset(key *storage.InternalKey) (int64, error)
}

func LoadIndex

func LoadIndex(segment string) Index

Jump to

Keyboard shortcuts

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