// IsolationComparer creates a StoreComparer to sort store by isolation score.
IsolationComparer creates a StoreComparer to sort store by isolation score.
// IsolationComparer creates a StoreComparer to sort store by isolation score .
func IsolationComparer(locationLabels []string, regionStores []*core.StoreInfo) StoreComparer {
	return func(a, b *core.StoreInfo) int {
		sa := core.DistinctScore(locationLabels, regionStores, a)
		sb := core.DistinctScore(locationLabels, regionStores, b)
		switch {
		case sa > sb:
			return 1
		case sa < sb:
			return -1
		default:
			return 0
		}
	}
}
func IsolationComparer ( locationLabels [ ] string , regionStores [ ] * core . StoreInfo ) StoreComparer { return func ( a , b * core . StoreInfo ) int { sa := core . DistinctScore ( locationLabels , regionStores , a ) sb := core . DistinctScore ( locationLabels , regionStores , b ) switch { case sa > sb : return 1 case sa < sb : return - 1 default : return 0 } } }
IsolationComparer creates a StoreComparer to sort store by isolation score.
IsolationComparer creates a StoreComparer to sort store by isolation score .