Class PercentileSpeculativeExecutionPolicy

    • Constructor Detail

      • PercentileSpeculativeExecutionPolicy

        public PercentileSpeculativeExecutionPolicy​(PercentileTracker percentileTracker,
                                                    double percentile,
                                                    int maxSpeculativeExecutions)
        Builds a new instance.
        Parameters:
        percentileTracker - the component that will record latencies. It will get registered with the cluster when this policy initializes.
        percentile - the percentile that a request's latency must fall into to be considered slow (ex: 99.0).
        maxSpeculativeExecutions - the maximum number of speculative executions that will be triggered for a given request (this does not include the initial, normal request). Must be strictly positive.
    • Method Detail

      • getMaxSpeculativeExecutions

        @Beta
        public int getMaxSpeculativeExecutions()
        The maximum number of speculative executions this policy triggers for a request, as specified at instantiation. This does not include the initial, normal request.
        Returns:
        the maximum number of speculative executions, always strictly positive.
      • getPercentile

        @Beta
        public double getPercentile()
        The latency percentile a request must fall into to be considered slow, as specified at instantiation.
        Returns:
        the percentile, in the range 0 (inclusive) to 100 (exclusive).
      • close

        public void close()
        Description copied from interface: SpeculativeExecutionPolicy
        Gets invoked at cluster shutdown.

        This gives the policy the opportunity to perform some cleanup, for instance stop threads that it might have started.

        Specified by:
        close in interface SpeculativeExecutionPolicy