This is an automated email from the ASF dual-hosted git repository.
fanjia pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new 667bd6ef4 [Feature][Core][Flink] Upgrade flink version to 1.14.6
(#3963)
667bd6ef4 is described below
commit 667bd6ef473340a7d0cdd3cef409adb3d812891f
Author: Tyrantlucifer <[email protected]>
AuthorDate: Wed Jan 18 11:36:18 2023 +0800
[Feature][Core][Flink] Upgrade flink version to 1.14.6 (#3963)
---
release-note.md | 1 +
.../flink/execution/FlinkRuntimeEnvironment.java | 14 ++---
.../e2e/common/container/TestContainerId.java | 1 +
.../common/container/flink/Flink14Container.java | 69 ++++++++++++++++++++++
4 files changed, 75 insertions(+), 10 deletions(-)
diff --git a/release-note.md b/release-note.md
index 49dd47a0a..9a05ce7b5 100644
--- a/release-note.md
+++ b/release-note.md
@@ -6,6 +6,7 @@
- [Client]Add Zeta Client ShutdownHook To Cancel Job
### Core
- [Starter][Flink]Support transform-v2 for flink #3396
+- [Flink] Support flink 1.14.x #3963
### Transformer
- [Spark] Support transform-v2 for spark (#3409)
- [ALL]Add FieldMapper Transform #3781
diff --git
a/seatunnel-core/seatunnel-flink-starter/src/main/java/org/apache/seatunnel/core/starter/flink/execution/FlinkRuntimeEnvironment.java
b/seatunnel-core/seatunnel-flink-starter/src/main/java/org/apache/seatunnel/core/starter/flink/execution/FlinkRuntimeEnvironment.java
index 75f7771b6..8f94c2bd8 100644
---
a/seatunnel-core/seatunnel-flink-starter/src/main/java/org/apache/seatunnel/core/starter/flink/execution/FlinkRuntimeEnvironment.java
+++
b/seatunnel-core/seatunnel-flink-starter/src/main/java/org/apache/seatunnel/core/starter/flink/execution/FlinkRuntimeEnvironment.java
@@ -152,16 +152,10 @@ public class FlinkRuntimeEnvironment implements
RuntimeEnvironment {
}
private void createStreamTableEnvironment() {
- // use blink and streammode
- EnvironmentSettings.Builder envBuilder =
EnvironmentSettings.newInstance().inStreamingMode();
- if (this.config.hasPath(ConfigKeyName.PLANNER) && "blink"
- .equals(this.config.getString(ConfigKeyName.PLANNER))) {
- envBuilder.useBlinkPlanner();
- } else {
- envBuilder.useOldPlanner();
- }
- EnvironmentSettings environmentSettings = envBuilder.build();
-
+ EnvironmentSettings environmentSettings =
EnvironmentSettings.newInstance()
+ .inStreamingMode()
+ .useBlinkPlanner()
+ .build();
tableEnvironment =
StreamTableEnvironment.create(getStreamExecutionEnvironment(),
environmentSettings);
TableConfig config = tableEnvironment.getConfig();
if (this.config.hasPath(ConfigKeyName.MAX_STATE_RETENTION_TIME) &&
this.config
diff --git
a/seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/TestContainerId.java
b/seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/TestContainerId.java
index 91ae0feec..945c1f1d3 100644
---
a/seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/TestContainerId.java
+++
b/seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/TestContainerId.java
@@ -27,6 +27,7 @@ import lombok.Getter;
@Getter
public enum TestContainerId {
FLINK_1_13(FLINK, "1.13.6"),
+ FLINK_1_14(FLINK, "1.14.6"),
SPARK_2_4(SPARK, "2.4.6"),
SEATUNNEL(EngineType.SEATUNNEL, "2.2.0");
diff --git
a/seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/flink/Flink14Container.java
b/seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/flink/Flink14Container.java
new file mode 100644
index 000000000..b76296022
--- /dev/null
+++
b/seatunnel-e2e/seatunnel-e2e-common/src/test/java/org/apache/seatunnel/e2e/common/container/flink/Flink14Container.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.e2e.common.container.flink;
+
+import org.apache.seatunnel.e2e.common.container.TestContainer;
+import org.apache.seatunnel.e2e.common.container.TestContainerId;
+
+import com.google.auto.service.AutoService;
+import lombok.NoArgsConstructor;
+
+/**
+ * This class is the base class of FlinkEnvironment test for new seatunnel
connector API.
+ * The before method will create a Flink cluster, and after method will close
the Flink cluster.
+ * You can use {@link Flink14Container#executeJob} to submit a seatunnel
config and run a seatunnel job.
+ */
+@NoArgsConstructor
+@AutoService(TestContainer.class)
+public class Flink14Container extends AbstractTestFlinkContainer {
+
+ @Override
+ public TestContainerId identifier() {
+ return TestContainerId.FLINK_1_14;
+ }
+
+ @Override
+ protected String getDockerImage() {
+ return "tyrantlucifer/flink:1.14.6-scala_2.11_hadoop27";
+ }
+
+ @Override
+ protected String getStartModuleName() {
+ return "seatunnel-flink-starter";
+ }
+
+ @Override
+ protected String getStartShellName() {
+ return "start-seatunnel-flink-connector-v2.sh";
+ }
+
+ @Override
+ protected String getConnectorType() {
+ return "seatunnel";
+ }
+
+ @Override
+ protected String getConnectorModulePath() {
+ return "seatunnel-connectors-v2";
+ }
+
+ @Override
+ protected String getConnectorNamePrefix() {
+ return "connector-";
+ }
+}