Class TimestampedValue<T>
java.lang.Object
org.apache.flink.streaming.runtime.operators.windowing.TimestampedValue<T>
- Type Parameters:
T- The type encapsulated value
Stores the value and the timestamp of the record.
-
Constructor Summary
ConstructorsConstructorDescriptionTimestampedValue(T value) Creates a new TimestampedValue.TimestampedValue(T value, long timestamp) Creates a new TimestampedValue wrapping the given value. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TimestampedValue<T>from(StreamRecord<T> streamRecord) Creates a TimestampedValue from givenStreamRecord.Creates aStreamRecordfrom this TimestampedValue.longgetValue()booleanChecks whether this record has a timestamp.
-
Constructor Details
-
TimestampedValue
Creates a new TimestampedValue. The record does not have a timestamp. -
TimestampedValue
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 Details
-
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
Creates aStreamRecordfrom this TimestampedValue. -
from
Creates a TimestampedValue from givenStreamRecord.- Parameters:
streamRecord- The StreamRecord object from which TimestampedValue is to be created.
-