store/tikv: remove use of NotFillCache transaction option in store/tikv (#24361)
This commit is contained in:
@ -69,6 +69,8 @@ func (s *tikvSnapshot) SetOption(opt int, val interface{}) {
|
||||
s.KVSnapshot.SetIsolationLevel(level)
|
||||
case tikvstore.Priority:
|
||||
s.KVSnapshot.SetPriority(getTiKVPriority(val.(int)))
|
||||
case tikvstore.NotFillCache:
|
||||
s.KVSnapshot.SetNotFillCache(val.(bool))
|
||||
default:
|
||||
s.KVSnapshot.SetOption(opt, val)
|
||||
}
|
||||
|
||||
@ -134,10 +134,12 @@ func (txn *tikvTxn) SetOption(opt int, val interface{}) {
|
||||
case tikvstore.IsolationLevel:
|
||||
level := getTiKVIsolationLevel(val.(kv.IsoLevel))
|
||||
txn.KVTxn.GetSnapshot().SetIsolationLevel(level)
|
||||
case tikvstore.SyncLog:
|
||||
txn.EnableForceSyncLog()
|
||||
case tikvstore.Priority:
|
||||
txn.KVTxn.SetPriority(getTiKVPriority(val.(int)))
|
||||
case tikvstore.NotFillCache:
|
||||
txn.KVTxn.GetSnapshot().SetNotFillCache(val.(bool))
|
||||
case tikvstore.SyncLog:
|
||||
txn.EnableForceSyncLog()
|
||||
case tikvstore.Pessimistic:
|
||||
txn.SetPessimistic(val.(bool))
|
||||
default:
|
||||
|
||||
@ -565,8 +565,6 @@ func (s *KVSnapshot) IterReverse(k []byte) (unionstore.Iterator, error) {
|
||||
// value of this option. Only ReplicaRead is supported for snapshot
|
||||
func (s *KVSnapshot) SetOption(opt int, val interface{}) {
|
||||
switch opt {
|
||||
case kv.NotFillCache:
|
||||
s.notFillCache = val.(bool)
|
||||
case kv.SnapshotTS:
|
||||
s.setSnapshotTS(val.(uint64))
|
||||
case kv.ReplicaRead:
|
||||
@ -610,6 +608,12 @@ func (s *KVSnapshot) DelOption(opt int) {
|
||||
}
|
||||
}
|
||||
|
||||
// SetNotFillCache indicates whether tikv should skip filling cache when
|
||||
// loading data.
|
||||
func (s *KVSnapshot) SetNotFillCache(b bool) {
|
||||
s.notFillCache = b
|
||||
}
|
||||
|
||||
// SetKeyOnly indicates if tikv can return only keys.
|
||||
func (s *KVSnapshot) SetKeyOnly(b bool) {
|
||||
s.keyOnly = b
|
||||
|
||||
Reference in New Issue
Block a user