private long getUpdatingTime() {
    while (true) {
      long oldTime = lastUpdatingTime.get();
      long newTime = clock.currentTimeMillis() * collisionBuffer;
      long updatingTime = newTime > oldTime ? newTime : oldTime + 1;
      // make sure the updateTime doesn't overflow to the next millisecond
      if (updatingTime == newTime + collisionBuffer) {
        --updatingTime;
      }
      // make sure no other threads modify the lastUpdatingTime
      if (lastUpdatingTime.compareAndSet(oldTime, updatingTime)) {
        return updatingTime;
      }
    }
  }
Return the new updating time. If the new value's system time equals to last
value's, use the last updating time + 1 as the new updating time. This
operation guarantees all the updating times in the <code>storage</code>
strictly increment. No override happens before reaching the
<code>collisionBuffer</code>.

@return the updating time
samza-api/src/main/java/org/apache/samza/metrics/SlidingTimeWindowReservoir.java