Skip to content

Commit

Permalink
address
Browse files Browse the repository at this point in the history
  • Loading branch information
nolouch committed May 17, 2017
1 parent c47d5b1 commit dd371a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion server/api/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
13 changes: 4 additions & 9 deletions server/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"fmt"
"math"
"path"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit dd371a8

Please sign in to comment.