Class HelixGroupRoutingStrategy
java.lang.Object
com.linkedin.venice.fastclient.meta.AbstractClientRoutingStrategy
com.linkedin.venice.fastclient.meta.HelixGroupRoutingStrategy
- Direct Known Subclasses:
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 HelixGroupStats
protected final InstanceHealthMonitor
-
Constructor Summary
ConstructorsConstructorDescriptionHelixGroupRoutingStrategy
(InstanceHealthMonitor instanceHealthMonitor, io.tehuti.metrics.MetricsRepository metricsRepository, String storeName) -
Method Summary
Modifier and TypeMethodDescriptionint
int
getHelixGroupId
(long requestId, int groupIdForOriginalRequest) getReplicas
(long requestId, int groupId, List<String> replicas) boolean
trackRequest
(RequestContext requestContext) This method is used to track the request for any custom logic that needs to be executed when a request is sent.void
updateHelixGroupInfo
(Map<String, Integer> instanceToHelixGroupIdMap)
-
Field Details
-
helixGroupInfoAtomicReference
-
instanceHealthMonitor
-
helixGroupStats
-
-
Constructor Details
-
HelixGroupRoutingStrategy
public HelixGroupRoutingStrategy(InstanceHealthMonitor instanceHealthMonitor, io.tehuti.metrics.MetricsRepository metricsRepository, String storeName)
-
-
Method Details
-
getReplicas
- Overrides:
getReplicas
in classAbstractClientRoutingStrategy
-
getGroupCount
public int getGroupCount() -
updateHelixGroupInfo
- Overrides:
updateHelixGroupInfo
in classAbstractClientRoutingStrategy
-
getHelixGroupId
public int getHelixGroupId(long requestId, int groupIdForOriginalRequest) - Overrides:
getHelixGroupId
in classAbstractClientRoutingStrategy
-
trackRequest
Description copied from class:AbstractClientRoutingStrategy
This method is used to track the request for any custom logic that needs to be executed when a request is sent.- Overrides:
trackRequest
in classAbstractClientRoutingStrategy
- Returns:
- boolean to indicate whether the request is tracked or not.
-