dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From careyyu (GitHub) <git...@apache.org>
Subject [GitHub] [incubator-dubbo] careyyu commented on issue #3097: 使用leastactive在provider启动时不会使用预热功能
Date Sat, 29 Dec 2018 09:12:37 GMT
围观围观

// 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 notifications@dubbo.apache.org
Mime
View raw message