Documentation ¶
Index ¶
- func ExtractKeyExistsErrFromHandle(key kv.Key, value []byte, tblInfo *model.TableInfo) error
- func ExtractKeyExistsErrFromIndex(key kv.Key, value []byte, tblInfo *model.TableInfo, indexID int64) error
- func NewSnapshot(snapshot *txnsnapshot.KVSnapshot) kv.Snapshot
- func NewTiKVTxn(txn *tikv.KVTxn) kv.Transaction
- type BatchBufferGetter
- type BatchGetter
- type BufferBatchGetter
- type Getter
- type TiDBKVFilter
- type UnionIter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractKeyExistsErrFromHandle ¶
ExtractKeyExistsErrFromHandle returns a ErrKeyExists error from a handle key.
func ExtractKeyExistsErrFromIndex ¶
func ExtractKeyExistsErrFromIndex(key kv.Key, value []byte, tblInfo *model.TableInfo, indexID int64) error
ExtractKeyExistsErrFromIndex returns a ErrKeyExists error from a index key.
func NewSnapshot ¶
func NewSnapshot(snapshot *txnsnapshot.KVSnapshot) kv.Snapshot
NewSnapshot creates a kv.Snapshot with txnsnapshot.KVSnapshot.
func NewTiKVTxn ¶
func NewTiKVTxn(txn *tikv.KVTxn) kv.Transaction
NewTiKVTxn returns a new Transaction.
Types ¶
type BatchBufferGetter ¶
type BatchBufferGetter interface { Len() int Getter // BatchGet gets a batch of values, keys are in bytes slice format. BatchGet(ctx context.Context, keys [][]byte) (map[string][]byte, error) }
BatchBufferGetter is the interface for BatchGet.
type BatchGetter ¶
type BatchGetter interface { // BatchGet gets a batch of values. BatchGet(ctx context.Context, keys []kv.Key) (map[string][]byte, error) }
BatchGetter is the interface for BatchGet.
type BufferBatchGetter ¶
type BufferBatchGetter struct {
// contains filtered or unexported fields
}
BufferBatchGetter is the type for BatchGet with MemBuffer.
func NewBufferBatchGetter ¶
func NewBufferBatchGetter(buffer BatchBufferGetter, middleCache Getter, snapshot BatchGetter) *BufferBatchGetter
NewBufferBatchGetter creates a new BufferBatchGetter.
type Getter ¶
type Getter interface { // Get gets the value for key k from kv store. // If corresponding kv pair does not exist, it returns nil and ErrNotExist. Get(ctx context.Context, k kv.Key) ([]byte, error) }
Getter is the interface for the Get method.
type TiDBKVFilter ¶
type TiDBKVFilter struct{}
TiDBKVFilter is the filter specific to TiDB to filter out KV pairs that needn't be committed.
func (TiDBKVFilter) IsUnnecessaryKeyValue ¶
func (f TiDBKVFilter) IsUnnecessaryKeyValue(key, value []byte, flags tikvstore.KeyFlags) (bool, error)
IsUnnecessaryKeyValue defines which kinds of KV pairs from TiDB needn't be committed.
type UnionIter ¶
type UnionIter struct {
// contains filtered or unexported fields
}
UnionIter implements kv.Iterator
func NewUnionIter ¶
NewUnionIter returns a union iterator for BufferStore.
func (*UnionIter) Close ¶
func (iter *UnionIter) Close()
Close implements the Iterator Close interface.