Skip to content

Commit

Permalink
move place
Browse files Browse the repository at this point in the history
Signed-off-by: okJiang <[email protected]>
  • Loading branch information
okJiang committed Sep 11, 2024
1 parent b8f2c9e commit 402102c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/mcs/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/soheilhy/cmux"
"github.com/tikv/pd/pkg/errs"
"github.com/tikv/pd/pkg/global"
"github.com/tikv/pd/pkg/mcs/discovery"
"github.com/tikv/pd/pkg/mcs/utils/constant"
"github.com/tikv/pd/pkg/storage/endpoint"
"github.com/tikv/pd/pkg/utils/apiutil"
"github.com/tikv/pd/pkg/utils/apiutil/multiservicesapi"
"github.com/tikv/pd/pkg/utils/etcdutil"
Expand All @@ -53,7 +53,7 @@ func InitClusterID(ctx context.Context, client *clientv3.Client) (id uint64, err
defer ticker.Stop()
retryTimes := 0
for {
if clusterID, err := global.GetClusterIDFromEtcd(client); err == nil && clusterID != 0 {
if clusterID, err := endpoint.GetClusterIDFromEtcd(client); err == nil && clusterID != 0 {
return clusterID, nil
}
select {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package global
package endpoint

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package global
package endpoint

import (
"testing"
Expand Down
3 changes: 1 addition & 2 deletions pkg/tso/keyspace_group_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/pingcap/failpoint"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/tikv/pd/pkg/global"
"github.com/tikv/pd/pkg/mcs/discovery"
"github.com/tikv/pd/pkg/mcs/utils/constant"
"github.com/tikv/pd/pkg/storage/endpoint"
Expand Down Expand Up @@ -1047,7 +1046,7 @@ func (suite *keyspaceGroupManagerTestSuite) TestPrimaryPriorityChange() {

var err error
defaultPriority := constant.DefaultKeyspaceGroupReplicaPriority
clusterID, err := global.InitClusterID(suite.etcdClient)
clusterID, err := endpoint.InitClusterID(suite.etcdClient)
re.NoError(err)
clusterIDStr := strconv.FormatUint(clusterID, 10)
rootPath := path.Join("/pd", clusterIDStr)
Expand Down
4 changes: 2 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import (
"github.com/tikv/pd/pkg/encryption"
"github.com/tikv/pd/pkg/errs"
"github.com/tikv/pd/pkg/gc"
"github.com/tikv/pd/pkg/global"
"github.com/tikv/pd/pkg/id"
"github.com/tikv/pd/pkg/keyspace"
ms_server "github.com/tikv/pd/pkg/mcs/metastorage/server"
Expand All @@ -65,6 +64,7 @@ import (
"github.com/tikv/pd/pkg/schedule/hbstream"
"github.com/tikv/pd/pkg/schedule/placement"
"github.com/tikv/pd/pkg/storage"
"github.com/tikv/pd/pkg/storage/endpoint"
"github.com/tikv/pd/pkg/storage/kv"
"github.com/tikv/pd/pkg/syncer"
"github.com/tikv/pd/pkg/systimemon"
Expand Down Expand Up @@ -426,7 +426,7 @@ func (s *Server) AddStartCallback(callbacks ...func()) {
}

func (s *Server) startServer(ctx context.Context) error {
clusterID, err := global.InitClusterID(s.client)
clusterID, err := endpoint.InitClusterID(s.client)
if err != nil {
log.Error("failed to init cluster id", errs.ZapError(err))
return err
Expand Down

0 comments on commit 402102c

Please sign in to comment.