Skip to content

Commit c3dc20f

Browse files
Copilotlance6716
andcommitted
pkg/domain: remove duplicate EtcdClient() method
Co-authored-by: lance6716 <[email protected]>
1 parent 1a7df61 commit c3dc20f

File tree

5 files changed

+4
-9
lines changed

5 files changed

+4
-9
lines changed

pkg/ddl/schema_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func TestSchemaWaitJob(t *testing.T) {
300300
require.True(t, domain.DDL().OwnerManager().IsOwner())
301301

302302
d2, de2 := ddl.NewDDL(context.Background(),
303-
ddl.WithEtcdClient(domain.EtcdClient()),
303+
ddl.WithEtcdClient(domain.GetEtcdClient()),
304304
ddl.WithStore(store),
305305
ddl.WithInfoCache(domain.InfoCache()),
306306
ddl.WithLease(testLease),

pkg/domain/domain.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,6 @@ func (do *Domain) InfoCache() *infoschema.InfoCache {
241241
return do.infoCache
242242
}
243243

244-
// EtcdClient export for test.
245-
func (do *Domain) EtcdClient() *clientv3.Client {
246-
return do.etcdClient
247-
}
248-
249244
// UnprefixedEtcdCli export for test.
250245
func (do *Domain) UnprefixedEtcdCli() *clientv3.Client {
251246
return do.unprefixedEtcdCli

pkg/session/bootstrap_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2641,7 +2641,7 @@ func checkETCDNameSpace(t *testing.T, dom *domain.Domain, isHasPrefix bool) {
26412641
}
26422642

26432643
// Put key value into etcd.
2644-
_, err := dom.EtcdClient().Put(context.Background(), testKeyWithoutPrefix, testVal)
2644+
_, err := dom.GetEtcdClient().Put(context.Background(), testKeyWithoutPrefix, testVal)
26452645
require.NoError(t, err)
26462646

26472647
// Use expectTestKey to get the key from etcd.

pkg/session/sync_upgrade.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func SyncUpgradeState(s sessionctx.Context, timeout time.Duration) error {
6363

6464
var op owner.OpType
6565
childCtx, cancel := context.WithTimeout(ctx, 3*time.Second)
66-
op, err = owner.GetOwnerOpValue(childCtx, dom.EtcdClient(), ddl.DDLOwnerKey)
66+
op, err = owner.GetOwnerOpValue(childCtx, dom.GetEtcdClient(), ddl.DDLOwnerKey)
6767
cancel()
6868
if err == nil && op.IsSyncedUpgradingState() {
6969
break

tests/realtikvtest/brietest/pitr_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ type LogBackupKit struct {
135135

136136
func NewLogBackupKit(t *testing.T) *LogBackupKit {
137137
tk := initTestKit(t)
138-
metaCli := streamhelper.NewMetaDataClient(domain.GetDomain(tk.Session()).EtcdClient())
138+
metaCli := streamhelper.NewMetaDataClient(domain.GetDomain(tk.Session()).GetEtcdClient())
139139
begin := time.Now()
140140
// So the cases can finish faster...
141141
tk.MustExec("set config tikv `log-backup.max-flush-interval` = '30s';")

0 commit comments

Comments
 (0)