Skip to content

Commit

Permalink
server/cache: address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
huachaohuang committed Nov 17, 2016
1 parent 6489337 commit 80e12a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func newClusterInfo(id IDAllocator) *clusterInfo {
}

// Return nil if cluster is not bootstrapped.
func newClusterInfoWithKV(id IDAllocator, kv *kv) (*clusterInfo, error) {
func loadClusterInfo(id IDAllocator, kv *kv) (*clusterInfo, error) {
c := newClusterInfo(id)
c.kv = kv

Expand Down
4 changes: 2 additions & 2 deletions server/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (s *testClusterInfoSuite) TestLoadClusterInfo(c *C) {
kv := server.kv

// Cluster is not bootstrapped.
cluster, err := newClusterInfoWithKV(server.idAlloc, kv)
cluster, err := loadClusterInfo(server.idAlloc, kv)
c.Assert(err, IsNil)
c.Assert(cluster, IsNil)

Expand All @@ -226,7 +226,7 @@ func (s *testClusterInfoSuite) TestLoadClusterInfo(c *C) {
stores := mustSaveStores(c, kv, n)
regions := mustSaveRegions(c, kv, n)

cluster, err = newClusterInfoWithKV(server.idAlloc, kv)
cluster, err = loadClusterInfo(server.idAlloc, kv)
c.Assert(err, IsNil)
c.Assert(cluster, NotNil)

Expand Down
2 changes: 1 addition & 1 deletion server/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (c *RaftCluster) start() error {
return nil
}

cluster, err := newClusterInfoWithKV(c.s.idAlloc, c.s.kv)
cluster, err := loadClusterInfo(c.s.idAlloc, c.s.kv)
if err != nil {
return errors.Trace(err)
}
Expand Down

0 comments on commit 80e12a1

Please sign in to comment.