You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Masood Mortazavi <ma...@gmail.com> on 2010/07/14 02:05:56 UTC

Minor point on FailureDetector

In FailureDetector, in ArrivalWindow, in "double p(double t)",

is

        return 1 - ( 1 - Math.pow(Math.E, exponent) );

really needed, instead of

        return Math.pow(Math.E, exponent) ;

I believe the integral of the the Exponential Distribution from "t" to
infinity leads to the latter value.

While most Java compilers are probably smart enough to take care of the
redundant subtractions, there's no explanatory value I see in the former
form. I just ran into this as I was reviewing the accrual failure detector
code.

- m .

Re: Minor point on FailureDetector

Posted by Jonathan Ellis <jb...@gmail.com>.
You're right.  Committed the simplification.

On Tue, Jul 13, 2010 at 7:05 PM, Masood Mortazavi
<ma...@gmail.com> wrote:
> In FailureDetector, in ArrivalWindow, in "double p(double t)",
>
> is
>
>        return 1 - ( 1 - Math.pow(Math.E, exponent) );
>
> really needed, instead of
>
>        return Math.pow(Math.E, exponent) ;
>
> I believe the integral of the the Exponential Distribution from "t" to
> infinity leads to the latter value.
>
> While most Java compilers are probably smart enough to take care of the
> redundant subtractions, there's no explanatory value I see in the former
> form. I just ran into this as I was reviewing the accrual failure detector
> code.
>
> - m .
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com