table

package
v0.0.0-...-3976360 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTableMagicNumberWrong = errors.New("leveldb: corrupt table: wrong magic number")

Functions

func ReadBlock

func ReadBlock(r io.ReaderAt, fileNumber uint64, h block.Handle, verifyChecksums bool) ([]byte, error)

func ReadDataBlock

func ReadDataBlock(r io.ReaderAt, fileNumber uint64, h block.Handle, verifyChecksums bool) (*block.Block, error)

Types

type BlockCache

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

func NewBlockCache

func NewBlockCache(cap int) *BlockCache

func (*BlockCache) Evict

func (c *BlockCache) Evict(fileNumber uint64)

func (*BlockCache) Read

func (c *BlockCache) Read(r io.ReaderAt, fileNumber uint64, h block.Handle, verifyChecksums bool, dontFill bool) (*block.Block, error)

type Cache

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

func NewCache

func NewCache(dbname string, opts *options.Options) *Cache

func (*Cache) Close

func (c *Cache) Close() error

func (*Cache) Evict

func (c *Cache) Evict(fileNumber uint64)

func (*Cache) Get

func (c *Cache) Get(fileNumber uint64, fileSize uint64, ikey keys.InternalKey, opts *options.ReadOptions) ([]byte, error, bool)

func (*Cache) NewIterator

func (c *Cache) NewIterator(fileNumber uint64, fileSize uint64, opts *options.ReadOptions) iterator.Iterator
type Footer struct {
	MetaIndexHandle block.Handle
	DataIndexHandle block.Handle
}

func (*Footer) Encode

func (f *Footer) Encode(buf []byte) int

func (*Footer) Unmarshal

func (f *Footer) Unmarshal(buf []byte) error

type Table

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

func OpenTable

func OpenTable(f file.ReadCloser, blocks *BlockCache, opts *options.Options, number, size uint64) (t *Table, err error)

func (*Table) Close

func (t *Table) Close() error

func (*Table) Get

func (t *Table) Get(ikey keys.InternalKey, opts *options.ReadOptions) ([]byte, error, bool)

func (*Table) NewIterator

func (t *Table) NewIterator(opts *options.ReadOptions) iterator.Iterator

type Writer

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

func (*Writer) Add

func (w *Writer) Add(key, value []byte) error

func (*Writer) Empty

func (w *Writer) Empty() bool

func (*Writer) FileSize

func (w *Writer) FileSize() int64

func (*Writer) Finish

func (w *Writer) Finish() (err error)

func (*Writer) LastKey

func (w *Writer) LastKey() []byte

func (*Writer) Reset

func (w *Writer) Reset(f io.Writer, opts *options.Options)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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