GSet ported to delta-CRDT (#22187)

This commit is contained in:
gosubpl 2017-01-26 14:26:25 +01:00
parent 5ffb08cd78
commit d470321051
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);
}