From dd371a895a4f2084282adf26daac79f59500353a Mon Sep 17 00:00:00 2001 From: nolouch Date: Wed, 17 May 2017 15:46:08 +0800 Subject: [PATCH] address --- server/api/cluster_test.go | 1 - server/cluster.go | 13 ++++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/server/api/cluster_test.go b/server/api/cluster_test.go index 8e745f2e092..d8f3a453d96 100644 --- a/server/api/cluster_test.go +++ b/server/api/cluster_test.go @@ -67,7 +67,6 @@ func (s *testClusterInfo) TestGetClusterStatus(c *C) { now := time.Now() mustBootstrapCluster(c, s.svr) err = readJSONWithURL(url, &status) - fmt.Printf("%+v", status) c.Assert(err, IsNil) c.Assert(status.BootstrapTime.After(now), IsTrue) } diff --git a/server/cluster.go b/server/cluster.go index fe0933e7d08..dafb64857d9 100644 --- a/server/cluster.go +++ b/server/cluster.go @@ -17,7 +17,6 @@ import ( "fmt" "math" "path" - "strings" "sync" "time" @@ -233,23 +232,19 @@ func (s *Server) stopRaftCluster() { } func makeStoreKey(clusterRootPath string, storeID uint64) string { - return strings.Join([]string{clusterRootPath, "s", fmt.Sprintf("%020d", storeID)}, "/") + return path.Join(clusterRootPath, "s", fmt.Sprintf("%020d", storeID)) } func makeRegionKey(clusterRootPath string, regionID uint64) string { - return strings.Join([]string{clusterRootPath, "r", fmt.Sprintf("%020d", regionID)}, "/") -} - -func makeStoreKeyPrefix(clusterRootPath string) string { - return strings.Join([]string{clusterRootPath, "s", ""}, "/") + return path.Join(clusterRootPath, "r", fmt.Sprintf("%020d", regionID)) } func makeRaftClusterStatusPrefix(clusterRootPath string) string { - return strings.Join([]string{clusterRootPath, "status"}, "/") + return path.Join(clusterRootPath, "status") } func makeBootstrapTimeKey(clusterRootPath string) string { - return strings.Join([]string{makeRaftClusterStatusPrefix(clusterRootPath), "bootstrap_time"}, "/") + return path.Join(makeRaftClusterStatusPrefix(clusterRootPath), "bootstrap_time") } func checkBootstrapRequest(clusterID uint64, req *pdpb.BootstrapRequest) error {