// Put put the final distribution in the context no matter the operator was created
Put put the final distribution in the context no matter the operator was created
// Put put the final distribution in the context no matter the operator was created
func (r *RegionScatterer) Put(peers map[uint64]*metapb.Peer, leaderStoreID uint64, group string) {
	ordinaryFilter := filter.NewOrdinaryEngineFilter(r.name)
	for _, peer := range peers {
		storeID := peer.GetStoreId()
		store := r.cluster.GetStore(storeID)
		if ordinaryFilter.Target(r.cluster.GetOpts(), store) {
			r.ordinaryEngine.selectedPeer.Put(storeID, group)
			scatterDistributionCounter.WithLabelValues(
				fmt.Sprintf("%v", storeID),
				fmt.Sprintf("%v", false),
				filter.EngineTiKV).Inc()
		} else {
			engine := store.GetLabelValue(filter.EngineKey)
			r.specialEngines[engine].selectedPeer.Put(storeID, group)
			scatterDistributionCounter.WithLabelValues(
				fmt.Sprintf("%v", storeID),
				fmt.Sprintf("%v", false),
				engine).Inc()
		}
	}
	r.ordinaryEngine.selectedLeader.Put(leaderStoreID, group)
	scatterDistributionCounter.WithLabelValues(
		fmt.Sprintf("%v", leaderStoreID),
		fmt.Sprintf("%v", true),
		filter.EngineTiKV).Inc()
}
func ( r * RegionScatterer ) Put ( peers map [ uint64 ] * metapb . Peer , leaderStoreID uint64 , group string ) { ordinaryFilter := filter . NewOrdinaryEngineFilter ( r . name ) for _ , peer := range peers { storeID := peer . GetStoreId ( ) store := r . cluster . GetStore ( storeID ) if ordinaryFilter . Target ( r . cluster . GetOpts ( ) , store ) { r . ordinaryEngine . selectedPeer . Put ( storeID , group ) scatterDistributionCounter . WithLabelValues ( fmt . Sprintf ( " " , storeID ) , fmt . Sprintf ( " " , false ) , filter . EngineTiKV ) . Inc ( ) } else { engine := store . GetLabelValue ( filter . EngineKey ) r . specialEngines [ engine ] . selectedPeer . Put ( storeID , group ) scatterDistributionCounter . WithLabelValues ( fmt . Sprintf ( " " , storeID ) , fmt . Sprintf ( " " , false ) , engine ) . Inc ( ) } } r . ordinaryEngine . selectedLeader . Put ( leaderStoreID , group ) scatterDistributionCounter . WithLabelValues ( fmt . Sprintf ( " " , leaderStoreID ) , fmt . Sprintf ( " " , true ) , filter . EngineTiKV ) . Inc ( ) }
Put put the final distribution in the context no matter the operator was created
Put put the final distribution in the context no matter the operator was created
// Group peers by the engine of their stores