Skip to content

Commit d8af033

Browse files
committed
add OnMemChange in LockCtx
1 parent 4183ab1 commit d8af033

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

kv/kv.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ type LockCtx struct {
7979
// LockCtx specially.
8080
ResourceGroupTagger func(*kvrpcpb.PessimisticLockRequest) []byte
8181
OnDeadlock func(*tikverr.ErrDeadlock)
82+
OnMemChange func(int)
8283
}
8384

8485
// LockWaitTime returns lockWaitTimeInMs
@@ -135,3 +136,13 @@ func (ctx *LockCtx) IterateValuesNotLocked(f func([]byte, []byte)) {
135136
}
136137
}
137138
}
139+
140+
// getValuesKSize returns Values key size
141+
func (ctx *LockCtx) GetValuesKSize() uint64 {
142+
return uint64(unsafe.Sizeof(*new(string)))
143+
}
144+
145+
// getValuesKSize returns Values value size
146+
func (ctx *LockCtx) GetValuesVSize() uint64 {
147+
return uint64(unsafe.Sizeof(*new(ReturnedValue)))
148+
}

0 commit comments

Comments
 (0)