Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Latches ¶
type Latches struct {
// contains filtered or unexported fields
}
Latches which are used for concurrency control. Each latch is indexed by a slot's ID, hence the term latch and slot are used in interchangeable, but conceptually a latch is a queue, and a slot is an index to the queue
type LatchesScheduler ¶
LatchesScheduler is used to schedule latches for transactions.
func NewScheduler ¶
func NewScheduler(size uint) *LatchesScheduler
NewScheduler create the LatchesScheduler.
func (*LatchesScheduler) Close ¶
func (scheduler *LatchesScheduler) Close()
Close closes LatchesScheduler.
func (*LatchesScheduler) Lock ¶
func (scheduler *LatchesScheduler) Lock(startTS uint64, keys [][]byte) *Lock
Lock acquire the lock for transaction with startTS and keys. The caller goroutine would be blocked if the lock can't be obtained now. When this function returns, the lock state would be either success or stale(call lock.IsStale)
func (*LatchesScheduler) UnLock ¶
func (scheduler *LatchesScheduler) UnLock(lock *Lock)
UnLock unlocks a lock.
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
Lock is the locks' information required for a transaction.