"Accumulator" convergent data type

Jon Meredith jmeredith at basho.com
Wed Oct 7 10:02:25 EDT 2015

Conceptually I think it should work - the same PN counter design could
handle floats as well as integers.  You'd have to make sure the P and N
values only grew by handling the sign - if you want to add a negative float
you would do N += abs(V). There are also concerns around error bounds and
all those kinds of things you deal with in floats.  I'll risk stating the
obvious and say you could do fixed point stuff with the existing counters
if you multiply / divide by a scale factor on store/retrieval

On Wed, Oct 7, 2015 at 7:40 AM Emyr James <ej4 at sanger.ac.uk> wrote:

> Hi,
> This is more of a question for developing riak as opposed to using it,
> anyway I thought it worth asking.
> You have the "Counter" convergent datatype which allows increment and
> decrement of arbitrary integer values.
> Would it be possible to implement an "Accumulator" datatype which would
> be a floating-point equivalent of counter and allow increment and
> decrement by arbitrary floating point values ?
> Regards,
> Emyr
> --
>  The Wellcome Trust Sanger Institute is operated by Genome Research
>  Limited, a charity registered in England with number 1021457 and a
>  company registered in England with number 2742969, whose registered
>  office is 215 Euston Road, London, NW1 2BE.
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20151007/b61e1dad/attachment-0002.html>

More information about the riak-users mailing list