/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.flink.api.common.eventtime;

import org.apache.flink.annotation.Public;

/**
 * A {@code TimestampAssigner} assigns event time timestamps to elements.
 * These timestamps are used by all functions that operate on event time,
 * for example event time windows.
 *
 * <p>Timestamps can be an arbitrary {@code long} value, but all built-in implementations
 * represent it as the milliseconds since the Epoch (midnight, January 1, 1970 UTC),
 * the same way as {@link System#currentTimeMillis()} does it.
 *
 * @param <T> The type of the elements to which this assigner assigns timestamps.
 */
@Public
@FunctionalInterface
public interface TimestampAssigner<T> {

	/**
	 * Assigns a timestamp to an element, in milliseconds since the Epoch. This is independent of
	 * any particular time zone or calendar.
	 *
	 * <p>The method is passed the previously assigned timestamp of the element.
	 * That previous timestamp may have been assigned from a previous assigner. If the element did
	 * not carry a timestamp before, this value is {@code Long.MIN_VALUE}.
	 *
	 * @param element The element that the timestamp will be assigned to.
	 * @param recordTimestamp The current internal timestamp of the element,
	 *                         or a negative value, if no timestamp has been assigned yet.
	 * @return The new timestamp.
	 */
	long extractTimestamp(T element, long recordTimestamp);
}

@@ -1478,16 +1478,186 @@
 r%3CT%3E %7B%0A%0A
+%09/**%0A%09 * The value that is passed to %7B@link #extractTimestamp%7D when there is no previous timestamp%0A%09 * attached to the record.%0A%09 */%0A%09long NO_TIMESTAMP = Long.MIN_VALUE;%0A%0A
 %09/**%0A%09 *
@@ -2022,28 +2022,83 @@
 s %7B@
-code Long.MIN_VALUE%7D
+link #NO_TIMESTAMP%7D (= %7B@code Long.MIN_VALUE%7D:%0A%09 * %7B@value Long#MIN_VALUE%7D)
 .%0A%09 

Add a constant for the special value "NO_TIMESTAMP".