Documentation ¶
Overview ¶
Copyright 2015 PingCAP, Inc.
Copyright 2015 Wenbin Xiao ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func NewMemDbBuffer() *memDbBuffer
- func StringToLogicSymbol(s string) (logicSymbol, bool)
- type KVStore
- func (k *KVStore) Delete(obj interface{}) (err error)
- func (k *KVStore) Get(in interface{}) (lastIndex uint64, err error)
- func (k *KVStore) IsLocked(obj interface{}, lockType lockType) (r bool)
- func (k *KVStore) Set(currentObj interface{}, lastIndex uint64, previousObj interface{}) error
- func (k *KVStore) WatchLock(obj interface{}, stopCh chan struct{}) (chan string, error)
- func (k *KVStore) WhoLocked(obj interface{}, lockType lockType) (v string)
- type Key
- type LockOption
- type LockerChain
- func (l *LockerChain) AddLocker(obj interface{}, lockoption *LockOption) error
- func (l *LockerChain) HaveIt(obj interface{}, lockType lockType) bool
- func (l *LockerChain) ReleaseAll()
- func (l *LockerChain) ReleaseLocker(obj interface{}, global bool, lockType lockType) error
- func (l *LockerChain) Stop()
- type MemStore
- type SQLStore
- func (s *SQLStore) Close() error
- func (s *SQLStore) Create(obj interface{}) *SQLStore
- func (s *SQLStore) Delete(obj interface{}) *SQLStore
- func (s *SQLStore) Find(out interface{}) *SQLStore
- func (s *SQLStore) Migrate(drop bool, valus ...interface{}) error
- func (s *SQLStore) Model(obj interface{}) *SQLStore
- func (s *SQLStore) Modify(obj interface{}) *SQLStore
- func (s *SQLStore) PageCount(out interface{}) *SQLStore
- func (s *SQLStore) PageNum(i int) *SQLStore
- func (s *SQLStore) PageSize(i int) *SQLStore
- func (s *SQLStore) Where(obj interface{}) *SQLStore
- type SearchCondition
Constants ¶
const ( OWN lockType = 1 + iota RW W )
Variables ¶
var ( // TxnEntrySizeLimit is limit of single entry size (len(key) + len(value)). TxnEntrySizeLimit = 6 * 1024 * 1024 // TxnEntryCountLimit is limit of number of entries in the MemBuffer. TxnEntryCountLimit uint64 = 300 * 1000 // TxnTotalSizeLimit is limit of the sum of all entry size. TxnTotalSizeLimit = 100 * 1024 * 1024 )
Those limits is enforced to make sure the transaction can be well handled by TiKV.
Functions ¶
func StringToLogicSymbol ¶
StringToLogicSymbol used to conversion string to logicSymbol
Types ¶
type KVStore ¶
type KVStore struct {
// contains filtered or unexported fields
}
KVStore struct
func NewKVStore ¶
NewKVStore used to init a KVStore struct
func (*KVStore) Get ¶ added in v0.2.6
Get obj from kv store, fill found data into give obj and return lastIndex
func (*KVStore) Set ¶ added in v0.2.6
Set obj to kv store, if lastIndex and previousObj is not nil, it will use atomicPut
type LockOption ¶ added in v0.2.6
type LockerChain ¶
type LockerChain struct {
// contains filtered or unexported fields
}
func NewLockerChain ¶
func NewLockerChain(owner string, store *KVStore) *LockerChain
new lockerchain
func (*LockerChain) AddLocker ¶
func (l *LockerChain) AddLocker(obj interface{}, lockoption *LockOption) error
AddLocker, lock a obj and save locker into LockerChain if global is true, all goroutine can access this lock, if not only the goroutine created it can access it.
func (*LockerChain) HaveIt ¶
func (l *LockerChain) HaveIt(obj interface{}, lockType lockType) bool
HaveIt, return true if find the obj's Locker in LockerChain
func (*LockerChain) ReleaseLocker ¶
func (l *LockerChain) ReleaseLocker(obj interface{}, global bool, lockType lockType) error
ReleaseLocker release a lock if global is true, all goroutine can access this lock, if not only the goroutine created it can access it.
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore used to cache job in local memory
func NewMemStore ¶
func NewMemStore() *MemStore
NewMemStore init a MemStore and start a goroutine handle expired key
type SQLStore ¶
type SQLStore struct { Err error // error // contains filtered or unexported fields }
SQLStore database obj
func NewSQLStore ¶
NewSQLStore init a SQLStore struct
type SearchCondition ¶
type SearchCondition struct {
// contains filtered or unexported fields
}
SearchCondition save search condition
func NewSearchCondition ¶
func NewSearchCondition(conditions, links []string) (*SearchCondition, error)
NewSearchCondition serialized user input generated SearchCondition