Class TimestampedValue<T>
- java.lang.Object
-
- org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue<T>
-
- Type Parameters:
T- The type encapsulated value
@PublicEvolving public class TimestampedValue<T> extends Object
Stores the value and the timestamp of the record.
-
-
Constructor Summary
Constructors Constructor Description TimestampedValue(T value)Creates a new TimestampedValue.TimestampedValue(T value, long timestamp)Creates a new TimestampedValue wrapping the given value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> TimestampedValue<T>from(StreamRecord<T> streamRecord)Creates a TimestampedValue from givenStreamRecord.StreamRecord<T>getStreamRecord()Creates aStreamRecordfrom this TimestampedValue.longgetTimestamp()TgetValue()booleanhasTimestamp()Checks whether this record has a timestamp.
-
-
-
Constructor Detail
-
TimestampedValue
public TimestampedValue(T value)
Creates a new TimestampedValue. The record does not have a timestamp.
-
TimestampedValue
public TimestampedValue(T value, long timestamp)
Creates a new TimestampedValue wrapping the given value. The timestamp is set to the given timestamp.- Parameters:
value- The value to wrap in thisTimestampedValuetimestamp- The timestamp in milliseconds
-
-
Method Detail
-
getValue
public T getValue()
- Returns:
- The value wrapped in this
TimestampedValue.
-
getTimestamp
public long getTimestamp()
- Returns:
- The timestamp associated with this stream value in milliseconds.
-
hasTimestamp
public boolean hasTimestamp()
Checks whether this record has a timestamp.- Returns:
- True if the record has a timestamp, false if not.
-
getStreamRecord
public StreamRecord<T> getStreamRecord()
Creates aStreamRecordfrom this TimestampedValue.
-
from
public static <T> TimestampedValue<T> from(StreamRecord<T> streamRecord)
Creates a TimestampedValue from givenStreamRecord.- Parameters:
streamRecord- The StreamRecord object from which TimestampedValue is to be created.
-
-