table

package
v0.0.0-...-034a78d Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	// FileNumber returns file name for store builder
	FileNumber() int64
	// Add puts k/v pair init sst file write buffer
	// NOTICE: key must key in sort by desc
	Add(key uint32, value []byte) error
	// MinKey returns min key in store
	MinKey() uint32
	// MaxKey returns max key in store
	MaxKey() uint32
	// Size returns the length of store file
	Size() int32
	// Count returns the number of k/v pairs contained in the store
	Count() uint64
	// Close closes sst file write buffer
	Close() error
}

Builder builds sst file

func NewStoreBuilder

func NewStoreBuilder(path string, fileNumber int64) (Builder, error)

NewStoreBuilder creates store builder instance for building store file

type Cache

type Cache interface {
	// GetReader returns store reader from cache, create new reader if not exist.
	GetReader(family string, fileNumber int64) (Reader, error)
	// Close cleans cache data after closing reader resource firstly
	Close() error
}

Cache caches table readers

func NewCache

func NewCache(storePath string) Cache

NewCache creates cache for store readers

type Iterator

type Iterator interface {
	// Next moves the iterator to the next key/value pair.
	// It returns false if the iterator is exhausted.
	Next() bool
	// Key returns the key of the current key/value pair
	Key() uint32
	// Value returns the value of the current key/value pair
	Value() []byte
}

Iterator iterates over a store's key/value pairs in key order.

type Reader

type Reader interface {
	// Get returns value for giving key
	Get(key uint32) []byte
	// Iterator iterates over a store's key/value pairs in key order.
	Iterator() Iterator
	// Close closes reader, release related resources
	Close() error
}

Reader reads k/v pair from store file

Jump to

Keyboard shortcuts

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