Skip to content

Commit

Permalink
fix hot store command (#1244)
Browse files Browse the repository at this point in the history
  • Loading branch information
rleungx authored and disksing committed Sep 12, 2018
1 parent 65dc1d1 commit 4a87403
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,38 @@ func (h *Handler) GetHotReadRegions() *core.StoreHotRegionInfos {

// GetHotBytesWriteStores gets all hot write stores stats.
func (h *Handler) GetHotBytesWriteStores() map[uint64]uint64 {
return h.s.cluster.cachedCluster.getStoresBytesWriteStat()
cluster := h.s.GetRaftCluster()
if cluster == nil {
return nil
}
return cluster.cachedCluster.getStoresBytesWriteStat()
}

// GetHotBytesReadStores gets all hot write stores stats.
func (h *Handler) GetHotBytesReadStores() map[uint64]uint64 {
return h.s.cluster.cachedCluster.getStoresBytesReadStat()
cluster := h.s.GetRaftCluster()
if cluster == nil {
return nil
}
return cluster.cachedCluster.getStoresBytesReadStat()
}

// GetHotKeysWriteStores gets all hot write stores stats.
func (h *Handler) GetHotKeysWriteStores() map[uint64]uint64 {
return h.s.cluster.cachedCluster.getStoresKeysWriteStat()
cluster := h.s.GetRaftCluster()
if cluster == nil {
return nil
}
return cluster.cachedCluster.getStoresKeysWriteStat()
}

// GetHotKeysReadStores gets all hot write stores stats.
func (h *Handler) GetHotKeysReadStores() map[uint64]uint64 {
return h.s.cluster.cachedCluster.getStoresKeysReadStat()
cluster := h.s.GetRaftCluster()
if cluster == nil {
return nil
}
return cluster.cachedCluster.getStoresKeysReadStat()
}

// AddScheduler adds a scheduler.
Expand Down

0 comments on commit 4a87403

Please sign in to comment.