code: void update(final T item, final double weight, final boolean mark) {
      if (item == null) {
        return;
      }
      if (weight <= 0.0) {
        throw new SketchesArgumentException("Item weights must be strictly positive: "
                + weight + ", for item " + item.toString());
      }
      ++n_;
  
      if (r_ == 0) {
        // exact mode
        updateWarmupPhase(item, weight, mark);
      } else {
        // sketch is in estimation mode, so we can make the following check
        assert (h_ == 0) || (peekMin() >= getTau());
  
        // what tau would be if deletion candidates turn out to be R plus the new item
        // note: (r_ + 1) - 1 is intentional
        final double hypotheticalTau = (weight + totalWtR_) / ((r_ + 1) - 1);
  
        // is new item's turn to be considered for reservoir?
        final boolean condition1 = (h_ == 0) || (weight <= peekMin());
  
        // is new item light enough for reservoir?
        final boolean condition2 = weight < hypotheticalTau;
  
        if (condition1 && condition2) {
          updateLight(item, weight, mark);
        } else if (r_ == 1) {
          updateHeavyREq1(item, weight, mark);
        } else {
          updateHeavyGeneral(item, weight, mark);
        }
      }
    }
docs: Internal implementation of update() which requires the user to know if an item is
  marked as coming from the reservoir region of a sketch. The marks are used only in
  merging.
  
  @param item an item of the set being sampled from
  @param weight a strictly positive weight associated with the item
  @param mark true if an item comes from a sketch's reservoir region