Skip to content

Commit

Permalink
*: move util into pkg/util
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei committed Sep 21, 2023
1 parent 71e5858 commit a4c2fc3
Show file tree
Hide file tree
Showing 1,916 changed files with 4,485 additions and 4,497 deletions.
6 changes: 3 additions & 3 deletions autoid_service/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ go_library(
"//metrics",
"//owner",
"//parser/model",
"//util/etcd",
"//util/logutil",
"//util/mathutil",
"//pkg/util/etcd",
"//pkg/util/logutil",
"//pkg/util/mathutil",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_pingcap_kvproto//pkg/autoid",
Expand Down
6 changes: 3 additions & 3 deletions autoid_service/autoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (
"github.com/pingcap/tidb/metrics"
"github.com/pingcap/tidb/owner"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/util/etcd"
"github.com/pingcap/tidb/util/logutil"
"github.com/pingcap/tidb/util/mathutil"
"github.com/pingcap/tidb/pkg/util/etcd"
"github.com/pingcap/tidb/pkg/util/logutil"
"github.com/pingcap/tidb/pkg/util/mathutil"
clientv3 "go.etcd.io/etcd/client/v3"
"go.uber.org/zap"
"google.golang.org/grpc"
Expand Down
30 changes: 15 additions & 15 deletions bindinfo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ go_library(
"//parser/format",
"//parser/mysql",
"//parser/terror",
"//pkg/util/chunk",
"//pkg/util/hack",
"//pkg/util/hint",
"//pkg/util/kvcache",
"//pkg/util/logutil",
"//pkg/util/mathutil",
"//pkg/util/memory",
"//pkg/util/parser",
"//pkg/util/sqlexec",
"//pkg/util/stmtsummary/v2:stmtsummary",
"//pkg/util/table-filter",
"//pkg/util/timeutil",
"//sessionctx",
"//sessionctx/sessionstates",
"//sessionctx/stmtctx",
"//sessionctx/variable",
"//types",
"//types/parser_driver",
"//util/chunk",
"//util/hack",
"//util/hint",
"//util/kvcache",
"//util/logutil",
"//util/mathutil",
"//util/memory",
"//util/parser",
"//util/sqlexec",
"//util/stmtsummary/v2:stmtsummary",
"//util/table-filter",
"//util/timeutil",
"@org_golang_x_exp//maps",
"@org_uber_go_zap//:zap",
],
Expand Down Expand Up @@ -67,13 +67,13 @@ go_test(
"//parser",
"//parser/auth",
"//parser/model",
"//pkg/util/hack",
"//pkg/util/parser",
"//pkg/util/stmtsummary",
"//server",
"//sessionctx/variable",
"//testkit",
"//testkit/testsetup",
"//util/hack",
"//util/parser",
"//util/stmtsummary",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_prometheus_client_model//go",
"@com_github_stretchr_testify//require",
Expand Down
8 changes: 4 additions & 4 deletions bindinfo/bind_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"errors"
"sync"

"github.com/pingcap/tidb/pkg/util/hack"
"github.com/pingcap/tidb/pkg/util/kvcache"
"github.com/pingcap/tidb/pkg/util/mathutil"
"github.com/pingcap/tidb/pkg/util/memory"
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/util/hack"
"github.com/pingcap/tidb/util/kvcache"
"github.com/pingcap/tidb/util/mathutil"
"github.com/pingcap/tidb/util/memory"
)

// bindCache uses the LRU cache to store the bindRecord.
Expand Down
2 changes: 1 addition & 1 deletion bindinfo/bind_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"strings"
"testing"

"github.com/pingcap/tidb/pkg/util/hack"
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/util/hack"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions bindinfo/bind_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (

"github.com/pingcap/tidb/metrics"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/pkg/util/hack"
"github.com/pingcap/tidb/pkg/util/hint"
"github.com/pingcap/tidb/sessionctx"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/hack"
"github.com/pingcap/tidb/util/hint"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions bindinfo/capture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/auth"
"github.com/pingcap/tidb/parser/model"
utilparser "github.com/pingcap/tidb/pkg/util/parser"
"github.com/pingcap/tidb/pkg/util/stmtsummary"
"github.com/pingcap/tidb/testkit"
utilparser "github.com/pingcap/tidb/util/parser"
"github.com/pingcap/tidb/util/stmtsummary"
"github.com/stretchr/testify/require"
"go.opencensus.io/stats/view"
)
Expand Down
16 changes: 8 additions & 8 deletions bindinfo/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ import (
"github.com/pingcap/tidb/parser/format"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/parser/terror"
"github.com/pingcap/tidb/pkg/util/chunk"
"github.com/pingcap/tidb/pkg/util/hint"
"github.com/pingcap/tidb/pkg/util/logutil"
utilparser "github.com/pingcap/tidb/pkg/util/parser"
"github.com/pingcap/tidb/pkg/util/sqlexec"
stmtsummaryv2 "github.com/pingcap/tidb/pkg/util/stmtsummary/v2"
tablefilter "github.com/pingcap/tidb/pkg/util/table-filter"
"github.com/pingcap/tidb/pkg/util/timeutil"
"github.com/pingcap/tidb/sessionctx"
"github.com/pingcap/tidb/sessionctx/stmtctx"
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/types"
driver "github.com/pingcap/tidb/types/parser_driver"
"github.com/pingcap/tidb/util/chunk"
"github.com/pingcap/tidb/util/hint"
"github.com/pingcap/tidb/util/logutil"
utilparser "github.com/pingcap/tidb/util/parser"
"github.com/pingcap/tidb/util/sqlexec"
stmtsummaryv2 "github.com/pingcap/tidb/util/stmtsummary/v2"
tablefilter "github.com/pingcap/tidb/util/table-filter"
"github.com/pingcap/tidb/util/timeutil"
"go.uber.org/zap"
"golang.org/x/exp/maps"
)
Expand Down
2 changes: 1 addition & 1 deletion bindinfo/internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ go_library(
deps = [
"//domain",
"//parser",
"//pkg/util/parser",
"//testkit",
"//util/parser",
"@com_github_stretchr_testify//require",
],
)
2 changes: 1 addition & 1 deletion bindinfo/internal/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (

"github.com/pingcap/tidb/domain"
"github.com/pingcap/tidb/parser"
utilparser "github.com/pingcap/tidb/pkg/util/parser"
"github.com/pingcap/tidb/testkit"
utilparser "github.com/pingcap/tidb/util/parser"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions bindinfo/session_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import (
"github.com/pingcap/tidb/metrics"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/pkg/util/hack"
"github.com/pingcap/tidb/pkg/util/logutil"
"github.com/pingcap/tidb/sessionctx"
"github.com/pingcap/tidb/sessionctx/sessionstates"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/hack"
"github.com/pingcap/tidb/util/logutil"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion bindinfo/session_handle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"github.com/pingcap/tidb/metrics"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/auth"
"github.com/pingcap/tidb/pkg/util/stmtsummary"
"github.com/pingcap/tidb/server"
"github.com/pingcap/tidb/testkit"
"github.com/pingcap/tidb/util/stmtsummary"
dto "github.com/prometheus/client_model/go"
"github.com/stretchr/testify/require"
)
Expand Down
6 changes: 3 additions & 3 deletions bindinfo/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ go_test(
"//parser/auth",
"//parser/model",
"//parser/terror",
"//pkg/util",
"//pkg/util/parser",
"//pkg/util/stmtsummary",
"//testkit",
"//testkit/testsetup",
"//util",
"//util/parser",
"//util/stmtsummary",
"@com_github_stretchr_testify//require",
"@org_uber_go_goleak//:goleak",
],
Expand Down
6 changes: 3 additions & 3 deletions bindinfo/tests/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"github.com/pingcap/tidb/parser/auth"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/parser/terror"
"github.com/pingcap/tidb/pkg/util"
utilparser "github.com/pingcap/tidb/pkg/util/parser"
"github.com/pingcap/tidb/pkg/util/stmtsummary"
"github.com/pingcap/tidb/testkit"
"github.com/pingcap/tidb/util"
utilparser "github.com/pingcap/tidb/util/parser"
"github.com/pingcap/tidb/util/stmtsummary"
"github.com/stretchr/testify/require"
)

Expand Down
6 changes: 3 additions & 3 deletions br/cmd/br/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ go_library(
"//br/pkg/version/build",
"//config",
"//parser/model",
"//pkg/util",
"//pkg/util/logutil",
"//pkg/util/metricsutil",
"//session",
"//util",
"//util/logutil",
"//util/metricsutil",
"@com_github_gogo_protobuf//proto",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_kvproto//pkg/brpb",
Expand Down
2 changes: 1 addition & 1 deletion br/cmd/br/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/pingcap/tidb/br/pkg/utils"
"github.com/pingcap/tidb/br/pkg/version/build"
"github.com/pingcap/tidb/config"
"github.com/pingcap/tidb/pkg/util/metricsutil"
"github.com/pingcap/tidb/session"
"github.com/pingcap/tidb/util/metricsutil"
"github.com/spf13/cobra"
"go.uber.org/zap"
"sourcegraph.com/sourcegraph/appdash"
Expand Down
4 changes: 2 additions & 2 deletions br/cmd/br/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"github.com/pingcap/tidb/br/pkg/utils"
"github.com/pingcap/tidb/br/pkg/version/build"
"github.com/pingcap/tidb/config"
tidbutils "github.com/pingcap/tidb/util"
"github.com/pingcap/tidb/util/logutil"
tidbutils "github.com/pingcap/tidb/pkg/util"
"github.com/pingcap/tidb/pkg/util/logutil"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion br/cmd/br/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/pingcap/tidb/br/pkg/trace"
"github.com/pingcap/tidb/br/pkg/utils"
"github.com/pingcap/tidb/br/pkg/version/build"
"github.com/pingcap/tidb/pkg/util/metricsutil"
"github.com/pingcap/tidb/session"
"github.com/pingcap/tidb/util/metricsutil"
"github.com/spf13/cobra"
"go.uber.org/zap"
"sourcegraph.com/sourcegraph/appdash"
Expand Down
12 changes: 6 additions & 6 deletions br/pkg/backup/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ go_library(
"//kv",
"//meta",
"//parser/model",
"//pkg/util",
"//pkg/util/codec",
"//pkg/util/ranger",
"//pkg/util/table-filter",
"//statistics/handle",
"//util",
"//util/codec",
"//util/ranger",
"//util/table-filter",
"@com_github_google_btree//:btree",
"@com_github_opentracing_opentracing_go//:opentracing-go",
"@com_github_pingcap_errors//:errors",
Expand Down Expand Up @@ -80,13 +80,13 @@ go_test(
"//br/pkg/utils",
"//kv",
"//parser/model",
"//pkg/util/codec",
"//pkg/util/table-filter",
"//sessionctx/variable",
"//tablecodec",
"//testkit",
"//testkit/testsetup",
"//types",
"//util/codec",
"//util/table-filter",
"@com_github_golang_protobuf//proto",
"@com_github_pingcap_kvproto//pkg/brpb",
"@com_github_pingcap_kvproto//pkg/encryptionpb",
Expand Down
8 changes: 4 additions & 4 deletions br/pkg/backup/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ import (
"github.com/pingcap/tidb/kv"
"github.com/pingcap/tidb/meta"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/util"
"github.com/pingcap/tidb/util/codec"
"github.com/pingcap/tidb/util/ranger"
filter "github.com/pingcap/tidb/util/table-filter"
"github.com/pingcap/tidb/pkg/util"
"github.com/pingcap/tidb/pkg/util/codec"
"github.com/pingcap/tidb/pkg/util/ranger"
filter "github.com/pingcap/tidb/pkg/util/table-filter"
"github.com/tikv/client-go/v2/oracle"
"github.com/tikv/client-go/v2/tikv"
"github.com/tikv/client-go/v2/txnkv/txnlock"
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/backup/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"github.com/pingcap/tidb/br/pkg/storage"
"github.com/pingcap/tidb/kv"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/pkg/util/codec"
"github.com/pingcap/tidb/tablecodec"
"github.com/pingcap/tidb/testkit"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/codec"
"github.com/stretchr/testify/require"
"github.com/tikv/client-go/v2/oracle"
"github.com/tikv/client-go/v2/testutils"
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/backup/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"github.com/pingcap/tidb/br/pkg/mock"
"github.com/pingcap/tidb/br/pkg/storage"
"github.com/pingcap/tidb/br/pkg/utils"
filter "github.com/pingcap/tidb/pkg/util/table-filter"
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/testkit"
filter "github.com/pingcap/tidb/util/table-filter"
"github.com/stretchr/testify/require"
"go.opencensus.io/stats/view"
)
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/checksum/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ go_library(
"//distsql",
"//kv",
"//parser/model",
"//pkg/util/ranger",
"//sessionctx/variable",
"//tablecodec",
"//util/ranger",
"@com_github_gogo_protobuf//proto",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_failpoint//:failpoint",
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/checksum/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/pingcap/tidb/distsql"
"github.com/pingcap/tidb/kv"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/pkg/util/ranger"
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/tablecodec"
"github.com/pingcap/tidb/util/ranger"
"github.com/pingcap/tipb/go-tipb"
"go.uber.org/zap"
)
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/conn/util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//br/pkg/errors",
"//util/engine",
"//pkg/util/engine",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_tikv_pd_client//:client",
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/conn/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/pingcap/errors"
"github.com/pingcap/kvproto/pkg/metapb"
berrors "github.com/pingcap/tidb/br/pkg/errors"
"github.com/pingcap/tidb/util/engine"
"github.com/pingcap/tidb/pkg/util/engine"
pd "github.com/tikv/pd/client"
)

Expand Down
4 changes: 2 additions & 2 deletions br/pkg/lightning/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ go_library(
"//br/pkg/utils",
"//br/pkg/version/build",
"//expression",
"//pkg/util",
"//pkg/util/promutil",
"//planner/core",
"//util",
"//util/promutil",
"@com_github_go_sql_driver_mysql//:mysql",
"@com_github_google_uuid//:uuid",
"@com_github_pingcap_errors//:errors",
Expand Down
Loading

0 comments on commit a4c2fc3

Please sign in to comment.