Merge pull request #22269 from gosubpl/wip/22187-delta-crdt-gset

GSet ported to delta-CRDT (#22187)
This commit is contained in:
Patrik Nordwall 2017-02-16 15:45:28 +01:00 committed by GitHub
commit 96652d38b4
5 changed files with 80 additions and 20 deletions

View file

@ -79,7 +79,9 @@ public class TwoPhaseSetSerializer extends AbstractSerializationSupport {
for (String elem : msg.getRemovalsList()) {
removals = removals.add(elem);
}
return new TwoPhaseSet(adds, removals);
// GSet will accumulate deltas when adding elements,
// but those are not of interest in the result of the deserialization
return new TwoPhaseSet(adds.resetDelta(), removals.resetDelta());
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}