basho / riak_dt

Convergent replicated datatypes in Erlang
Apache License 2.0
353 stars 70 forks source link

Improve efficiency of flags. #64

Closed seancribbs closed 11 years ago

seancribbs commented 11 years ago

This changes the OE/OD flags to be "tombstone-less", like ORSWOTs (or more accurately, VVORSets). Basically the "observed" operation flips the flag without incrementing, while the opposite operation increments the vector clock. This greatly reduces space complexity, and consolidates our garbage into the same type as produced by other types, namely actor IDs.

I also put the binary-roundtrip EQC into both of these types and added type annotations.

@russelldb

russelldb commented 11 years ago

Tests pass, code reads very well. Sneaking suspicion these flags could be a single module, but maybe the added complexity is worse than the slight duplication. +1, merge at will. And thanks!