store

package
v1.1.0-beta.0...-2ca497e Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEtcdAddrs

func GetEtcdAddrs(store kv.Storage) (kv.EtcdBackend, []string, error)

GetEtcdAddrs gets the etcd addrs from store if the store support it.

func IsKeyspaceNotExistError

func IsKeyspaceNotExistError(err error) bool

IsKeyspaceNotExistError returns true the error is caused by keyspace not exists.

func IsNotBootstrappedError

func IsNotBootstrappedError(err error) bool

IsNotBootstrappedError returns true if the error is pd not bootstrapped error.

func New

func New(path string) (kv.Storage, error)

New creates a kv Storage with path.

The path must be a URL format 'engine://path?params' like the one for session.Open() but with the dbname cut off. Examples:

goleveldb://relative/path
boltdb:///absolute/path

The engine should be registered before creating storage.

func NewEtcdCli

func NewEtcdCli(store kv.Storage) (*clientv3.Client, error)

NewEtcdCli creates a new clientv3.Client from store if the store support it. the returned client might be nil. TODO currently uni-store/mock-tikv/tikv all implements EtcdBackend while they don't support actually. refactor this part.

func NewEtcdCliWithAddrs

func NewEtcdCliWithAddrs(addrs []string, ebd kv.EtcdBackend) (*clientv3.Client, error)

NewEtcdCliWithAddrs creates a new clientv3.Client with specified addrs and etcd backend.

func Register

func Register(tp config.StoreType, driver kv.Driver) error

Register registers a kv storage with unique name and its associated Driver. TODO: remove this function and use driver directly, TiDB is not a SDK.

Types

This section is empty.

Jump to

Keyboard shortcuts

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