You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tw...@apache.org on 2020/05/20 19:47:53 UTC

[flink] 06/08: [hotfix][core] Add open interval in MigrationVersion

This is an automated email from the ASF dual-hosted git repository.

twalthr pushed a commit to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git

commit a2d6854212a85339a46ccef874c340a5e3e67bec
Author: Timo Walther <tw...@apache.org>
AuthorDate: Tue May 19 15:52:40 2020 +0200

    [hotfix][core] Add open interval in MigrationVersion
---
 .../apache/flink/testutils/migration/MigrationVersion.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/flink-core/src/test/java/org/apache/flink/testutils/migration/MigrationVersion.java b/flink-core/src/test/java/org/apache/flink/testutils/migration/MigrationVersion.java
index 5f964ec..4a9cb7d 100644
--- a/flink-core/src/test/java/org/apache/flink/testutils/migration/MigrationVersion.java
+++ b/flink-core/src/test/java/org/apache/flink/testutils/migration/MigrationVersion.java
@@ -18,6 +18,10 @@
 
 package org.apache.flink.testutils.migration;
 
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
 /**
  * Enumeration for Flink versions, used in migration integration tests
  * to indicate the migrated snapshot version.
@@ -50,4 +54,13 @@ public enum MigrationVersion {
 	public boolean isNewerVersionThan(MigrationVersion otherVersion) {
 		return this.ordinal() > otherVersion.ordinal();
 	}
+
+	/**
+	 * Returns all versions equal to or higher than the selected version.
+	 */
+	public List<MigrationVersion> orHigher() {
+		return Stream.of(MigrationVersion.values())
+			.filter(v -> this.ordinal() <= v.ordinal())
+			.collect(Collectors.toList());
+	}
 }