Documentation ¶
Index ¶
- Constants
- Variables
- func BatchGetValues(txn Transaction, keys [][]byte) (map[string][]byte, error)
- func DelOption(txn Transaction, opt Option)
- func IsConflictError(err error) bool
- func IsErrNotFound(err error) bool
- func IsRetryableError(err error) bool
- func LockKeys(txn Transaction, keys [][]byte) error
- func RunInNewTxn(store Storage, retryable bool, f func(txn kv.Transaction) error) error
- func SetOption(txn Transaction, opt Option, val interface{})
- type Iterator
- type Option
- type Storage
- type Transaction
Constants ¶
View Source
const ( PriorityNormal = iota PriorityLow PriorityHigh )
Priority value for transaction priority.
Variables ¶
View Source
var MockAddr = "mocktikv://"
MockAddr default mock tikv addr
Functions ¶
func BatchGetValues ¶
func BatchGetValues(txn Transaction, keys [][]byte) (map[string][]byte, error)
BatchGetValues issue batch requests to get values
func DelOption ¶ added in v0.6.0
func DelOption(txn Transaction, opt Option)
func IsConflictError ¶
func IsErrNotFound ¶
IsErrNotFound checks if err is a kind of NotFound error.
func IsRetryableError ¶
IsRetryableError checks if err is a kind of RetryableError error.
func LockKeys ¶
func LockKeys(txn Transaction, keys [][]byte) error
LockKeys tries to lock the entries with the keys in KV store.
func RunInNewTxn ¶
func SetOption ¶ added in v0.6.0
func SetOption(txn Transaction, opt Option, val interface{})
Types ¶
type Option ¶ added in v0.6.0
Option is used for customizing kv store's behaviors during a transaction.
const ( // PresumeKeyNotExists indicates that when dealing with a Get operation but failing to read data from cache, // we presume that the key does not exist in Store. The actual existence will be checked before the // transaction's commit. // This option is an optimization for frequent checks during a transaction, e.g. batch inserts. PresumeKeyNotExists Option = iota + 1 // PresumeKeyNotExistsError is the option key for error. // When PresumeKeyNotExists is set and condition is not match, should throw the error. PresumeKeyNotExistsError // BinlogInfo contains the binlog data and client. BinlogInfo // SchemaChecker is used for checking schema-validity. SchemaChecker // IsolationLevel sets isolation level for current transaction. The default level is SI. IsolationLevel // Priority marks the priority of this transaction. Priority // NotFillCache makes this request do not touch the LRU cache of the underlying storage. NotFillCache // SyncLog decides whether the WAL(write-ahead log) of this request should be synchronized. SyncLog // KeyOnly retrieve only keys, it can be used in scan now. KeyOnly )
Transaction options
type Transaction ¶
type Transaction kv.Transaction
Transaction defines the interface for operations inside a Transaction.
Click to show internal directories.
Click to hide internal directories.