Versions in this module Expand all Collapse all v1 v1.0.0 Oct 16, 2017 Changes in this version + const PriorityHigh + const PriorityLow + const PriorityNormal + const ReqSubTypeAnalyzeCol + const ReqSubTypeAnalyzeIdx + const ReqSubTypeBasic + const ReqSubTypeDesc + const ReqSubTypeGroupBy + const ReqSubTypeSignature + const ReqSubTypeTopN + const ReqTypeAnalyze + const ReqTypeDAG + const ReqTypeIndex + const ReqTypeSelect + var ErrCannotSetNilValue = terror.ClassKV.New(codeCantSetNilValue, "can not set nil value") + var ErrClosed = terror.ClassKV.New(codeClosed, "Error: Transaction already closed") + var ErrConditionNotMatch = terror.ClassKV.New(codeConditionNotMatch, "Error: Condition not match") + var ErrEntryTooLarge = terror.ClassKV.New(codeEntryTooLarge, "entry is too large") + var ErrInvalidTxn = terror.ClassKV.New(codeInvalidTxn, "invalid transaction") + var ErrKeyExists = terror.ClassKV.New(codeKeyExists, "key already exist") + var ErrLazyConditionPairsNotMatch = terror.ClassKV.New(codeLazyConditionPairsNotMatch, "Error: Lazy condition pairs not match") + var ErrLockConflict = terror.ClassKV.New(codeLockConflict, "Error: Lock conflict") + var ErrNotCommitted = terror.ClassKV.New(codeNotCommitted, "this transaction has not committed") + var ErrNotExist = terror.ClassKV.New(codeNotExist, "Error: key not exist") + var ErrNotImplemented = terror.ClassKV.New(codeNotImplemented, "not implemented") + var ErrRetryable = terror.ClassKV.New(codeRetryable, "Error: KV error safe to retry") + var ErrTxnTooLarge = terror.ClassKV.New(codeTxnTooLarge, "transaction is too large") + var MaxVersion = Version + var MinVersion = Version + var TxnEntryCountLimit uint64 = 300 * 1000 + var TxnEntrySizeLimit = 6 * 1024 * 1024 + var TxnTotalSizeLimit = 100 * 1024 * 1024 + func BackOff(attempts int) int + func GetInt64(r Retriever, k Key) (int64, error) + func IncInt64(rm RetrieverMutator, k Key, step int64) (int64, error) + func IsErrNotFound(err error) bool + func IsRetryableError(err error) bool + func NextUntil(it Iterator, fn FnKeyCmp) error + func RunInNewTxn(store Storage, retryable bool, f func(txn Transaction) error) error + type BufferStore struct + func NewBufferStore(r Retriever) *BufferStore + func (s *BufferStore) Get(k Key) ([]byte, error) + func (s *BufferStore) SaveTo(m Mutator) error + func (s *BufferStore) Seek(k Key) (Iterator, error) + func (s *BufferStore) SeekReverse(k Key) (Iterator, error) + func (s *BufferStore) WalkBuffer(f func(k Key, v []byte) error) error + type Client interface + IsRequestTypeSupported func(reqType, subType int64) bool + Send func(ctx goctx.Context, req *Request) Response + type Driver interface + Open func(path string) (Storage, error) + type EncodedKey []byte + func (k EncodedKey) Cmp(another EncodedKey) int + func (k EncodedKey) Next() EncodedKey + type FnKeyCmp func(key Key) bool + type InjectedSnapshot struct + func (t *InjectedSnapshot) Get(k Key) ([]byte, error) + type InjectedStore struct + func (s *InjectedStore) Begin() (Transaction, error) + func (s *InjectedStore) BeginWithStartTS(startTS uint64) (Transaction, error) + func (s *InjectedStore) GetSnapshot(ver Version) (Snapshot, error) + type InjectedTransaction struct + func (t *InjectedTransaction) Commit() error + func (t *InjectedTransaction) Get(k Key) ([]byte, error) + type InjectionConfig struct + func (c *InjectionConfig) SetCommitError(err error) + func (c *InjectionConfig) SetGetError(err error) + type IsoLevel int + const RC + const SI + type Iterator interface + Close func() + Key func() Key + Next func() error + Valid func() bool + Value func() []byte + type Key []byte + func (k Key) Clone() Key + func (k Key) Cmp(another Key) int + func (k Key) HasPrefix(prefix Key) bool + func (k Key) Next() Key + func (k Key) PrefixNext() Key + type KeyRange struct + EndKey Key + StartKey Key + func (r *KeyRange) IsPoint() bool + type MemBuffer interface + Len func() int + Size func() int + func NewMemDbBuffer() MemBuffer + type MockTxn interface + GetOption func(opt Option) interface{} + type Mutator interface + Delete func(k Key) error + Set func(k Key, v []byte) error + type Option int + const BinlogInfo + const IsolationLevel + const NotFillCache + const PresumeKeyNotExists + const PresumeKeyNotExistsError + const Priority + const SchemaLeaseChecker + const SkipCheckForWrite + const SyncLog + type Options interface + Get func(opt Option) (v interface{}, ok bool) + type Request struct + Concurrency int + Data []byte + Desc bool + IsolationLevel IsoLevel + KeepOrder bool + KeyRanges []KeyRange + NotFillCache bool + Priority int + StartTs uint64 + SyncLog bool + Tp int64 + type Response interface + Close func() error + Next func() (resultSubset []byte, err error) + type Retriever interface + Get func(k Key) ([]byte, error) + Seek func(k Key) (Iterator, error) + SeekReverse func(k Key) (Iterator, error) + type RetrieverMutator interface + type Snapshot interface + BatchGet func(keys []Key) (map[string][]byte, error) + type Storage interface + Begin func() (Transaction, error) + BeginWithStartTS func(startTS uint64) (Transaction, error) + Close func() error + CurrentVersion func() (Version, error) + GetClient func() Client + GetOracle func() oracle.Oracle + GetSnapshot func(ver Version) (Snapshot, error) + SupportDeleteRange func() (supported bool) + UUID func() string + func NewInjectedStore(store Storage, cfg *InjectionConfig) Storage + func NewMockStorage() Storage + type Transaction interface + Commit func() error + DelOption func(opt Option) + IsReadOnly func() bool + LockKeys func(keys ...Key) error + Rollback func() error + SetOption func(opt Option, val interface{}) + StartTS func() uint64 + String func() string + Valid func() bool + type UnionIter struct + func (iter *UnionIter) Close() + func (iter *UnionIter) Key() Key + func (iter *UnionIter) Next() error + func (iter *UnionIter) Valid() bool + func (iter *UnionIter) Value() []byte + type UnionStore interface + CheckLazyConditionPairs func() error + DelOption func(opt Option) + GetOption func(opt Option) interface{} + SetOption func(opt Option, val interface{}) + WalkBuffer func(f func(k Key, v []byte) error) error + func NewUnionStore(snapshot Snapshot) UnionStore + type Version struct + Ver uint64 + func NewVersion(v uint64) Version + func (v Version) Cmp(another Version) int + type VersionProvider interface + CurrentVersion func() (Version, error)