boolean consolidateWith(Item other) { if (_consolidatedEventIds.size() >= MAX_EVENTS_TO_CONSOLIDATE) { return false; } // We'll construct an event key that combines all the duplicate events. Unfortunately we can't discard/ack // the extra events at this time, subtle race conditions result that can cause clients to miss events. _consolidatedEventIds.addAll(other._consolidatedEventIds); // Pick the newest version of the content. There's no reason to return stale stuff. if (Intrinsic.getVersion(_content) < Intrinsic.getVersion(other._content)) { _content = other._content; } // Combine tags from the other event for (List<String> tagList : other._tags) { // The contents of "tagList" are already sorted, no need to sort again. _tags = sortedTagUnion(_tags, tagList); } return true; }
boolean consolidateWith(Item other) { if (_consolidatedEventIds.size() >= MAX_EVENTS_TO_CONSOLIDATE) { return false; } // We'll construct an event key that combines all the duplicate events. Unfortunately we can't discard/ack // the extra events at this time, subtle race conditions result that can cause clients to miss events. _consolidatedEventIds.addAll(other._consolidatedEventIds); // Pick the newest version of the content. There's no reason to return stale stuff. if (Intrinsic.getVersion(_content) < Intrinsic.getVersion(other._content)) { _content = other._content; } // Combine tags from the other event for (List<String> tagList : other._tags) { // The contents of "tagList" are already sorted, no need to sort again. _tags = sortedTagUnion(_tags, tagList); } return true; }
public long getVersion() { return Intrinsic.getVersion(getMap()); }
public long getVersion() { return Intrinsic.getVersion(getMap()); }