rocks

package
v0.0.0-...-e1f8a17 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorShutdownInProgress error if shut down in progress
	ErrorShutdownInProgress = errors.New("shutdown in progress")
)

Functions

This section is empty.

Types

type Rocks

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

Rocks has options to run a local rocksdb instance

func NewDb

func NewDb(path string, mergeOperator gorocksdb.MergeOperator) *Rocks

NewDb creates a local rocksdb instance

func (*Rocks) AddSstByWriter

func (d *Rocks) AddSstByWriter(name string, writerFunc func(*gorocksdb.SSTFileWriter) (int64, error)) error

AddSstByWriter add SST by ingesting behind

func (*Rocks) Close

func (d *Rocks) Close()

Close shuts down local rocksdb

func (*Rocks) Compact

func (d *Rocks) Compact()

func (*Rocks) CompleteClusterResize

func (d *Rocks) CompleteClusterResize()

func (*Rocks) Delete

func (d *Rocks) Delete(k []byte) (err error)

Delete deletes from local rocksdb

func (*Rocks) Destroy

func (d *Rocks) Destroy()

Destroy removes all data for the local rocksdb

func (*Rocks) EnsureDirectory

func (d *Rocks) EnsureDirectory()

func (*Rocks) FullScan

func (d *Rocks) FullScan(batchSize uint64, limit uint64, fn func([]*pb.RawKeyValue) error) error

FullScan scan through all entries

func (*Rocks) Get

func (d *Rocks) Get(key []byte) (data []byte, err error)

Get gets from local rocksdb

func (*Rocks) GetLiveFilesMetaData

func (d *Rocks) GetLiveFilesMetaData() []gorocksdb.LiveFileMetadata

GetLiveFilesMetaData returns the list of meta data of the live files

func (*Rocks) LiveFilesSize

func (d *Rocks) LiveFilesSize() (sum uint64)

LiveFilesSize returns the size of live files

func (*Rocks) Merge

func (d *Rocks) Merge(key []byte, msg []byte) (err error)

Merge merges to local rocksdb

func (*Rocks) PrefixScan

func (d *Rocks) PrefixScan(prefix, lastKey []byte, limit int, fn func(key, value []byte) bool) error

PrefixScan paginate through all entries with the prefix the first scan can have empty lastKey and limit = 0

func (*Rocks) PrepareForClusterResize

func (d *Rocks) PrepareForClusterResize()

func (*Rocks) Put

func (d *Rocks) Put(key []byte, msg []byte) (err error)

Put puts to local rocksdb

func (*Rocks) Reopen

func (d *Rocks) Reopen()

func (*Rocks) SetCompactionForShard

func (d *Rocks) SetCompactionForShard(shardId, shardCount int)

SetCompactionForShard changes the compaction filter to use the shardId and shardCount. All entries not belong to the shard will be physically purged during next compaction.

Source Files

  • rocksdb.go
  • rocksdb_full_scan.go
  • rocksdb_prefix_scan.go
  • rocksdb_shard.go
  • rocksdb_sst.go

Jump to

Keyboard shortcuts

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