Skip to content

Commit

Permalink
change func name
Browse files Browse the repository at this point in the history
  • Loading branch information
ystaticy committed Mar 28, 2024
1 parent 81d8dea commit f34e4d8
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples/gcworker/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/prometheus/procfs v0.12.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
github.com/tikv/pd/client v0.0.0-20240229062430-b207e514ece1 // indirect
github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 // indirect
github.com/twmb/murmur3 v1.1.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
Expand Down
2 changes: 1 addition & 1 deletion examples/rawkv/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/prometheus/procfs v0.12.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
github.com/tikv/pd/client v0.0.0-20240229062430-b207e514ece1 // indirect
github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 // indirect
github.com/twmb/murmur3 v1.1.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
Expand Down
2 changes: 1 addition & 1 deletion examples/txnkv/1pc_txn/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/prometheus/procfs v0.12.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
github.com/tikv/pd/client v0.0.0-20240229062430-b207e514ece1 // indirect
github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 // indirect
github.com/twmb/murmur3 v1.1.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
Expand Down
2 changes: 1 addition & 1 deletion examples/txnkv/async_commit/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/prometheus/procfs v0.12.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
github.com/tikv/pd/client v0.0.0-20240229062430-b207e514ece1 // indirect
github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 // indirect
github.com/twmb/murmur3 v1.1.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
Expand Down
2 changes: 1 addition & 1 deletion examples/txnkv/delete_range/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/prometheus/procfs v0.12.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
github.com/tikv/pd/client v0.0.0-20240229062430-b207e514ece1 // indirect
github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 // indirect
github.com/twmb/murmur3 v1.1.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
Expand Down
2 changes: 1 addition & 1 deletion examples/txnkv/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/prometheus/procfs v0.12.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
github.com/tikv/pd/client v0.0.0-20240229062430-b207e514ece1 // indirect
github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 // indirect
github.com/twmb/murmur3 v1.1.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
Expand Down
2 changes: 1 addition & 1 deletion examples/txnkv/pessimistic_txn/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/prometheus/procfs v0.12.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
github.com/tikv/pd/client v0.0.0-20240229062430-b207e514ece1 // indirect
github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 // indirect
github.com/twmb/murmur3 v1.1.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
Expand Down
2 changes: 1 addition & 1 deletion examples/txnkv/unsafedestoryrange/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/prometheus/procfs v0.12.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect
github.com/tikv/pd/client v0.0.0-20240229062430-b207e514ece1 // indirect
github.com/tikv/pd/client v0.0.0-20240320081713-c00c42e77b31 // indirect
github.com/twmb/murmur3 v1.1.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
Expand Down
2 changes: 1 addition & 1 deletion oracle/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Oracle interface {
GetExternalTimestamp(ctx context.Context) (uint64, error)
SetExternalTimestamp(ctx context.Context, ts uint64) error

GetMinTimestamp(ctx context.Context) (uint64, error)
GetMinTimestampInAllTSOGroup(ctx context.Context) (uint64, error)
}

// Future is a future which promises to return a timestamp.
Expand Down
2 changes: 1 addition & 1 deletion oracle/oracles/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (l *localOracle) GetTimestamp(ctx context.Context, _ *oracle.Option) (uint6
return ts, nil
}

func (l *localOracle) GetMinTimestamp(ctx context.Context) (uint64, error) {
func (l *localOracle) GetMinTimestampInAllTSOGroup(ctx context.Context) (uint64, error) {
l.Lock()
defer l.Unlock()
now := time.Now()
Expand Down
4 changes: 2 additions & 2 deletions oracle/oracles/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ func (o *MockOracle) GetTimestamp(ctx context.Context, _ *oracle.Option) (uint64
return ts, nil
}

// GetMinTimestamp implements oracle.Oracle interface.
func (o *MockOracle) GetMinTimestamp(ctx context.Context) (uint64, error) {
// GetMinTimestampInAllTSOGroup implements oracle.Oracle interface.
func (o *MockOracle) GetMinTimestampInAllTSOGroup(ctx context.Context) (uint64, error) {
o.RLock()
defer o.RUnlock()

Expand Down
8 changes: 4 additions & 4 deletions oracle/oracles/pd.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ func (o *pdOracle) GetTimestamp(ctx context.Context, opt *oracle.Option) (uint64
return ts, nil
}

// GetMinTimestamp gets a minimum timestamp for all keyspace groups.
func (o *pdOracle) GetMinTimestamp(ctx context.Context) (uint64, error) {
return o.getMinTimestamp(ctx)
// GetMinTimestampInAllTSOGroup gets a minimum timestamp for all keyspace groups.
func (o *pdOracle) GetMinTimestampInAllTSOGroup(ctx context.Context) (uint64, error) {
return o.getMinTimestampInAllTSOGroup(ctx)
}

type tsFuture struct {
Expand Down Expand Up @@ -171,7 +171,7 @@ func (o *pdOracle) getTimestamp(ctx context.Context, txnScope string) (uint64, e
return oracle.ComposeTS(physical, logical), nil
}

func (o *pdOracle) getMinTimestamp(ctx context.Context) (uint64, error) {
func (o *pdOracle) getMinTimestampInAllTSOGroup(ctx context.Context) (uint64, error) {
now := time.Now()

physical, logical, err := o.c.GetMinTS(ctx)
Expand Down
2 changes: 1 addition & 1 deletion tikv/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ func (s *KVStore) getMinTimestampWithRetry(bo *Backoffer) (uint64, error) {
}

for {
minTS, err := s.oracle.GetMinTimestamp(bo.GetCtx())
minTS, err := s.oracle.GetMinTimestampInAllTSOGroup(bo.GetCtx())
if err == nil {
return minTS, nil
}
Expand Down

0 comments on commit f34e4d8

Please sign in to comment.