rocksdb

package
v0.0.0-...-76a7b18 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CompressionNone   CompressionType = 0x0
	CompressionSnappy                 = 0x1
	CompressionLz4                    = 0x4
	CompressionZstd                   = 0x7
)
View Source
const (
	ChecksumNone   ChecksumType = 0x0
	ChecksumCRC32               = 0x1
	ChecksumXXHash              = 0x2
)

Variables

View Source
var (
	ErrChecksumMismatch    = errors.New("Checksum mismatch")
	ErrMagicNumberMismatch = errors.New("Magic number mismatch")
)
View Source
var (
	ErrKeyOrder       = errors.New("Keys must be added in order")
	ErrNotSupportType = errors.New("Value type is not supported")
)
View Source
var ErrDecompress = errors.New("Error during decompress")

Functions

func CompressBlock

func CompressBlock(tp CompressionType, input, dst []byte) ([]byte, bool)

func DecompressBlock

func DecompressBlock(tp CompressionType, input, dst []byte) ([]byte, error)

Types

type BlockBasedTableBuilder

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

func NewBlockBasedTableBuilder

func NewBlockBasedTableBuilder(f *os.File, opts *BlockBasedTableOptions) *BlockBasedTableBuilder

func (*BlockBasedTableBuilder) Add

func (b *BlockBasedTableBuilder) Add(key, value []byte) error

func (*BlockBasedTableBuilder) Finish

func (b *BlockBasedTableBuilder) Finish() error

type BlockBasedTableOptions

type BlockBasedTableOptions struct {
	BlockSize                 int
	BlockSizeDeviation        int
	BlockRestartInterval      int
	IndexBlockRestartInterval int
	BlockAlign                bool
	CompressionType           CompressionType
	ChecksumType              ChecksumType
	EnableIndexCompression    bool
	CreationTime              uint64
	OldestKeyTime             uint64

	PropsInjectors []PropsInjector

	BloomBitsPerKey   int
	BloomNumProbes    int
	WholeKeyFiltering bool

	PrefixExtractorName string
	PrefixExtractor     SliceTransform

	Comparator   Comparator
	BufferSize   int
	BytesPerSync int
	RateLimiter  *rate.Limiter
}

func NewDefaultBlockBasedTableOptions

func NewDefaultBlockBasedTableOptions(cmp Comparator) *BlockBasedTableOptions

type ChecksumType

type ChecksumType uint8

type CompactedEvent

type CompactedEvent struct {
	OutputLevel      int
	TotalInputBytes  int
	TotalOutputBytes int
	StartKey         []byte
	EndKey           []byte
}

type Comparator

type Comparator func(key1 []byte, key2 []byte) int

func (Comparator) CompareInternalKey

func (c Comparator) CompareInternalKey(key1, key2 []byte) int

CompareInternalKey compares two keys order by:

increasing user key (according to user-supplied comparator)
decreasing sequence number
decreasing type (though sequence# should be enough to disambiguate)

type CompressionType

type CompressionType uint8

func (CompressionType) String

func (tp CompressionType) String() string

type FixedPrefixSliceTransform

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

func NewFixedPrefixSliceTransform

func NewFixedPrefixSliceTransform(prefixLen int) *FixedPrefixSliceTransform

func (*FixedPrefixSliceTransform) InDomain

func (st *FixedPrefixSliceTransform) InDomain(key []byte) bool

func (*FixedPrefixSliceTransform) InRange

func (st *FixedPrefixSliceTransform) InRange(key []byte) bool

func (*FixedPrefixSliceTransform) Transform

func (st *FixedPrefixSliceTransform) Transform(key []byte) []byte

type FixedSuffixSliceTransform

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

func NewFixedSuffixSliceTransform

func NewFixedSuffixSliceTransform(suffixLen int) *FixedSuffixSliceTransform

func (*FixedSuffixSliceTransform) InDomain

func (st *FixedSuffixSliceTransform) InDomain(key []byte) bool

func (*FixedSuffixSliceTransform) InRange

func (st *FixedSuffixSliceTransform) InRange(key []byte) bool

func (*FixedSuffixSliceTransform) Transform

func (st *FixedSuffixSliceTransform) Transform(key []byte) []byte

type InternalKey

type InternalKey struct {
	UserKey        []byte
	SequenceNumber uint64
	ValueType      ValueType
}

func (*InternalKey) Decode

func (ikey *InternalKey) Decode(encoded []byte)

func (*InternalKey) Encode

func (ikey *InternalKey) Encode() []byte

type NoopSliceTransform

type NoopSliceTransform struct{}

func NewNoopSliceTransform

func NewNoopSliceTransform() *NoopSliceTransform

func (*NoopSliceTransform) InDomain

func (st *NoopSliceTransform) InDomain(key []byte) bool

func (*NoopSliceTransform) InRange

func (st *NoopSliceTransform) InRange(key []byte) bool

func (*NoopSliceTransform) Transform

func (st *NoopSliceTransform) Transform(key []byte) []byte

type PropsBlockBuilder

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

func (*PropsBlockBuilder) Add

func (b *PropsBlockBuilder) Add(name string, value []byte)

func (*PropsBlockBuilder) AddString

func (b *PropsBlockBuilder) AddString(name, value string)

func (*PropsBlockBuilder) AddUint64

func (b *PropsBlockBuilder) AddUint64(name string, value uint64)

func (*PropsBlockBuilder) Finish

func (b *PropsBlockBuilder) Finish() []byte

type PropsInjector

type PropsInjector func(*PropsBlockBuilder)

type SliceTransform

type SliceTransform interface {
	Transform([]byte) []byte
	InDomain([]byte) bool
	InRange([]byte) bool
}

type SstFileIterator

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

func NewSstFileIterator

func NewSstFileIterator(f *os.File) (*SstFileIterator, error)

func (*SstFileIterator) Err

func (it *SstFileIterator) Err() error

func (*SstFileIterator) Key

func (it *SstFileIterator) Key() InternalKey

func (*SstFileIterator) Next

func (it *SstFileIterator) Next()

func (*SstFileIterator) SeekToFirst

func (it *SstFileIterator) SeekToFirst()

func (*SstFileIterator) Valid

func (it *SstFileIterator) Valid() bool

func (*SstFileIterator) Value

func (it *SstFileIterator) Value() []byte

type SstFileWriter

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

func NewSstFileWriter

func NewSstFileWriter(f *os.File, opts *BlockBasedTableOptions) *SstFileWriter

func (*SstFileWriter) Close

func (w *SstFileWriter) Close() error

func (*SstFileWriter) Delete

func (w *SstFileWriter) Delete(key []byte) error

func (*SstFileWriter) Finish

func (w *SstFileWriter) Finish() error

func (*SstFileWriter) Merge

func (w *SstFileWriter) Merge(key, value []byte) error

func (*SstFileWriter) Put

func (w *SstFileWriter) Put(key, value []byte) error

type TableProperties

type TableProperties struct {
	DataSize            uint64
	IndexSize           uint64
	FilterSize          uint64
	RawKeySize          uint64
	RawValueSize        uint64
	NumDataBlocks       uint64
	NumEntries          uint64
	ColumnFamilyID      uint64
	ColumnFamilyName    string
	CompressionName     string
	FilterPolicyName    string
	CreationTime        uint64
	OldestKeyTime       uint64
	PrefixExtractorName string
}

type ValueType

type ValueType uint8
const (
	TypeDeletion ValueType = iota
	TypeValue
	TypeMerge
)

func (ValueType) IsValue

func (vt ValueType) IsValue() bool

Jump to

Keyboard shortcuts

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