Class HelixGroupSelector

java.lang.Object
com.linkedin.venice.router.api.routing.helix.HelixGroupSelector
All Implemented Interfaces:
HelixGroupSelectionStrategy

public class HelixGroupSelector extends Object implements 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

    Constructors
    Constructor
    Description
    HelixGroupSelector(io.tehuti.metrics.MetricsRepository metricsRepository, HelixInstanceConfigRepository instanceConfigRepository, HelixGroupSelectionStrategyEnum strategyEnum, TimeoutProcessor timeoutProcessor, double skewRampExponent, NavigableMap<Integer,Integer> latencyAdaptiveBatchGetThresholdMs, double evenUntilFraction, long minSampleCount)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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.
    void
    finishRequest(long requestId, int groupId, int keyCount, double latency)
    Size-aware request completion: records the latency under the request's keyCount so a size-aware strategy can attribute it to the matching bucket.
    void
    finishRequest(long requestId, int groupId, int keyCount, double latency, boolean success)
    Success-aware request completion: success is false when the request failed (error or throttled) response, letting a latency-adaptive strategy keep the latency sample out of its routing signal so a fast-failing group is not mistaken for a fast-serving one.
    int
     
    int
     
    int
    selectGroup(long requestId, int groupNum)
    Select a Helix Group for the current request.
    int
    selectGroup(long requestId, int groupNum, int keyCount)
    Size-aware group selection: keyCount is the number of keys in the request, letting a strategy route by request size.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait