Class LeastLoadedClientRoutingStrategy
- java.lang.Object
-
- com.linkedin.venice.fastclient.meta.AbstractClientRoutingStrategy
-
- com.linkedin.venice.fastclient.meta.LeastLoadedClientRoutingStrategy
-
- All Implemented Interfaces:
ClientRoutingStrategy
public class LeastLoadedClientRoutingStrategy extends AbstractClientRoutingStrategy
This strategy is trying to route the request to the least-loaded instances. 1. If the weight of every instance is same, it will fall back to the round-robin fashion. 2. This strategy will skip any blocked instance. 3. When any selected instance is marked as unhealthy, this strategy will try to back-fill with the healthy instances, and there are two purposes: a. The latency shouldn't be affected since this strategy will still try to send request to the required healthy instances. b. The unhealthy instance will still receive any requests, so we could mark it healthy once it is recovered.
-
-
Constructor Summary
Constructors Constructor Description LeastLoadedClientRoutingStrategy(InstanceHealthMonitor instanceHealthMonitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getReplicas(long ignored, java.util.List<java.lang.String> replicas, int requiredReplicaCount)
-
Methods inherited from class com.linkedin.venice.fastclient.meta.AbstractClientRoutingStrategy
updateHelixGroupInfo
-
-
-
-
Constructor Detail
-
LeastLoadedClientRoutingStrategy
public LeastLoadedClientRoutingStrategy(InstanceHealthMonitor instanceHealthMonitor)
-
-
Method Detail
-
getReplicas
public java.util.List<java.lang.String> getReplicas(long ignored, java.util.List<java.lang.String> replicas, int requiredReplicaCount)
- Specified by:
getReplicas
in interfaceClientRoutingStrategy
- Overrides:
getReplicas
in classAbstractClientRoutingStrategy
-
-