private void discardTombstones() {
    if (activeTransactions.isEmpty()) {
      Iterator<Map.Entry<K, MapEntryValue>> iterator = entries().entrySet().iterator();
      while (iterator.hasNext()) {
        MapEntryValue value = iterator.next().getValue();
        if (value.type() == MapEntryValue.Type.TOMBSTONE) {
          iterator.remove();
        }
      }
    } else {
      long lowWaterMark = activeTransactions.values().stream()
          .mapToLong(TransactionScope::version)
          .min().getAsLong();
      Iterator<Map.Entry<K, MapEntryValue>> iterator = entries().entrySet().iterator();
      while (iterator.hasNext()) {
        MapEntryValue value = iterator.next().getValue();
        if (value.type() == MapEntryValue.Type.TOMBSTONE && value.version < lowWaterMark) {
          iterator.remove();
        }
      }
    }
  }
private void discardTombstones ( ) { if ( activeTransactions . isEmpty ( ) ) { Iterator < Map . Entry < K , MapEntryValue > > iterator = entries ( ) . entrySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { MapEntryValue value = iterator . next ( ) . getValue ( ) ; if ( value . type ( ) == MapEntryValue . Type . TOMBSTONE ) { iterator . remove ( ) ; } } } else { long lowWaterMark = activeTransactions . values ( ) . stream ( ) . mapToLong ( TransactionScope :: version ) . min ( ) . getAsLong ( ) ; Iterator < Map . Entry < K , MapEntryValue > > iterator = entries ( ) . entrySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { MapEntryValue value = iterator . next ( ) . getValue ( ) ; if ( value . type ( ) == MapEntryValue . Type . TOMBSTONE && value . version < lowWaterMark ) { iterator . remove ( ) ; } } } }
Discards tombstones no longer needed by active transactions.