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 aStreamRecord
from this TimestampedValue.long
getTimestamp()
T
getValue()
boolean
hasTimestamp()
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 thisTimestampedValue
timestamp
- 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 aStreamRecord
from 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.
-
-