Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
conn: use GetDomain to avoid some TiDB breaking changes
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Shen <[email protected]>
  • Loading branch information
overvenus committed Mar 11, 2020
1 parent 237fe5b commit 63c41a4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/conn/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func NewMgr(
return nil, errors.Errorf("tikv cluster not health %+v", stores)
}

dom, err := g.BootstrapSession(storage)
dom, err := g.GetDomain(storage)
if err != nil {
return nil, errors.Trace(err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/glue/glue.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

// Glue is an abstraction of TiDB function calls used in BR.
type Glue interface {
BootstrapSession(store kv.Storage) (*domain.Domain, error)
GetDomain(store kv.Storage) (*domain.Domain, error)
CreateSession(store kv.Storage) (Session, error)
Open(path string, option pd.SecurityOption) (kv.Storage, error)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/gluetidb/glue.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ type tidbSession struct {
se session.Session
}

// BootstrapSession implements glue.Glue
func (Glue) BootstrapSession(store kv.Storage) (*domain.Domain, error) {
return session.BootstrapSession(store)
// GetDomain implements glue.Glue
func (Glue) GetDomain(store kv.Storage) (*domain.Domain, error) {
return session.GetDomain(store)
}

// CreateSession implements glue.Glue
Expand Down
2 changes: 1 addition & 1 deletion pkg/mock/mock_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewCluster() (*Cluster, error) {
}
session.SetSchemaLease(0)
session.DisableStats4Test()
dom, err := session.BootstrapSession(storage)
dom, err := session.GetDomain(storage)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 63c41a4

Please sign in to comment.