tikv

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

Running tests

Boot up a local tikv cluster:

git clone https://github.com/pingcap/tidb-docker-compose
cd tibd-docker-compose
docker-compose up

Then, extract the IPs for the different components, and put them in your /etc/hosts file:

docker inspect tidbdockercompose_tikv0_1| grep IPAddress | tail -n 1
docker inspect tidbdockercompose_tikv1_1| grep IPAddress | tail -n 1
docker inspect tidbdockercompose_tikv2_1| grep IPAddress | tail -n 1
docker inspect tidbdockercompose_pd0_1| grep IPAddress | tail -n 1
docker inspect tidbdockercompose_pd1_1| grep IPAddress | tail -n 1
docker inspect tidbdockercompose_pd2_1| grep IPAddress | tail -n 1

and put the corresponding IPs in your hosts file:

172.19.0.10  tikv2
172.19.0.8   tikv1
172.19.0.9   tikv0
172.19.0.4   pd0
172.19.0.7   pd1
172.19.0.2   pd2

Then, your tests can talk to the cluster. Tadam! This will work on Linux, not sure on a Mac.

Surely, there's a better way.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore(dsnString string, opts ...store.Option) (store.KVStore, error)

NewStore supports tikv://pd0,pd1,pd2:2379?prefix=hexkeyprefix

Types

type Store

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

func (*Store) BatchGet

func (s *Store) BatchGet(ctx context.Context, keys [][]byte) *store.Iterator

func (*Store) BatchPrefix

func (s *Store) BatchPrefix(ctx context.Context, prefixes [][]byte, limit int) *store.Iterator

func (*Store) Close

func (s *Store) Close() error

func (*Store) FlushPuts

func (s *Store) FlushPuts(ctx context.Context) error

func (*Store) Get

func (s *Store) Get(ctx context.Context, key []byte) (value []byte, err error)

func (*Store) Prefix

func (s *Store) Prefix(ctx context.Context, prefix []byte, limit int) *store.Iterator

func (*Store) Put

func (s *Store) Put(ctx context.Context, key, value []byte) (err error)

func (*Store) Scan

func (s *Store) Scan(ctx context.Context, start, exclusiveEnd []byte, limit int) *store.Iterator

Jump to

Keyboard shortcuts

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