Skip to content

Commit

Permalink
*: remove TSOToRoughTime function (#45348)
Browse files Browse the repository at this point in the history
  • Loading branch information
Defined2014 authored Jul 13, 2023
1 parent 9c428bf commit 12543ec
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 30 deletions.
3 changes: 2 additions & 1 deletion executor/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ import (
"github.com/pingcap/tidb/util/set"
"github.com/pingcap/tidb/util/sqlexec"
"github.com/pingcap/tidb/util/stringutil"
"github.com/tikv/client-go/v2/oracle"
"golang.org/x/exp/slices"
)

Expand Down Expand Up @@ -1898,7 +1899,7 @@ func (e *ShowExec) fetchShowPumpOrDrainerStatus(kind string) error {
if n.State == node.Offline {
continue
}
e.appendRow([]interface{}{n.NodeID, n.Addr, n.State, n.MaxCommitTS, util.TSOToRoughTime(n.UpdateTS).Format(types.TimeFormat)})
e.appendRow([]interface{}{n.NodeID, n.Addr, n.State, n.MaxCommitTS, oracle.GetTimeFromTS(uint64(n.UpdateTS)).Format(types.TimeFormat)})
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion tidb-binlog/node/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ go_library(
importpath = "github.com/pingcap/tidb/tidb-binlog/node",
visibility = ["//visibility:public"],
deps = [
"//util",
"//util/etcd",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_log//:log",
"@com_github_tikv_client_go_v2//oracle",
"@io_etcd_go_etcd_client_v3//:client",
"@org_uber_go_zap//:zap",
],
Expand Down
4 changes: 2 additions & 2 deletions tidb-binlog/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package node
import (
"fmt"

"github.com/pingcap/tidb/util"
"github.com/tikv/client-go/v2/oracle"
)

var (
Expand Down Expand Up @@ -90,6 +90,6 @@ type Status struct {
}

func (s *Status) String() string {
updateTime := util.TSOToRoughTime(s.UpdateTS)
updateTime := oracle.GetTimeFromTS(uint64(s.UpdateTS))
return fmt.Sprintf("{NodeID: %s, Addr: %s, State: %s, MaxCommitTS: %d, UpdateTime: %v}", s.NodeID, s.Addr, s.State, s.MaxCommitTS, updateTime)
}
1 change: 0 additions & 1 deletion util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ go_library(
"rlimit_other.go",
"rlimit_windows.go",
"security.go",
"tso.go",
"urls.go",
"util.go",
"wait_group_wrapper.go",
Expand Down
25 changes: 0 additions & 25 deletions util/tso.go

This file was deleted.

0 comments on commit 12543ec

Please sign in to comment.