Skip to content

Commit

Permalink
update bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongjiwei committed Jul 13, 2022
1 parent 23db085 commit 1256789
Show file tree
Hide file tree
Showing 23 changed files with 203 additions and 32 deletions.
1 change: 1 addition & 0 deletions br/cmd/br/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ go_library(
"//br/pkg/redact",
"//br/pkg/restore",
"//br/pkg/rtree",
"//br/pkg/streamhelper/config",
"//br/pkg/summary",
"//br/pkg/task",
"//br/pkg/trace",
Expand Down
3 changes: 1 addition & 2 deletions br/pkg/conn/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ go_library(
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_pingcap_kvproto//pkg/brpb",
"@com_github_pingcap_kvproto//pkg/logbackuppb",
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_pingcap_log//:log",
"@com_github_tikv_client_go_v2//oracle",
"@com_github_tikv_client_go_v2//tikv",
"@com_github_tikv_client_go_v2//txnkv/txnlock",
"@com_github_tikv_pd_client//:client",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//backoff",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//credentials",
"@org_golang_google_grpc//keepalive",
"@org_golang_google_grpc//status",
"@org_uber_go_zap//:zap",
Expand Down
4 changes: 3 additions & 1 deletion br/pkg/lightning/restore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ go_library(
"//br/pkg/utils",
"//br/pkg/version",
"//br/pkg/version/build",
"//config",
"//kv",
"//meta/autoid",
"//parser",
Expand Down Expand Up @@ -109,10 +108,13 @@ go_test(
"//ddl",
"//errno",
"//kv",
"//meta",
"//meta/autoid",
"//parser",
"//parser/ast",
"//parser/model",
"//parser/mysql",
"//store/mockstore",
"//store/pdtypes",
"//table/tables",
"//types",
Expand Down
1 change: 1 addition & 0 deletions br/pkg/logutil/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ go_library(
deps = [
"//br/pkg/lightning/metric",
"//br/pkg/redact",
"//kv",
"@com_github_google_uuid//:uuid",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_kvproto//pkg/brpb",
Expand Down
6 changes: 6 additions & 0 deletions br/pkg/restore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ go_library(
importpath = "github.com/pingcap/tidb/br/pkg/restore",
visibility = ["//visibility:public"],
deps = [
"//br/pkg/backup",
"//br/pkg/checksum",
"//br/pkg/conn",
"//br/pkg/errors",
Expand All @@ -45,6 +46,7 @@ go_library(
"//statistics/handle",
"//store/pdtypes",
"//tablecodec",
"//util",
"//util/codec",
"//util/hack",
"//util/mathutil",
Expand Down Expand Up @@ -109,7 +111,9 @@ go_test(
"//br/pkg/mock",
"//br/pkg/rtree",
"//br/pkg/storage",
"//br/pkg/stream",
"//br/pkg/utils",
"//infoschema",
"//kv",
"//meta/autoid",
"//parser/model",
Expand All @@ -122,8 +126,10 @@ go_test(
"//testkit/testsetup",
"//types",
"//util/codec",
"//util/mathutil",
"@com_github_golang_protobuf//proto",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_pingcap_kvproto//pkg/brpb",
"@com_github_pingcap_kvproto//pkg/encryptionpb",
"@com_github_pingcap_kvproto//pkg/errorpb",
Expand Down
1 change: 1 addition & 0 deletions br/pkg/storage/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ go_library(
"@com_github_aws_aws_sdk_go//aws/session",
"@com_github_aws_aws_sdk_go//service/s3",
"@com_github_aws_aws_sdk_go//service/s3/s3iface",
"@com_github_aws_aws_sdk_go//service/s3/s3manager",
"@com_github_azure_azure_sdk_for_go_sdk_azidentity//:azidentity",
"@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//:azblob",
"@com_github_google_uuid//:uuid",
Expand Down
25 changes: 5 additions & 20 deletions br/pkg/stream/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,22 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "stream",
srcs = [
"client.go",
"decode_kv.go",
"meta_kv.go",
"models.go",
"prefix_scanner.go",
"rewrite_meta_rawkv.go",
"stream_mgr.go",
"stream_status.go",
],
importpath = "github.com/pingcap/tidb/br/pkg/stream",
visibility = ["//visibility:public"],
deps = [
"//br/pkg/backup",
"//br/pkg/conn",
"//br/pkg/errors",
"//br/pkg/glue",
"//br/pkg/httputil",
"//br/pkg/logutil",
"//br/pkg/redact",
"//br/pkg/storage",
"//br/pkg/streamhelper",
"//br/pkg/utils",
"//kv",
"//meta",
"//parser/model",
Expand All @@ -31,14 +27,12 @@ go_library(
"//util/codec",
"//util/table-filter",
"@com_github_fatih_color//:color",
"@com_github_gogo_protobuf//proto",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_kvproto//pkg/brpb",
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_pingcap_log//:log",
"@com_github_tikv_client_go_v2//kv",
"@com_github_tikv_client_go_v2//oracle",
"@io_etcd_go_etcd_client_v3//:client",
"@com_github_tikv_pd_client//:client",
"@org_golang_x_sync//errgroup",
"@org_uber_go_zap//:zap",
],
Expand All @@ -48,28 +42,19 @@ go_test(
name = "stream_test",
srcs = [
"decode_kv_test.go",
"integration_test.go",
"meta_kv_test.go",
"rewrite_meta_rawkv_test.go",
"stream_misc_test.go",
],
embed = [":stream"],
deps = [
"//br/pkg/errors",
"//br/pkg/logutil",
"//br/pkg/storage",
"//br/pkg/streamhelper",
"//meta",
"//parser/model",
"//tablecodec",
"//util/codec",
"@com_github_pingcap_errors//:errors",
"//util/table-filter",
"@com_github_pingcap_kvproto//pkg/brpb",
"@com_github_pingcap_log//:log",
"@com_github_stretchr_testify//require",
"@com_github_tikv_client_go_v2//kv",
"@io_etcd_go_etcd_client_v3//:client",
"@io_etcd_go_etcd_server_v3//embed",
"@io_etcd_go_etcd_server_v3//mvcc",
"@org_uber_go_zap//:zap",
],
)
81 changes: 81 additions & 0 deletions br/pkg/streamhelper/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "streamhelper",
srcs = [
"advancer.go",
"advancer_daemon.go",
"advancer_env.go",
"client.go",
"collector.go",
"models.go",
"prefix_scanner.go",
"regioniter.go",
"stream_listener.go",
"tsheap.go",
],
importpath = "github.com/pingcap/tidb/br/pkg/streamhelper",
visibility = ["//visibility:public"],
deps = [
"//br/pkg/errors",
"//br/pkg/logutil",
"//br/pkg/redact",
"//br/pkg/streamhelper/config",
"//br/pkg/utils",
"//config",
"//kv",
"//metrics",
"//owner",
"@com_github_gogo_protobuf//proto",
"@com_github_golang_protobuf//proto",
"@com_github_google_btree//:btree",
"@com_github_google_uuid//:uuid",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_kvproto//pkg/brpb",
"@com_github_pingcap_kvproto//pkg/logbackuppb",
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_pingcap_log//:log",
"@com_github_tikv_client_go_v2//kv",
"@com_github_tikv_client_go_v2//oracle",
"@com_github_tikv_pd_client//:client",
"@io_etcd_go_etcd_client_v3//:client",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//keepalive",
"@org_golang_x_sync//errgroup",
"@org_uber_go_zap//:zap",
],
)

go_test(
name = "streamhelper_test",
srcs = [
"advancer_test.go",
"basic_lib_for_test.go",
"integration_test.go",
"tsheap_test.go",
],
deps = [
":streamhelper",
"//br/pkg/errors",
"//br/pkg/logutil",
"//br/pkg/storage",
"//br/pkg/streamhelper/config",
"//kv",
"//tablecodec",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_kvproto//pkg/brpb",
"@com_github_pingcap_kvproto//pkg/errorpb",
"@com_github_pingcap_kvproto//pkg/logbackuppb",
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_pingcap_log//:log",
"@com_github_stretchr_testify//require",
"@com_github_tikv_client_go_v2//kv",
"@io_etcd_go_etcd_client_v3//:client",
"@io_etcd_go_etcd_server_v3//embed",
"@io_etcd_go_etcd_server_v3//mvcc",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
"@org_uber_go_zap//zapcore",
],
)
9 changes: 9 additions & 0 deletions br/pkg/streamhelper/config/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "config",
srcs = ["advancer_conf.go"],
importpath = "github.com/pingcap/tidb/br/pkg/streamhelper/config",
visibility = ["//visibility:public"],
deps = ["@com_github_spf13_pflag//:pflag"],
)
3 changes: 3 additions & 0 deletions br/pkg/task/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ go_library(
"//br/pkg/rtree",
"//br/pkg/storage",
"//br/pkg/stream",
"//br/pkg/streamhelper",
"//br/pkg/streamhelper/config",
"//br/pkg/summary",
"//br/pkg/utils",
"//br/pkg/version",
Expand Down Expand Up @@ -79,6 +81,7 @@ go_test(
"//br/pkg/pdutil",
"//br/pkg/restore",
"//br/pkg/storage",
"//br/pkg/stream",
"//br/pkg/utils",
"//config",
"//parser/model",
Expand Down
6 changes: 6 additions & 0 deletions br/pkg/utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ go_library(
"retry.go",
"safe_point.go",
"schema.go",
"store_manager.go",
"worker.go",
],
importpath = "github.com/pingcap/tidb/br/pkg/utils",
visibility = ["//visibility:public"],
deps = [
"//br/pkg/errors",
"//br/pkg/logutil",
"//br/pkg/metautil",
"//errno",
"//parser/model",
Expand All @@ -38,7 +40,11 @@ go_library(
"@com_github_pingcap_log//:log",
"@com_github_tikv_client_go_v2//oracle",
"@com_github_tikv_pd_client//:client",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//backoff",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//credentials",
"@org_golang_google_grpc//keepalive",
"@org_golang_google_grpc//status",
"@org_golang_x_net//http/httpproxy",
"@org_golang_x_sync//errgroup",
Expand Down
1 change: 1 addition & 0 deletions config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_library(
importpath = "github.com/pingcap/tidb/config",
visibility = ["//visibility:public"],
deps = [
"//br/pkg/streamhelper/config",
"//parser/terror",
"//types/json",
"//util/logutil",
Expand Down
2 changes: 2 additions & 0 deletions ddl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ go_test(
deps = [
"//config",
"//ddl/placement",
"//ddl/schematracker",
"//ddl/testutil",
"//ddl/util",
"//domain",
Expand Down Expand Up @@ -223,6 +224,7 @@ go_test(
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_pingcap_log//:log",
"@com_github_stretchr_testify//assert",
"@com_github_stretchr_testify//require",
"@com_github_tikv_client_go_v2//oracle",
"@com_github_tikv_client_go_v2//testutils",
Expand Down
51 changes: 51 additions & 0 deletions ddl/schematracker/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "schematracker",
srcs = [
"checker.go",
"dm_tracker.go",
"info_store.go",
],
importpath = "github.com/pingcap/tidb/ddl/schematracker",
visibility = ["//visibility:public"],
deps = [
"//ddl",
"//ddl/util",
"//executor",
"//infoschema",
"//kv",
"//meta/autoid",
"//owner",
"//parser/ast",
"//parser/charset",
"//parser/model",
"//sessionctx",
"//sessionctx/variable",
"//statistics/handle",
"//table",
"//table/tables",
"//tidb-binlog/pump_client",
"//util/collate",
"//util/dbterror",
"@com_github_ngaut_pools//:pools",
"@com_github_pingcap_errors//:errors",
],
)

go_test(
name = "schematracker_test",
srcs = [
"dm_tracker_test.go",
"info_store_test.go",
],
embed = [":schematracker"],
deps = [
"//infoschema",
"//parser",
"//parser/ast",
"//parser/model",
"//util/mock",
"@com_github_stretchr_testify//require",
],
)
1 change: 1 addition & 0 deletions domain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//bindinfo",
"//br/pkg/streamhelper",
"//config",
"//ddl",
"//ddl/util",
Expand Down
Loading

0 comments on commit 1256789

Please sign in to comment.