Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store/tikv: remove use of SampleStep option in store/tikv #24461

Merged
merged 4 commits into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions store/driver/txn/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ func (s *tikvSnapshot) SetOption(opt int, val interface{}) {
s.KVSnapshot.SetNotFillCache(val.(bool))
case tikvstore.SnapshotTS:
s.KVSnapshot.SetSnapshotTS(val.(uint64))
case tikvstore.SampleStep:
s.KVSnapshot.SetSampleStep(val.(uint32))
default:
s.KVSnapshot.SetOption(opt, val)
}
Expand Down
2 changes: 2 additions & 0 deletions store/driver/txn/txn_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ func (txn *tikvTxn) SetOption(opt int, val interface{}) {
txn.KVTxn.GetSnapshot().SetSnapshotTS(val.(uint64))
case tikvstore.InfoSchema:
txn.SetSchemaVer(val.(tikv.SchemaVer))
case tikvstore.SampleStep:
txn.KVTxn.GetSnapshot().SetSampleStep(val.(uint32))
case tikvstore.CommitHook:
txn.SetCommitCallback(val.(func(string, error)))
case tikvstore.Enable1PC:
Expand Down
7 changes: 5 additions & 2 deletions store/tikv/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,6 @@ func (s *KVSnapshot) SetOption(opt int, val interface{}) {
s.mu.Lock()
s.mu.stats = val.(*SnapshotRuntimeStats)
s.mu.Unlock()
case kv.SampleStep:
s.sampleStep = val.(uint32)
case kv.IsStalenessReadOnly:
s.mu.Lock()
s.mu.isStaleness = val.(bool)
Expand Down Expand Up @@ -620,6 +618,11 @@ func (s *KVSnapshot) SetIsolationLevel(level IsoLevel) {
s.isolationLevel = level
}

// SetSampleStep skips 'step - 1' number of keys after each returned key.
func (s *KVSnapshot) SetSampleStep(step uint32) {
s.sampleStep = step
}

// SetPriority sets the priority for tikv to execute commands.
func (s *KVSnapshot) SetPriority(pri Priority) {
s.priority = pri
Expand Down