围观围观
// assert(leastCount > 0)
if (leastCount == 1) {
// 如果只有一个最小则直接返回, 大流量场景下 一个provider启动,会不会直接进入到这里呢
return invokers.get(leastIndexs[0]);
}
if (! sameWeight && totalWeight > 0) {
int offsetWeight = random.nextInt(totalWeight);
for (int i = 0; i < leastCount; i++) {
int leastIndex = leastIndexs[i];
offsetWeight -= getWeight(invokers.get(leastIndex), invocation);
if (offsetWeight <= 0)
return invokers.get(leastIndex);
}
}
[ Full content available at:
https://github.com/apache/incubator-dubbo/issues/3097 ]
This message was relayed via gitbox.apache.org for
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]