Class HelixGroupSelector
java.lang.Object
com.linkedin.venice.router.api.routing.helix.HelixGroupSelector
- All Implemented Interfaces:
HelixGroupSelectionStrategy
This class is a thin wrapper of
HelixInstanceConfigRepository
and HelixGroupSelectionStrategy
, and it
will delegate all the related API calls to the corresponding objects.
Besides that, this class is also in charge of emitting metrics for each Helix Group.-
Constructor Summary
ConstructorDescriptionHelixGroupSelector
(io.tehuti.metrics.MetricsRepository metricsRepository, HelixInstanceConfigRepository instanceConfigRepository, HelixGroupSelectionStrategyEnum strategyEnum, TimeoutProcessor timeoutProcessor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
finishRequest
(long requestId, int groupId, double latency) Notify the corresponding Helix Group that the request is completed, and the implementation will decide whether any cleanup is required or not.int
int
getInstanceGroupId
(String instanceId) int
selectGroup
(long requestId, int groupNum) Select a Helix Group for the current request.
-
Constructor Details
-
HelixGroupSelector
public HelixGroupSelector(io.tehuti.metrics.MetricsRepository metricsRepository, HelixInstanceConfigRepository instanceConfigRepository, HelixGroupSelectionStrategyEnum strategyEnum, TimeoutProcessor timeoutProcessor)
-
-
Method Details
-
getInstanceGroupId
-
getGroupCount
public int getGroupCount() -
selectGroup
public int selectGroup(long requestId, int groupNum) Description copied from interface:HelixGroupSelectionStrategy
Select a Helix Group for the current request.- Specified by:
selectGroup
in interfaceHelixGroupSelectionStrategy
-
finishRequest
public void finishRequest(long requestId, int groupId, double latency) Description copied from interface:HelixGroupSelectionStrategy
Notify the corresponding Helix Group that the request is completed, and the implementation will decide whether any cleanup is required or not.- Specified by:
finishRequest
in interfaceHelixGroupSelectionStrategy
-