-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] apache flink 1.19 support (#3675)
Co-authored-by: benjobs <[email protected]>
- Loading branch information
Showing
10 changed files
with
561 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
154 changes: 154 additions & 0 deletions
154
streampark-flink/streampark-flink-shims/streampark-flink-shims_flink-1.19/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ 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. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.apache.streampark</groupId> | ||
<artifactId>streampark-flink-shims</artifactId> | ||
<version>2.2.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>streampark-flink-shims_flink-1.19_${scala.binary.version}</artifactId> | ||
<name>StreamPark : Flink Shims 1.19</name> | ||
|
||
<properties> | ||
<flink.version>1.19.0</flink.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.streampark</groupId> | ||
<artifactId>streampark-flink-shims-base_${scala.binary.version}</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-table-planner_${scala.binary.version}</artifactId> | ||
<version>${flink.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<!--flink--> | ||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-table-api-scala_${scala.binary.version}</artifactId> | ||
<version>${flink.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-scala_${scala.binary.version}</artifactId> | ||
<version>${flink.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-streaming-scala_${scala.binary.version}</artifactId> | ||
<version>${flink.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-table-api-java-uber</artifactId> | ||
<version>${flink.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-table-api-scala-bridge_${scala.binary.version}</artifactId> | ||
<version>${flink.version}</version> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-statebackend-rocksdb</artifactId> | ||
<version>${flink.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-yarn</artifactId> | ||
<version>${flink.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.hadoop</groupId> | ||
<artifactId>hadoop-client-api</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.hadoop</groupId> | ||
<artifactId>hadoop-client-runtime</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.flink</groupId> | ||
<artifactId>flink-kubernetes</artifactId> | ||
<version>${flink.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<createDependencyReducedPom>true</createDependencyReducedPom> | ||
<dependencyReducedPomLocation>${project.basedir}/target/dependency-reduced-pom.xml</dependencyReducedPomLocation> | ||
<artifactSet> | ||
<includes> | ||
<include>org.apache.flink:flink-table-api-scala-bridge_${scala.binary.version}</include> | ||
</includes> | ||
</artifactSet> | ||
<filters> | ||
<filter> | ||
<artifact>*:*</artifact> | ||
<excludes> | ||
<exclude>META-INF/*.SF</exclude> | ||
<exclude>META-INF/*.DSA</exclude> | ||
<exclude>META-INF/*.RSA</exclude> | ||
</excludes> | ||
</filter> | ||
</filters> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
60 changes: 60 additions & 0 deletions
60
...shims_flink-1.19/src/main/scala/org/apache/streampark/flink/core/FlinkClusterClient.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* 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.streampark.flink.core | ||
|
||
import org.apache.flink.api.common.JobID | ||
import org.apache.flink.client.program.ClusterClient | ||
import org.apache.flink.core.execution.SavepointFormatType | ||
|
||
import java.util.concurrent.CompletableFuture | ||
|
||
class FlinkClusterClient[T](clusterClient: ClusterClient[T]) | ||
extends FlinkClientTrait[T](clusterClient) { | ||
|
||
override def triggerSavepoint( | ||
jobID: JobID, | ||
savepointDir: String, | ||
nativeFormat: Boolean): CompletableFuture[String] = { | ||
clusterClient.triggerSavepoint( | ||
jobID, | ||
savepointDir, | ||
if (nativeFormat) SavepointFormatType.NATIVE else SavepointFormatType.CANONICAL) | ||
} | ||
|
||
override def cancelWithSavepoint( | ||
jobID: JobID, | ||
savepointDirectory: String, | ||
nativeFormat: Boolean): CompletableFuture[String] = { | ||
clusterClient.cancelWithSavepoint( | ||
jobID, | ||
savepointDirectory, | ||
if (nativeFormat) SavepointFormatType.NATIVE else SavepointFormatType.CANONICAL) | ||
} | ||
|
||
override def stopWithSavepoint( | ||
jobID: JobID, | ||
advanceToEndOfEventTime: Boolean, | ||
savepointDirectory: String, | ||
nativeFormat: Boolean): CompletableFuture[String] = { | ||
clusterClient.stopWithSavepoint( | ||
jobID, | ||
advanceToEndOfEventTime, | ||
savepointDirectory, | ||
if (nativeFormat) SavepointFormatType.NATIVE else SavepointFormatType.CANONICAL) | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...ms_flink-1.19/src/main/scala/org/apache/streampark/flink/core/FlinkKubernetesClient.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* 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.streampark.flink.core | ||
|
||
import org.apache.flink.kubernetes.kubeclient.FlinkKubeClient | ||
import org.apache.flink.kubernetes.kubeclient.resources.KubernetesService | ||
|
||
import java.util.Optional | ||
|
||
class FlinkKubernetesClient(kubeClient: FlinkKubeClient) | ||
extends FlinkKubernetesClientTrait(kubeClient) { | ||
|
||
override def getService(serviceName: String): Optional[KubernetesService] = { | ||
kubeClient.getService(serviceName) | ||
} | ||
|
||
} |
Oops, something went wrong.