Documentation ¶
Index ¶
- Variables
- type ContextKey
- type RawKVProxy
- func (p RawKVProxy) BatchDelete(ctx context.Context, keys [][]byte) error
- func (p RawKVProxy) BatchGet(ctx context.Context, keys [][]byte) ([][]byte, error)
- func (p RawKVProxy) BatchPut(ctx context.Context, keys, values [][]byte) error
- func (p RawKVProxy) Close(ctx context.Context) error
- func (p RawKVProxy) Delete(ctx context.Context, key []byte) error
- func (p RawKVProxy) DeleteRange(ctx context.Context, startKey []byte, endKey []byte) error
- func (p RawKVProxy) Get(ctx context.Context, key []byte) ([]byte, error)
- func (p RawKVProxy) New(ctx context.Context, pdAddrs []string, conf config.Config) (UUID, error)
- func (p RawKVProxy) Put(ctx context.Context, key, value []byte) error
- func (p RawKVProxy) ReverseScan(ctx context.Context, startKey, endKey []byte, limit int) ([][]byte, [][]byte, error)
- func (p RawKVProxy) Scan(ctx context.Context, startKey, endKey []byte, limit int) ([][]byte, [][]byte, error)
- type TxnKVProxy
- func (p TxnKVProxy) Begin(ctx context.Context) (UUID, error)
- func (p TxnKVProxy) BeginWithTS(ctx context.Context, ts uint64) (UUID, error)
- func (p TxnKVProxy) Close(ctx context.Context) error
- func (p TxnKVProxy) GetTS(ctx context.Context) (uint64, error)
- func (p TxnKVProxy) IterClose(ctx context.Context) error
- func (p TxnKVProxy) IterKey(ctx context.Context) ([]byte, error)
- func (p TxnKVProxy) IterNext(ctx context.Context) error
- func (p TxnKVProxy) IterValid(ctx context.Context) (bool, error)
- func (p TxnKVProxy) IterValue(ctx context.Context) ([]byte, error)
- func (p TxnKVProxy) New(ctx context.Context, pdAddrs []string, conf config.Config) (UUID, error)
- func (p TxnKVProxy) TxnBatchGet(ctx context.Context, keys [][]byte) (map[string][]byte, error)
- func (p TxnKVProxy) TxnCommit(ctx context.Context) error
- func (p TxnKVProxy) TxnDelete(ctx context.Context, key []byte) error
- func (p TxnKVProxy) TxnGet(ctx context.Context, key []byte) ([]byte, error)
- func (p TxnKVProxy) TxnIsReadOnly(ctx context.Context) (bool, error)
- func (p TxnKVProxy) TxnIter(ctx context.Context, key []byte, upperBound []byte) (UUID, error)
- func (p TxnKVProxy) TxnIterReverse(ctx context.Context, key []byte) (UUID, error)
- func (p TxnKVProxy) TxnLen(ctx context.Context) (int, error)
- func (p TxnKVProxy) TxnLockKeys(ctx context.Context, keys [][]byte) error
- func (p TxnKVProxy) TxnRollback(ctx context.Context) error
- func (p TxnKVProxy) TxnSet(ctx context.Context, k []byte, v []byte) error
- func (p TxnKVProxy) TxnSize(ctx context.Context) (int, error)
- func (p TxnKVProxy) TxnValid(ctx context.Context) (bool, error)
- type UUID
Constants ¶
This section is empty.
Variables ¶
var ( ErrClientNotFound = errors.New("client not found") ErrTxnNotFound = errors.New("txn not found") ErrIterNotFound = errors.New("iterator not found") )
Proxy errors. Use errors.Cause() to determine error type.
Functions ¶
This section is empty.
Types ¶
type RawKVProxy ¶
type RawKVProxy struct {
// contains filtered or unexported fields
}
RawKVProxy implements proxy to use rawkv API. It is safe to copy by value or access concurrently.
func (RawKVProxy) BatchDelete ¶
func (p RawKVProxy) BatchDelete(ctx context.Context, keys [][]byte) error
BatchDelete deletes key-value pairs from TiKV.
func (RawKVProxy) BatchPut ¶
func (p RawKVProxy) BatchPut(ctx context.Context, keys, values [][]byte) error
BatchPut stores key-value pairs to TiKV.
func (RawKVProxy) Close ¶
func (p RawKVProxy) Close(ctx context.Context) error
Close releases a rawkv client.
func (RawKVProxy) Delete ¶
func (p RawKVProxy) Delete(ctx context.Context, key []byte) error
Delete deletes a key-value pair from TiKV.
func (RawKVProxy) DeleteRange ¶
DeleteRange deletes all key-value pairs in a range from TiKV.
func (RawKVProxy) Put ¶
func (p RawKVProxy) Put(ctx context.Context, key, value []byte) error
Put stores a key-value pair to TiKV.
func (RawKVProxy) ReverseScan ¶
func (p RawKVProxy) ReverseScan(ctx context.Context, startKey, endKey []byte, limit int) ([][]byte, [][]byte, error)
ReverseScan queries continuous kv pairs in range [endKey, startKey), up to limit pairs. Direction is different from Scan, upper to lower.
type TxnKVProxy ¶
type TxnKVProxy struct {
// contains filtered or unexported fields
}
TxnKVProxy implements proxy to use txnkv API. It is safe to copy by value or access concurrently.
func (TxnKVProxy) Begin ¶
func (p TxnKVProxy) Begin(ctx context.Context) (UUID, error)
Begin starts a new transaction and returns its UUID.
func (TxnKVProxy) BeginWithTS ¶
BeginWithTS starts a new transaction with given ts and returns its UUID.
func (TxnKVProxy) Close ¶
func (p TxnKVProxy) Close(ctx context.Context) error
Close releases a txnkv client.
func (TxnKVProxy) GetTS ¶
func (p TxnKVProxy) GetTS(ctx context.Context) (uint64, error)
GetTS returns a latest timestamp.
func (TxnKVProxy) IterClose ¶
func (p TxnKVProxy) IterClose(ctx context.Context) error
IterClose releases an iterator.
func (TxnKVProxy) IterKey ¶
func (p TxnKVProxy) IterKey(ctx context.Context) ([]byte, error)
IterKey returns the key which the iterator points to.
func (TxnKVProxy) IterNext ¶
func (p TxnKVProxy) IterNext(ctx context.Context) error
IterNext moves the iterator to next entry.
func (TxnKVProxy) IterValid ¶
func (p TxnKVProxy) IterValid(ctx context.Context) (bool, error)
IterValid returns if the iterator is valid to use.
func (TxnKVProxy) IterValue ¶
func (p TxnKVProxy) IterValue(ctx context.Context) ([]byte, error)
IterValue returns the value which the iterator points to.
func (TxnKVProxy) TxnBatchGet ¶
TxnBatchGet gets a batch of values from TiKV server.
func (TxnKVProxy) TxnCommit ¶
func (p TxnKVProxy) TxnCommit(ctx context.Context) error
TxnCommit commits the transaction operations to TiKV server.
func (TxnKVProxy) TxnDelete ¶
func (p TxnKVProxy) TxnDelete(ctx context.Context, key []byte) error
TxnDelete removes the entry for key from TiKV server.
func (TxnKVProxy) TxnIsReadOnly ¶
func (p TxnKVProxy) TxnIsReadOnly(ctx context.Context) (bool, error)
TxnIsReadOnly returns if there are pending key-value to commit in the transaction.
func (TxnKVProxy) TxnIter ¶
TxnIter creates an Iterator positioned on the first entry that key <= entry's key and returns the Iterator's UUID.
func (TxnKVProxy) TxnIterReverse ¶
TxnIterReverse creates a reversed Iterator positioned on the first entry which key is less than key and returns the Iterator's UUID.
func (TxnKVProxy) TxnLen ¶
func (p TxnKVProxy) TxnLen(ctx context.Context) (int, error)
TxnLen returns the count of key-value pairs in the transaction's memory buffer.
func (TxnKVProxy) TxnLockKeys ¶
func (p TxnKVProxy) TxnLockKeys(ctx context.Context, keys [][]byte) error
TxnLockKeys tries to lock the entries with the keys in TiKV server.
func (TxnKVProxy) TxnRollback ¶
func (p TxnKVProxy) TxnRollback(ctx context.Context) error
TxnRollback undoes the transaction operations to TiKV server.