Documentation
¶
Index ¶
- func GetEtcdAddrs(store kv.Storage) (kv.EtcdBackend, []string, error)
- func GetSystemStorage() kv.Storage
- func InitStorage(keyspaceName string) (kv.Storage, error)
- func IsKeyspaceNotExistError(err error) bool
- func IsNotBootstrappedError(err error) bool
- func MustInitStorage(keyspaceName string) kv.Storage
- func New(path string) (kv.Storage, error)
- func NewEtcdCli(store kv.Storage) (*clientv3.Client, error)
- func NewEtcdCliWithAddrs(addrs []string, ebd kv.EtcdBackend) (*clientv3.Client, error)
- func Register(tp config.StoreType, driver kv.Driver) error
- func SetSystemStorage(s kv.Storage)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEtcdAddrs ¶
GetEtcdAddrs gets the etcd addrs from store if the store support it.
func GetSystemStorage ¶
GetSystemStorage returns the kv.Storage for the SYSTEM keyspace.
func InitStorage ¶
InitStorage initializes the kv.Storage for the given keyspace name.
func IsKeyspaceNotExistError ¶
IsKeyspaceNotExistError returns true the error is caused by keyspace not exists.
func IsNotBootstrappedError ¶
IsNotBootstrappedError returns true if the error is pd not bootstrapped error.
func MustInitStorage ¶
MustInitStorage initializes the kv.Storage for this instance.
func New ¶
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 ¶
NewEtcdCli creates a new clientv3.Client from store if the store support it. the returned client will have the same keyspace the store, and it might be nil. TODO currently uni-store/mock-tikv/tikv all implements EtcdBackend while they don't support actually. refactor this part.
func NewEtcdCliWithAddrs ¶
NewEtcdCliWithAddrs creates a new clientv3.Client with specified addrs and etcd backend.
func Register ¶
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.
func SetSystemStorage ¶
SetSystemStorage returns the kv.Storage for the SYSTEM keyspace. it's only used in test.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package pdtypes contains type defines under PD.
|
Package pdtypes contains type defines under PD. |