diff --git a/runners/flink/1.7/build.gradle b/runners/flink/1.7/build.gradle new file mode 100644 index 000000000000..5982c1b2f841 --- /dev/null +++ b/runners/flink/1.7/build.gradle @@ -0,0 +1,33 @@ +/* + * 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. + */ + +def basePath = '..' + +/* All properties required for loading the Flink build script */ +project.ext { + // Set the version of all Flink-related dependencies here. + flink_version = '1.7.1' + // Look for the source code in the parent module + main_source_dirs = ["$basePath/src/main/java"] + test_source_dirs = ["$basePath/src/test/java"] + main_resources_dirs = ["$basePath/src/main/resources"] + test_resources_dirs = ["$basePath/src/test/resources"] +} + +// Load the main build script which contains all build logic. +apply from: "$basePath/flink_runner.gradle" diff --git a/runners/flink/1.7/job-server-container/build.gradle b/runners/flink/1.7/job-server-container/build.gradle new file mode 100644 index 000000000000..afdb68a0fc91 --- /dev/null +++ b/runners/flink/1.7/job-server-container/build.gradle @@ -0,0 +1,26 @@ +/* + * 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. + */ + +def basePath = '../../job-server-container' + +project.ext { + resource_path = basePath +} + +// Load the main build script which contains all build logic. +apply from: "$basePath/flink_job_server_container.gradle" diff --git a/runners/flink/1.7/job-server/build.gradle b/runners/flink/1.7/job-server/build.gradle new file mode 100644 index 000000000000..d5251e048213 --- /dev/null +++ b/runners/flink/1.7/job-server/build.gradle @@ -0,0 +1,30 @@ +/* + * 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. + */ + +def basePath = '../../job-server' + +project.ext { + // Look for the source code in the parent module + main_source_dirs = ["$basePath/src/main/java"] + test_source_dirs = ["$basePath/src/test/java"] + main_resources_dirs = ["$basePath/src/main/resources"] + test_resources_dirs = ["$basePath/src/test/resources"] +} + +// Load the main build script which contains all build logic. +apply from: "$basePath/flink_job_server.gradle" diff --git a/runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkExecutionEnvironments.java b/runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkExecutionEnvironments.java index f8108c946c7d..f2eb5386ea9f 100644 --- a/runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkExecutionEnvironments.java +++ b/runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkExecutionEnvironments.java @@ -338,7 +338,10 @@ protected JobExecutionResult executeRemotely(StreamGraph streamGraph, List final ClusterClient client; try { - if (CoreOptions.LEGACY_MODE.equals(configuration.getString(CoreOptions.MODE))) { + // Write out the option keys and values to be compatible across different Flink versions, + // CoreOptions.MODE and its values CoreOptions.LEGACY_MODE and CoreOptions.NEW_MODE + // have been removed. + if ("legacy".equals(configuration.getString("mode", "new"))) { client = new StandaloneClusterClient(configuration); } else { client = new RestClusterClient<>(configuration, "RemoteStreamEnvironment"); diff --git a/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableExecutionTest.java b/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableExecutionTest.java index 9542bdd79547..f82a4f46e49c 100644 --- a/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableExecutionTest.java +++ b/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableExecutionTest.java @@ -85,6 +85,7 @@ public void testExecution() throws Exception { options.setRunner(CrashingRunner.class); options.as(FlinkPipelineOptions.class).setFlinkMaster("[local]"); options.as(FlinkPipelineOptions.class).setStreaming(isStreaming); + options.as(FlinkPipelineOptions.class).setParallelism(2); options .as(PortablePipelineOptions.class) .setDefaultEnvironmentType(Environments.ENVIRONMENT_EMBEDDED); diff --git a/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableStateExecutionTest.java b/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableStateExecutionTest.java index a658a1c9ec26..7ed7312587da 100644 --- a/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableStateExecutionTest.java +++ b/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableStateExecutionTest.java @@ -86,6 +86,7 @@ public void testExecution() throws Exception { options.setRunner(CrashingRunner.class); options.as(FlinkPipelineOptions.class).setFlinkMaster("[local]"); options.as(FlinkPipelineOptions.class).setStreaming(isStreaming); + options.as(FlinkPipelineOptions.class).setParallelism(2); options .as(PortablePipelineOptions.class) .setDefaultEnvironmentType(Environments.ENVIRONMENT_EMBEDDED); diff --git a/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableTimersExecutionTest.java b/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableTimersExecutionTest.java index d9639b87162c..152a76ae9cde 100644 --- a/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableTimersExecutionTest.java +++ b/runners/flink/src/test/java/org/apache/beam/runners/flink/PortableTimersExecutionTest.java @@ -92,6 +92,7 @@ public void testTimerExecution() throws Exception { options.setRunner(CrashingRunner.class); options.as(FlinkPipelineOptions.class).setFlinkMaster("[local]"); options.as(FlinkPipelineOptions.class).setStreaming(isStreaming); + options.as(FlinkPipelineOptions.class).setParallelism(2); options .as(PortablePipelineOptions.class) .setDefaultEnvironmentType(Environments.ENVIRONMENT_EMBEDDED); diff --git a/settings.gradle b/settings.gradle index aac5bf9b7151..c9e3f4cd29b2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -53,6 +53,13 @@ include "beam-runners-flink-1.6-job-server" project(":beam-runners-flink-1.6-job-server").dir = file("runners/flink/1.6/job-server") include "beam-runners-flink-1.6-job-server-container" project(":beam-runners-flink-1.6-job-server-container").dir = file("runners/flink/1.6/job-server-container") +// 1.7 version +include "beam-runners-flink-1.7" +project(":beam-runners-flink-1.7").dir = file("runners/flink/1.7") +include "beam-runners-flink-1.7-job-server" +project(":beam-runners-flink-1.7-job-server").dir = file("runners/flink/1.7/job-server") +include "beam-runners-flink-1.7-job-server-container" +project(":beam-runners-flink-1.7-job-server-container").dir = file("runners/flink/1.7/job-server-container") /* End Flink Runner related settings */ include "beam-runners-gcp-gcemd" project(":beam-runners-gcp-gcemd").dir = file("runners/gcp/gcemd")