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) DeleteJobStatus(status *pb.JobStatus) (out *pb.JobStatus, err error)
- func (k *KVStore) GetJobStatus(in *pb.JobStatus) (out *pb.JobStatus, err error)
- func (k *KVStore) IsLocked(obj interface{}, lockType lockType) (r bool)
- func (k *KVStore) SetJobStatus(status *pb.JobStatus) (*pb.JobStatus, 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 LockerChain
- 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 )
const (
LockTimeOut = 2 * time.Second
)
some sonst
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) DeleteJobStatus ¶
DeleteJobStatus from kv store
func (*KVStore) GetJobStatus ¶
GetJobStatus get JobStatus from KV store if the job do not exists, return nil
func (*KVStore) SetJobStatus ¶
SetJobStatus set job status to kv store safely set jobstatus need lock it with RW locker first
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{}, lockType lockType) error
AddLocker, lock a obj and save locker into LockerChain
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{}, lockType lockType) error
ReleaseLocker release a lock
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