Class HelixGroupRoutingStrategy
java.lang.Object
com.linkedin.venice.fastclient.meta.AbstractClientRoutingStrategy
com.linkedin.venice.fastclient.meta.HelixGroupRoutingStrategy
- Direct Known Subclasses:
HelixLatencyAdaptiveGroupRoutingStrategy,HelixLeastLoadedGroupRoutingStrategy
This strategy will assign an ordering of helix groups via round-robin for even distribution. The fanout in multi-get
will be performed using instances belonging to the assigned groups. If no instance belonging to the selected group is
found for a given partition, the instance with the next group in the assigned ordering will be used
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AtomicReference<HelixGroupInfo>protected final HelixGroupStatsprotected final InstanceHealthMonitor -
Constructor Summary
ConstructorsConstructorDescriptionHelixGroupRoutingStrategy(InstanceHealthMonitor instanceHealthMonitor, io.tehuti.metrics.MetricsRepository metricsRepository, String storeName) -
Method Summary
Modifier and TypeMethodDescriptionintintgetHelixGroupId(long requestId, int groupIdForOriginalRequest) getReplicas(long requestId, int groupId, List<String> replicas) protected voidrecordLatencySample(int groupId, int keyCount, double latency) Records a group's measured latency.protected booleanshouldRecordLatency(RequestContext requestContext, Throwable throwable) Whether a completed request feeds the group latency signal.booleantrackRequest(RequestContext requestContext) This method is used to track the request for any custom logic that needs to be executed when a request is sent.voidupdateHelixGroupInfo(Map<String, Integer> instanceToHelixGroupIdMap) Methods inherited from class com.linkedin.venice.fastclient.meta.AbstractClientRoutingStrategy
getHelixGroupId
-
Field Details
-
helixGroupInfoAtomicReference
-
instanceHealthMonitor
-
helixGroupStats
-
-
Constructor Details
-
HelixGroupRoutingStrategy
public HelixGroupRoutingStrategy(InstanceHealthMonitor instanceHealthMonitor, io.tehuti.metrics.MetricsRepository metricsRepository, String storeName)
-
-
Method Details
-
getReplicas
- Overrides:
getReplicasin classAbstractClientRoutingStrategy
-
getGroupCount
public int getGroupCount() -
updateHelixGroupInfo
- Overrides:
updateHelixGroupInfoin classAbstractClientRoutingStrategy
-
getHelixGroupId
public int getHelixGroupId(long requestId, int groupIdForOriginalRequest) - Overrides:
getHelixGroupIdin classAbstractClientRoutingStrategy
-
trackRequest
Description copied from class:AbstractClientRoutingStrategyThis method is used to track the request for any custom logic that needs to be executed when a request is sent.- Overrides:
trackRequestin classAbstractClientRoutingStrategy- Returns:
- boolean to indicate whether the request is tracked or not.
-
shouldRecordLatency
Whether a completed request feeds the group latency signal. Every completion counts here, preserving the least-loaded behavior where slow failures raise a group's average; the latency-adaptive strategy narrows this. -
recordLatencySample
protected void recordLatencySample(int groupId, int keyCount, double latency) Records a group's measured latency. The base strategy feeds the shared response-waiting-time metric (also consumed by least-loaded routing); the latency-adaptive strategy overrides this to record into its dedicated per-(group, bucket) routing metric when it is configured size-aware.
-