flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [1/5] flink git commit: [hotfix] [streaming] Add check in StreamRecord for reserved timestamp values
Date Tue, 16 Feb 2016 18:28:11 GMT
Repository: flink
Updated Branches:
  refs/heads/master 932a49d7b -> a66458eac


[hotfix] [streaming] Add check in StreamRecord for reserved timestamp values


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/a66458ea
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/a66458ea
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/a66458ea

Branch: refs/heads/master
Commit: a66458eac614ad2cf47394b0cf0761137f6ba97f
Parents: 8cce136
Author: Stephan Ewen <sewen@apache.org>
Authored: Tue Feb 16 10:39:12 2016 +0100
Committer: Stephan Ewen <sewen@apache.org>
Committed: Tue Feb 16 17:42:18 2016 +0100

----------------------------------------------------------------------
 .../flink/streaming/runtime/streamrecord/StreamRecord.java     | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/a66458ea/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/streamrecord/StreamRecord.java
----------------------------------------------------------------------
diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/streamrecord/StreamRecord.java
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/streamrecord/StreamRecord.java
index 8ae4e88..bd99be8 100644
--- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/streamrecord/StreamRecord.java
+++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/streamrecord/StreamRecord.java
@@ -52,6 +52,9 @@ public class StreamRecord<T> extends StreamElement {
 	 * @param timestamp The timestamp in milliseconds
 	 */
 	public StreamRecord(T value, long timestamp) {
+		if (timestamp == Long.MIN_VALUE) {
+			throw new IllegalArgumentException("Long.MIN_VALUE timestamp is reserved");
+		}
 		this.value = value;
 		this.timestamp = timestamp;
 	}
@@ -95,6 +98,9 @@ public class StreamRecord<T> extends StreamElement {
 	 */
 	@SuppressWarnings("unchecked")
 	public <X> StreamRecord<X> replace(X value, long timestamp) {
+		if (timestamp == Long.MIN_VALUE) {
+			throw new IllegalArgumentException("Long.MIN_VALUE timestamp is reserved");
+		}
 		this.timestamp = timestamp;
 		this.value = (T) value;
 		return (StreamRecord<X>) this;


Mime
View raw message