Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed May 28, 2024
1 parent c1713cc commit 83a6ee8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/core/basic_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (bc *BasicCluster) GetLeaderStoreByRegionID(regionID uint64) *StoreInfo {
return nil
}

return bc.StoresInfo.GetStore(region.GetLeader().GetStoreId())
return bc.GetStore(region.GetLeader().GetStoreId())
}

func (bc *BasicCluster) getWriteRate(
Expand Down
18 changes: 9 additions & 9 deletions pkg/core/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,26 +702,26 @@ func (s *StoresInfo) GetStoreIDs() []uint64 {
func (s *StoresInfo) GetFollowerStores(region *RegionInfo) []*StoreInfo {
s.RLock()
defer s.RUnlock()
var Stores []*StoreInfo
var stores []*StoreInfo
for id := range region.GetFollowers() {
if store, ok := s.stores[id]; ok && store != nil {
Stores = append(Stores, store)
stores = append(stores, store)
}
}
return Stores
return stores
}

// GetRegionStores returns all Stores that contains the region's peer.
func (s *StoresInfo) GetRegionStores(region *RegionInfo) []*StoreInfo {
s.RLock()
defer s.RUnlock()
var Stores []*StoreInfo
var stores []*StoreInfo
for id := range region.GetStoreIDs() {
if store, ok := s.stores[id]; ok && store != nil {
Stores = append(Stores, store)
stores = append(stores, store)
}
}
return Stores
return stores
}

// GetLeaderStore returns all Stores that contains the region's leader peer.
Expand All @@ -745,13 +745,13 @@ func (s *StoresInfo) GetStoreCount() int {
func (s *StoresInfo) GetNonWitnessVoterStores(region *RegionInfo) []*StoreInfo {
s.RLock()
defer s.RUnlock()
var Stores []*StoreInfo
var stores []*StoreInfo
for id := range region.GetNonWitnessVoters() {
if store, ok := s.stores[id]; ok && store != nil {
Stores = append(Stores, store)
stores = append(stores, store)
}
}
return Stores
return stores
}

/* Stores write operations */
Expand Down

0 comments on commit 83a6ee8

Please sign in to comment.