Пример #1
0
 @Override
 public void close() {
   if (recordChanges.size() <= 32) {
     recordChanges.clear();
   } else {
     // Let's not allow the internal maps to grow too big over time.
     recordChanges = new HashMap<>();
   }
   changeCounter.clear();
 }
Пример #2
0
    private RECORD prepareForChange() {
      ensureHasBeforeRecordImage();
      if (!this.changed) {
        RecordProxy<KEY, RECORD, ADDITIONAL> previous = this.allChanges.put(key, this);

        if (previous == null || !previous.isChanged()) {
          changeCounter.increment();
        }

        this.changed = true;
      }
      return this.record;
    }
Пример #3
0
 @Override
 public int changeSize() {
   return changeCounter.value();
 }