code: public static long getMaxVisibleTimestamp(Transaction tx) {
      // NOTE: +1 here because we want read up to writepointer inclusive, but timerange's end is exclusive
      // however, we also need to guard against overflow in the case write pointer is set to MAX_VALUE
      return tx.getWritePointer() < Long.MAX_VALUE ?
          tx.getWritePointer() + 1 : tx.getWritePointer();
    }
docs: Returns the maximum timestamp to use for time-range operations, based on the given transaction.
  @param tx The current transaction
  @return The maximum timestamp (exclusive) to use for time-range operations