Class HelixGroupRoundRobinStrategy
- java.lang.Object
-
- com.linkedin.venice.router.api.routing.helix.HelixGroupRoundRobinStrategy
-
- All Implemented Interfaces:
HelixGroupSelectionStrategy
public class HelixGroupRoundRobinStrategy extends java.lang.Object implements HelixGroupSelectionStrategy
This simple strategy will try to distribute the load evenly to every Helix Group.
-
-
Constructor Summary
Constructors Constructor Description HelixGroupRoundRobinStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finishRequest(long requestId, int groupId)
Notify the corresponding Helix Group that the request is completed, and the implementation will decide whether any cleanup is required or not.int
getAvgGroupPendingRequest()
Get the average of the pending requests among all the groupsint
getMaxGroupPendingRequest()
Get the maximum of the pending requests among all the groupsint
getMinGroupPendingRequest()
Get the minimum of the pending requests among all the groupsint
selectGroup(long requestId, int groupNum)
Select a Helix Group for the current request.
-
-
-
Method Detail
-
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)
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
-
getMaxGroupPendingRequest
public int getMaxGroupPendingRequest()
Description copied from interface:HelixGroupSelectionStrategy
Get the maximum of the pending requests among all the groups- Specified by:
getMaxGroupPendingRequest
in interfaceHelixGroupSelectionStrategy
-
getMinGroupPendingRequest
public int getMinGroupPendingRequest()
Description copied from interface:HelixGroupSelectionStrategy
Get the minimum of the pending requests among all the groups- Specified by:
getMinGroupPendingRequest
in interfaceHelixGroupSelectionStrategy
-
getAvgGroupPendingRequest
public int getAvgGroupPendingRequest()
Description copied from interface:HelixGroupSelectionStrategy
Get the average of the pending requests among all the groups- Specified by:
getAvgGroupPendingRequest
in interfaceHelixGroupSelectionStrategy
-
-