func (h *hotScheduler) selectSrcStoreByHot(stats statistics.StoreHotPeersStat) (srcStoreID uint64) {
	var (
		maxFlowBytes float64
		maxCount     int
	)

	for storeID, stat := range stats {
		count, flowBytes := len(stat.Stats), stat.FutureBytesRate
		if count <= 1 {
			continue
		}
		// pick by count
		if count > maxCount || (count == maxCount && flowBytes > maxFlowBytes) {
			maxCount = count
			maxFlowBytes = flowBytes
			srcStoreID = storeID
		}
	}
	return
}
// Select the store to move hot regions from.
// We choose the store with the maximum number of hot region first.
// Inside these stores, we choose the one with maximum flow bytes.
Select the store to move hot regions from.
We choose the store with the maximum number of hot region first.
Inside these stores, we choose the one with maximum flow bytes.
// Select the store to move hot regions from . // We choose the store with the maximum number of hot region first . // Inside these stores we choose the one with maximum flow bytes .
func (h *hotScheduler) selectSrcStoreByHot(stats statistics.StoreHotPeersStat) (srcStoreID uint64) {
	var (
		maxFlowBytes float64
		maxCount     int
	)
	for storeID, stat := range stats {
		count, flowBytes := len(stat.Stats), stat.FutureBytesRate
		if count <= 1 {
			continue
		}
		if count > maxCount || (count == maxCount && flowBytes > maxFlowBytes) {
			maxCount = count
			maxFlowBytes = flowBytes
			srcStoreID = storeID
		}
	}
	return
}
func ( h * hotScheduler ) selectSrcStoreByHot ( stats statistics . StoreHotPeersStat ) ( srcStoreID uint64 ) { var ( maxFlowBytes float64 maxCount int ) for storeID , stat := range stats { count , flowBytes := len ( stat . Stats ) , stat . FutureBytesRate if count <= 1 { continue } if count > maxCount || ( count == maxCount && flowBytes > maxFlowBytes ) { maxCount = count maxFlowBytes = flowBytes srcStoreID = storeID } } return }
Select the store to move hot regions from.
Select the store to move hot regions from .
// pick by count