localstore

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2017 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrDBClosed is the error meaning db is closed and we can use it anymore.
	ErrDBClosed = errors.New("db is closed")
)
View Source
var ErrInvalidEncodedKey = errors.New("invalid encoded key")

ErrInvalidEncodedKey describes parsing an invalid format of EncodedKey.

View Source
var ErrOverflow = errors.New("overflow when allocating new version")

ErrOverflow is the error returned by CurrentVersion, it describes if there're too many versions allocations in a very short period of time, ID may conflict.

View Source
var MockRemoteStore bool

MockRemoteStore mocks remote store. It makes IsLocalStore return false.

Functions

func ChangeRegionInfo

func ChangeRegionInfo(store kv.Storage, regionID int, startKey, endKey []byte)

ChangeRegionInfo used for test handling region info change.

func IsLocalStore

func IsLocalStore(s kv.Storage) bool

IsLocalStore checks whether a storage is local or not.

func MvccDecode

func MvccDecode(encodedKey kv.EncodedKey) (kv.Key, kv.Version, error)

MvccDecode parses the origin key and version of an encoded key, if the encoded key is a meta key, just returns the origin key.

func MvccEncodeVersionKey

func MvccEncodeVersionKey(key kv.Key, ver kv.Version) kv.EncodedKey

MvccEncodeVersionKey returns the encoded key.

Types

type Driver

type Driver struct {
	// engine.Driver is the engine driver for different local db engine.
	engine.Driver
}

Driver implements kv.Driver interface.

func (Driver) Open

func (d Driver) Open(path string) (kv.Storage, error)

Open opens or creates a storage with specific format for a local engine Driver. The path should be a URL format which is described in tidb package.

type LocalVersionProvider

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

LocalVersionProvider uses local timestamp for version.

func (*LocalVersionProvider) CurrentVersion

func (l *LocalVersionProvider) CurrentVersion() (kv.Version, error)

CurrentVersion implements the VersionProvider's GetCurrentVer interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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