mirror of https://github.com/tikv/client-go.git
tikv: use resolve lock lite for snapshot.Get() (#247)
Signed-off-by: lysu <sulifx@gmail.com>
This commit is contained in:
parent
f3e7dc3042
commit
4e1417e3fb
|
|
@ -58,12 +58,13 @@ type ClientHelper struct {
|
|||
}
|
||||
|
||||
// NewClientHelper creates a helper instance.
|
||||
func NewClientHelper(store *KVStore, resolvedLocks *util.TSSet) *ClientHelper {
|
||||
func NewClientHelper(store *KVStore, resolvedLocks *util.TSSet, resolveLite bool) *ClientHelper {
|
||||
return &ClientHelper{
|
||||
lockResolver: store.GetLockResolver(),
|
||||
regionCache: store.GetRegionCache(),
|
||||
resolvedLocks: resolvedLocks,
|
||||
client: store.GetTiKVClient(),
|
||||
resolveLite: resolveLite,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ func (s *KVSnapshot) batchGetKeysByRegions(bo *Backoffer, keys [][]byte, collect
|
|||
}
|
||||
|
||||
func (s *KVSnapshot) batchGetSingleRegion(bo *Backoffer, batch batchKeys, collectF func(k, v []byte)) error {
|
||||
cli := NewClientHelper(s.store, &s.resolvedLocks)
|
||||
cli := NewClientHelper(s.store, &s.resolvedLocks, false)
|
||||
s.mu.RLock()
|
||||
if s.mu.stats != nil {
|
||||
cli.Stats = make(map[tikvrpc.CmdType]*locate.RPCRuntimeStats)
|
||||
|
|
@ -497,7 +497,7 @@ func (s *KVSnapshot) get(ctx context.Context, bo *Backoffer, k []byte) ([]byte,
|
|||
}
|
||||
})
|
||||
|
||||
cli := NewClientHelper(s.store, &s.resolvedLocks)
|
||||
cli := NewClientHelper(s.store, &s.resolvedLocks, true)
|
||||
|
||||
s.mu.RLock()
|
||||
if s.mu.stats != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue