|
66 | 66 | import java.util.Collection; |
67 | 67 | import java.util.Collections; |
68 | 68 | import java.util.List; |
| 69 | +import java.util.Objects; |
69 | 70 | import java.util.concurrent.TimeUnit; |
70 | 71 | import java.util.concurrent.TimeoutException; |
71 | 72 | import java.util.function.Function; |
@@ -161,7 +162,12 @@ private int getParallelism() { |
161 | 162 | protected String flinkVersion = getFlinkVersion(); |
162 | 163 |
|
163 | 164 | public static String getFlinkVersion() { |
164 | | - return "1.20.3"; |
| 165 | + String flinkVersion = System.getProperty("specifiedFlinkVersion"); |
| 166 | + if (Objects.isNull(flinkVersion)) { |
| 167 | + throw new IllegalArgumentException( |
| 168 | + "No Flink version specified to run this test. Please use -DspecifiedFlinkVersion to pass one."); |
| 169 | + } |
| 170 | + return flinkVersion; |
165 | 171 | } |
166 | 172 |
|
167 | 173 | protected List<String> copyJarToFlinkLib() { |
@@ -398,6 +404,17 @@ public void waitUntilJobState(Duration timeout, JobStatus expectedStatus) { |
398 | 404 | } |
399 | 405 |
|
400 | 406 | protected String getFlinkDockerImageTag() { |
| 407 | + String customImage = System.getProperty("flink.docker.image"); |
| 408 | + if (customImage != null && !customImage.isEmpty()) { |
| 409 | + return customImage; |
| 410 | + } |
| 411 | + String registry = System.getProperty("flink.docker.registry", ""); |
| 412 | + if (!registry.isEmpty()) { |
| 413 | + if (System.getProperty("java.specification.version").equals("17")) { |
| 414 | + return String.format("%s/flink:%s-scala_2.12-java17", registry, flinkVersion); |
| 415 | + } |
| 416 | + return String.format("%s/flink:%s-scala_2.12-java11", registry, flinkVersion); |
| 417 | + } |
401 | 418 | if (System.getProperty("java.specification.version").equals("17")) { |
402 | 419 | return String.format("flink:%s-scala_2.12-java17", flinkVersion); |
403 | 420 | } |
|
0 commit comments