Unverified Commit 2be2d6d4 authored by ZackYoung's avatar ZackYoung Committed by GitHub

[Optimize][pom]optimize pom module code (#1234)

* 模块优化 1. optimize app module * 1. optimize module code 2. add flink version compatible * 1. change 13 to 14 * 1. change 13 to 14 * 1. change udf PythonFunctionFactory code * 1. delete admin module static dir * 1. delete admin module static dir * 1. delete more includes tags * 1. change web clean phase * 1. change web package order * 1. change web package order * change pulsar module
parent 7f501245
...@@ -212,10 +212,28 @@ ...@@ -212,10 +212,28 @@
<build> <build>
<finalName>${project.artifactId}-${project.version}</finalName> <finalName>${project.artifactId}-${project.version}</finalName>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}/src/main/resources/static</directory>
</fileset>
</filesets>
</configuration>
<executions>
<execution>
<goals>
<goal>clean</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<configuration> <configuration>
<appendAssemblyId>false</appendAssemblyId> <appendAssemblyId>false</appendAssemblyId>
<descriptors> <descriptors>
...@@ -242,7 +260,7 @@ ...@@ -242,7 +260,7 @@
<goals> <goals>
<goal>copy-resources</goal> <goal>copy-resources</goal>
</goals> </goals>
<phase>validate</phase> <phase>initialize</phase>
<configuration> <configuration>
<outputDirectory>src/main/resources/static</outputDirectory> <outputDirectory>src/main/resources/static</outputDirectory>
<overwrite>true</overwrite> <overwrite>true</overwrite>
...@@ -259,15 +277,6 @@ ...@@ -259,15 +277,6 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version> <version>${maven-jar-plugin.version}</version>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration> <configuration>
<classesDirectory>target/classes/</classesDirectory> <classesDirectory>target/classes/</classesDirectory>
<excludes> <excludes>
...@@ -276,6 +285,15 @@ ...@@ -276,6 +285,15 @@
<exclude>/mybatis*.xml</exclude> <exclude>/mybatis*.xml</exclude>
</excludes> </excludes>
</configuration> </configuration>
<executions>
<execution>
<id>default-jar</id>
<goals>
<goal>jar</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
......
...@@ -39,13 +39,10 @@ ...@@ -39,13 +39,10 @@
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-app-base</artifactId> <artifactId>dlink-app-base</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<!-- <scope>provided</scope>-->
<version>8.0.21</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
...@@ -81,7 +78,7 @@ ...@@ -81,7 +78,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>${target.java.version}</source> <source>${target.java.version}</source>
<target>${target.java.version}</target> <target>${target.java.version}</target>
...@@ -93,7 +90,7 @@ ...@@ -93,7 +90,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version> <version>${maven-assembly-plugin.version}</version>
<configuration> <configuration>
<descriptorRefs> <descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef> <descriptorRef>jar-with-dependencies</descriptorRef>
......
...@@ -39,13 +39,10 @@ ...@@ -39,13 +39,10 @@
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-app-base</artifactId> <artifactId>dlink-app-base</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<!-- <scope>provided</scope>-->
<version>8.0.21</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
...@@ -81,7 +78,7 @@ ...@@ -81,7 +78,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>${target.java.version}</source> <source>${target.java.version}</source>
<target>${target.java.version}</target> <target>${target.java.version}</target>
...@@ -93,7 +90,7 @@ ...@@ -93,7 +90,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version> <version>${maven-assembly-plugin.version}</version>
<configuration> <configuration>
<descriptorRefs> <descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef> <descriptorRef>jar-with-dependencies</descriptorRef>
......
...@@ -39,13 +39,10 @@ ...@@ -39,13 +39,10 @@
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-app-base</artifactId> <artifactId>dlink-app-base</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<!-- <scope>provided</scope>-->
<version>8.0.21</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
...@@ -81,7 +78,7 @@ ...@@ -81,7 +78,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>${target.java.version}</source> <source>${target.java.version}</source>
<target>${target.java.version}</target> <target>${target.java.version}</target>
...@@ -93,7 +90,7 @@ ...@@ -93,7 +90,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version> <version>${maven-assembly-plugin.version}</version>
<configuration> <configuration>
<descriptorRefs> <descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef> <descriptorRef>jar-with-dependencies</descriptorRef>
......
...@@ -39,13 +39,10 @@ ...@@ -39,13 +39,10 @@
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-app-base</artifactId> <artifactId>dlink-app-base</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<!-- <scope>provided</scope>-->
<version>8.0.21</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
...@@ -81,7 +78,7 @@ ...@@ -81,7 +78,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>${target.java.version}</source> <source>${target.java.version}</source>
<target>${target.java.version}</target> <target>${target.java.version}</target>
...@@ -93,7 +90,7 @@ ...@@ -93,7 +90,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version> <version>${maven-assembly-plugin.version}</version>
<configuration> <configuration>
<descriptorRefs> <descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef> <descriptorRef>jar-with-dependencies</descriptorRef>
......
...@@ -22,13 +22,10 @@ ...@@ -22,13 +22,10 @@
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-app-base</artifactId> <artifactId>dlink-app-base</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<!-- <scope>provided</scope>-->
<version>8.0.21</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
...@@ -64,7 +61,7 @@ ...@@ -64,7 +61,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>${target.java.version}</source> <source>${target.java.version}</source>
<target>${target.java.version}</target> <target>${target.java.version}</target>
...@@ -76,7 +73,7 @@ ...@@ -76,7 +73,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version> <version>${maven-assembly-plugin.version}</version>
<configuration> <configuration>
<descriptorRefs> <descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef> <descriptorRef>jar-with-dependencies</descriptorRef>
......
...@@ -37,27 +37,112 @@ ...@@ -37,27 +37,112 @@
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<!-- <scope>provided</scope>-->
<version>8.0.21</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-client-${dlink.flink.version}</artifactId> <artifactId>dlink-client-base</artifactId>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-executor</artifactId>
</dependency>
</dependencies>
<profiles>
<profile>
<id>flink-1.11</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.11</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-flink-${dlink.flink.version}</artifactId> <artifactId>dlink-flink-1.11</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.12</id>
<dependencies>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-client-base</artifactId> <artifactId>dlink-client-1.12</artifactId>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-executor</artifactId> <artifactId>dlink-flink-1.12</artifactId>
<scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</profile>
<profile>
<id>flink-1.13</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.13</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.13</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.14</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.14</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.14</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.15</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.15</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.15</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.16</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.16</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.16</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project> </project>
...@@ -56,5 +56,19 @@ ...@@ -56,5 +56,19 @@
<module>dlink-app-1.15</module> <module>dlink-app-1.15</module>
</modules> </modules>
</profile> </profile>
<profile>
<id>flink-1.16</id>
<modules>
<module>dlink-app-1.16</module>
</modules>
</profile>
<profile>
<id>web</id>
<modules>
<module>../dlink-web</module>
</modules>
</profile>
</profiles> </profiles>
</project> </project>
...@@ -54,12 +54,4 @@ ...@@ -54,12 +54,4 @@
</plugins> </plugins>
</build> </build>
<profiles>
<profile>
<id>web</id>
<modules>
<module>../dlink-web</module>
</modules>
</profile>
</profiles>
</project> </project>
\ No newline at end of file
...@@ -37,10 +37,9 @@ ...@@ -37,10 +37,9 @@
<directory>${project.parent.basedir}/dlink-admin/target/classes</directory> <directory>${project.parent.basedir}/dlink-admin/target/classes</directory>
<outputDirectory>config</outputDirectory> <outputDirectory>config</outputDirectory>
<includes> <includes>
<include>*.properties</include> <include>**/*.yml</include>
<include>*.yml</include> <include>**/*.yaml</include>
<include>*.yaml</include> <include>**/log4j2.xml</include>
<include>*.xml</include>
</includes> </includes>
</fileSet> </fileSet>
<fileSet> <fileSet>
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.13</artifactId> <artifactId>dlink-flink-1.13</artifactId>
<!-- <scope>provided</scope>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.14</artifactId> <artifactId>dlink-flink-1.14</artifactId>
<!-- <scope>provided</scope>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.15</artifactId> <artifactId>dlink-flink-1.15</artifactId>
<!-- <scope>provided</scope>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.16</artifactId> <artifactId>dlink-flink-1.16</artifactId>
<!-- <scope>provided</scope>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
<artifactId>dlink-client-1.11</artifactId> <artifactId>dlink-client-1.11</artifactId>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>${target.java.version}</maven.compiler.source> <maven.compiler.source>${target.java.version}</maven.compiler.source>
<maven.compiler.target>${target.java.version}</maven.compiler.target> <maven.compiler.target>${target.java.version}</maven.compiler.target>
...@@ -38,7 +37,6 @@ ...@@ -38,7 +37,6 @@
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-client-base</artifactId> <artifactId>dlink-client-base</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
......
/*
* 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.flink.client.python;
import static org.apache.flink.client.python.PythonEnvUtils.getGatewayServer;
import static org.apache.flink.client.python.PythonEnvUtils.launchPy4jPythonClient;
import static org.apache.flink.client.python.PythonEnvUtils.setGatewayServer;
import static org.apache.flink.client.python.PythonEnvUtils.startGatewayServer;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.python.shaded.py4j.GatewayServer;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.ReadableConfig;
import org.apache.flink.table.functions.python.PythonFunction;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
/**
* The factory which creates the PythonFunction objects from given module name and object name.
*/
public interface PythonFunctionFactory {
long CHECK_INTERVAL = 100;
long TIMEOUT_MILLIS = 10000;
AtomicReference<PythonFunctionFactory> PYTHON_FUNCTION_FACTORY_REF = new AtomicReference<>();
/**
* Returns PythonFunction according to moduleName and objectName.
*
* @param moduleName The module name of the Python UDF.
* @param objectName The function name / class name of the Python UDF.
* @return The PythonFunction object which represents the Python UDF.
*/
PythonFunction getPythonFunction(String moduleName, String objectName);
/**
* Returns PythonFunction according to the fully qualified name of the Python UDF i.e
* ${moduleName}.${functionName} or ${moduleName}.${className}.
*
* @param fullyQualifiedName The fully qualified name of the Python UDF.
* @param config The configuration of python dependencies.
* @return The PythonFunction object which represents the Python UDF.
*/
static PythonFunction getPythonFunction(String fullyQualifiedName, ReadableConfig config)
throws IOException, ExecutionException, InterruptedException {
int splitIndex = fullyQualifiedName.lastIndexOf(".");
if (splitIndex <= 0) {
throw new IllegalArgumentException(
String.format("The fully qualified name is invalid: '%s'", fullyQualifiedName));
}
String moduleName = fullyQualifiedName.substring(0, splitIndex);
String objectName = fullyQualifiedName.substring(splitIndex + 1);
Configuration mergedConfig =
new Configuration(
ExecutionEnvironment.getExecutionEnvironment().getConfiguration());
mergedConfig.addAll((Configuration) config);
PythonFunctionFactory pythonFunctionFactory = getPythonFunctionFactory(mergedConfig);
return pythonFunctionFactory.getPythonFunction(moduleName, objectName);
}
static PythonFunction getPythonFunction(String fullyQualifiedName, ReadableConfig config, ClassLoader classLoader) throws ExecutionException, IOException, InterruptedException {
return getPythonFunction(fullyQualifiedName, config);
}
static PythonFunctionFactory getPythonFunctionFactory(ReadableConfig config)
throws ExecutionException, InterruptedException, IOException {
synchronized (PythonFunctionFactory.class) {
if (PYTHON_FUNCTION_FACTORY_REF.get() != null) {
return PYTHON_FUNCTION_FACTORY_REF.get();
} else {
Map<String, Object> entryPoint;
if (getGatewayServer() == null) {
GatewayServer gatewayServer = null;
Process pythonProcess = null;
try {
gatewayServer = startGatewayServer();
setGatewayServer(gatewayServer);
List<String> commands = new ArrayList<>();
commands.add("-m");
commands.add("pyflink.pyflink_callback_server");
String tmpDir =
System.getProperty("java.io.tmpdir")
+ File.separator
+ "pyflink"
+ File.separator
+ UUID.randomUUID();
pythonProcess =
launchPy4jPythonClient(
gatewayServer, config, commands, null, tmpDir, false);
entryPoint =
(Map<String, Object>) gatewayServer.getGateway().getEntryPoint();
int i = 0;
while (!entryPoint.containsKey("PythonFunctionFactory")) {
if (!pythonProcess.isAlive()) {
throw new RuntimeException("Python callback server start failed!");
}
try {
Thread.sleep(CHECK_INTERVAL);
} catch (InterruptedException e) {
throw new RuntimeException(
"Interrupted while waiting for the python process to start.",
e);
}
i++;
if (i > TIMEOUT_MILLIS / CHECK_INTERVAL) {
throw new RuntimeException("Python callback server start failed!");
}
}
} catch (Throwable e) {
try {
setGatewayServer(null);
if (gatewayServer != null) {
gatewayServer.shutdown();
}
} catch (Throwable e2) {
// ignore, do not swallow the origin exception.
}
try {
if (pythonProcess != null) {
shutdownPythonProcess(pythonProcess, TIMEOUT_MILLIS);
}
} catch (Throwable e3) {
// ignore, do not swallow the origin exception.
}
throw e;
}
Runtime.getRuntime()
.addShutdownHook(new PythonProcessShutdownHook(pythonProcess));
} else {
entryPoint =
(Map<String, Object>) getGatewayServer().getGateway().getEntryPoint();
}
PythonFunctionFactory pythonFunctionFactory =
(PythonFunctionFactory) entryPoint.get("PythonFunctionFactory");
PYTHON_FUNCTION_FACTORY_REF.set(pythonFunctionFactory);
return pythonFunctionFactory;
}
}
}
static void shutdownPythonProcess(Process pythonProcess, long timeoutMillis) {
pythonProcess.destroy();
try {
pythonProcess.waitFor(timeoutMillis, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
throw new RuntimeException(
"Interrupt while waiting for the python process to stop.", e);
}
if (pythonProcess.isAlive()) {
pythonProcess.destroyForcibly();
}
}
/**
* The shutdown hook used to destroy the Python process.
*/
class PythonProcessShutdownHook extends Thread {
private Process process;
public PythonProcessShutdownHook(Process process) {
this.process = process;
}
@Override
public void run() {
shutdownPythonProcess(process, TIMEOUT_MILLIS);
}
}
}
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-client-base</artifactId> <artifactId>dlink-client-base</artifactId>
<version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
......
/*
* 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.flink.client.python;
import static org.apache.flink.client.python.PythonEnvUtils.getGatewayServer;
import static org.apache.flink.client.python.PythonEnvUtils.launchPy4jPythonClient;
import static org.apache.flink.client.python.PythonEnvUtils.setGatewayServer;
import static org.apache.flink.client.python.PythonEnvUtils.startGatewayServer;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.python.shaded.py4j.GatewayServer;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.ReadableConfig;
import org.apache.flink.python.util.PythonDependencyUtils;
import org.apache.flink.table.functions.python.PythonFunction;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
/**
* The factory which creates the PythonFunction objects from given module name and object name.
*/
public interface PythonFunctionFactory {
long CHECK_INTERVAL = 100;
long TIMEOUT_MILLIS = 10000;
AtomicReference<PythonFunctionFactory> PYTHON_FUNCTION_FACTORY_REF = new AtomicReference<>();
/**
* Returns PythonFunction according to moduleName and objectName.
*
* @param moduleName The module name of the Python UDF.
* @param objectName The function name / class name of the Python UDF.
* @return The PythonFunction object which represents the Python UDF.
*/
PythonFunction getPythonFunction(String moduleName, String objectName);
/**
* Returns PythonFunction according to the fully qualified name of the Python UDF i.e
* ${moduleName}.${functionName} or ${moduleName}.${className}.
*
* @param fullyQualifiedName The fully qualified name of the Python UDF.
* @param config The configuration of python dependencies.
* @return The PythonFunction object which represents the Python UDF.
*/
static PythonFunction getPythonFunction(String fullyQualifiedName, ReadableConfig config)
throws IOException, ExecutionException, InterruptedException {
int splitIndex = fullyQualifiedName.lastIndexOf(".");
if (splitIndex <= 0) {
throw new IllegalArgumentException(
String.format("The fully qualified name is invalid: '%s'", fullyQualifiedName));
}
String moduleName = fullyQualifiedName.substring(0, splitIndex);
String objectName = fullyQualifiedName.substring(splitIndex + 1);
Configuration mergedConfig =
new Configuration(
ExecutionEnvironment.getExecutionEnvironment().getConfiguration());
PythonDependencyUtils.merge(mergedConfig, (Configuration) config);
PythonFunctionFactory pythonFunctionFactory = getPythonFunctionFactory(mergedConfig);
return pythonFunctionFactory.getPythonFunction(moduleName, objectName);
}
static PythonFunction getPythonFunction(String fullyQualifiedName, ReadableConfig config, ClassLoader classLoader) throws ExecutionException, IOException, InterruptedException {
return getPythonFunction(fullyQualifiedName, config);
}
static PythonFunctionFactory getPythonFunctionFactory(ReadableConfig config)
throws ExecutionException, InterruptedException, IOException {
synchronized (PythonFunctionFactory.class) {
if (PYTHON_FUNCTION_FACTORY_REF.get() != null) {
return PYTHON_FUNCTION_FACTORY_REF.get();
} else {
Map<String, Object> entryPoint;
if (getGatewayServer() == null) {
GatewayServer gatewayServer = null;
Process pythonProcess = null;
try {
gatewayServer = startGatewayServer();
setGatewayServer(gatewayServer);
List<String> commands = new ArrayList<>();
commands.add("-m");
commands.add("pyflink.pyflink_callback_server");
String tmpDir =
System.getProperty("java.io.tmpdir")
+ File.separator
+ "pyflink"
+ File.separator
+ UUID.randomUUID();
pythonProcess =
launchPy4jPythonClient(
gatewayServer, config, commands, null, tmpDir, false);
entryPoint =
(Map<String, Object>) gatewayServer.getGateway().getEntryPoint();
int i = 0;
while (!entryPoint.containsKey("PythonFunctionFactory")) {
if (!pythonProcess.isAlive()) {
throw new RuntimeException("Python callback server start failed!");
}
try {
Thread.sleep(CHECK_INTERVAL);
} catch (InterruptedException e) {
throw new RuntimeException(
"Interrupted while waiting for the python process to start.",
e);
}
i++;
if (i > TIMEOUT_MILLIS / CHECK_INTERVAL) {
throw new RuntimeException("Python callback server start failed!");
}
}
} catch (Throwable e) {
try {
setGatewayServer(null);
if (gatewayServer != null) {
gatewayServer.shutdown();
}
} catch (Throwable e2) {
// ignore, do not swallow the origin exception.
}
try {
if (pythonProcess != null) {
shutdownPythonProcess(pythonProcess, TIMEOUT_MILLIS);
}
} catch (Throwable e3) {
// ignore, do not swallow the origin exception.
}
throw e;
}
Runtime.getRuntime()
.addShutdownHook(new PythonProcessShutdownHook(pythonProcess));
} else {
entryPoint =
(Map<String, Object>) getGatewayServer().getGateway().getEntryPoint();
}
PythonFunctionFactory pythonFunctionFactory =
(PythonFunctionFactory) entryPoint.get("PythonFunctionFactory");
PYTHON_FUNCTION_FACTORY_REF.set(pythonFunctionFactory);
return pythonFunctionFactory;
}
}
}
static void shutdownPythonProcess(Process pythonProcess, long timeoutMillis) {
pythonProcess.destroy();
try {
pythonProcess.waitFor(timeoutMillis, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
throw new RuntimeException(
"Interrupt while waiting for the python process to stop.", e);
}
if (pythonProcess.isAlive()) {
pythonProcess.destroyForcibly();
}
}
/**
* The shutdown hook used to destroy the Python process.
*/
class PythonProcessShutdownHook extends Thread {
private Process process;
public PythonProcessShutdownHook(Process process) {
this.process = process;
}
@Override
public void run() {
shutdownPythonProcess(process, TIMEOUT_MILLIS);
}
}
}
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<artifactId>dlink-client-1.13</artifactId> <artifactId>dlink-client-1.13</artifactId>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>${target.java.version}</maven.compiler.source> <maven.compiler.source>${target.java.version}</maven.compiler.source>
<maven.compiler.target>${target.java.version}</maven.compiler.target> <maven.compiler.target>${target.java.version}</maven.compiler.target>
...@@ -49,17 +48,6 @@ ...@@ -49,17 +48,6 @@
<artifactId>dlink-flink-1.13</artifactId> <artifactId>dlink-flink-1.13</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-connector-jdbc-1.13</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.starrocks</groupId>
<artifactId>flink-connector-starrocks</artifactId>
<version>1.2.3_flink-1.13_${scala.binary.version}</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -196,6 +196,7 @@ public class CustomTableEnvironmentImpl extends TableEnvironmentImpl implements ...@@ -196,6 +196,7 @@ public class CustomTableEnvironmentImpl extends TableEnvironmentImpl implements
} }
} }
@Override
public ObjectNode getStreamGraph(String statement) { public ObjectNode getStreamGraph(String statement) {
List<Operation> operations = super.getParser().parse(statement); List<Operation> operations = super.getParser().parse(statement);
if (operations.size() != 1) { if (operations.size() != 1) {
...@@ -227,10 +228,12 @@ public class CustomTableEnvironmentImpl extends TableEnvironmentImpl implements ...@@ -227,10 +228,12 @@ public class CustomTableEnvironmentImpl extends TableEnvironmentImpl implements
} }
} }
@Override
public JobPlanInfo getJobPlanInfo(List<String> statements) { public JobPlanInfo getJobPlanInfo(List<String> statements) {
return new JobPlanInfo(JsonPlanGenerator.generatePlan(getJobGraphFromInserts(statements))); return new JobPlanInfo(JsonPlanGenerator.generatePlan(getJobGraphFromInserts(statements)));
} }
@Override
public StreamGraph getStreamGraphFromInserts(List<String> statements) { public StreamGraph getStreamGraphFromInserts(List<String> statements) {
List<ModifyOperation> modifyOperations = new ArrayList(); List<ModifyOperation> modifyOperations = new ArrayList();
for (String statement : statements) { for (String statement : statements) {
...@@ -258,10 +261,12 @@ public class CustomTableEnvironmentImpl extends TableEnvironmentImpl implements ...@@ -258,10 +261,12 @@ public class CustomTableEnvironmentImpl extends TableEnvironmentImpl implements
} }
} }
@Override
public JobGraph getJobGraphFromInserts(List<String> statements) { public JobGraph getJobGraphFromInserts(List<String> statements) {
return getStreamGraphFromInserts(statements).getJobGraph(); return getStreamGraphFromInserts(statements).getJobGraph();
} }
@Override
public SqlExplainResult explainSqlRecord(String statement, ExplainDetail... extraDetails) { public SqlExplainResult explainSqlRecord(String statement, ExplainDetail... extraDetails) {
SqlExplainResult record = new SqlExplainResult(); SqlExplainResult record = new SqlExplainResult();
List<Operation> operations = getParser().parse(statement); List<Operation> operations = getParser().parse(statement);
...@@ -290,6 +295,7 @@ public class CustomTableEnvironmentImpl extends TableEnvironmentImpl implements ...@@ -290,6 +295,7 @@ public class CustomTableEnvironmentImpl extends TableEnvironmentImpl implements
return record; return record;
} }
@Override
public boolean parseAndLoadConfiguration(String statement, StreamExecutionEnvironment environment, Map<String, Object> setMap) { public boolean parseAndLoadConfiguration(String statement, StreamExecutionEnvironment environment, Map<String, Object> setMap) {
List<Operation> operations = getParser().parse(statement); List<Operation> operations = getParser().parse(statement);
for (Operation operation : operations) { for (Operation operation : operations) {
......
...@@ -50,12 +50,6 @@ ...@@ -50,12 +50,6 @@
<artifactId>jackson-datatype-jsr310</artifactId> <artifactId>jackson-datatype-jsr310</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>com.starrocks</groupId>
<artifactId>flink-connector-starrocks</artifactId>
<version>1.2.3_flink-1.14_${scala.binary.version}</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>javax.xml.bind</groupId> <groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId> <artifactId>jaxb-api</artifactId>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<artifactId>dlink-client-1.15</artifactId> <artifactId>dlink-client-1.15</artifactId>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>${target.java.version}</maven.compiler.source> <maven.compiler.source>${target.java.version}</maven.compiler.source>
<maven.compiler.target>${target.java.version}</maven.compiler.target> <maven.compiler.target>${target.java.version}</maven.compiler.target>
......
...@@ -128,15 +128,14 @@ ...@@ -128,15 +128,14 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>8</source> <source>${target.java.version}</source>
<target>8</target> <target>${target.java.version}</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
......
...@@ -38,14 +38,14 @@ ...@@ -38,14 +38,14 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>org.apache.flink</groupId>
<artifactId>flink-table-api-java-bridge_2.12</artifactId> <artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId>
<version>${flink.version}</version> <version>${flink.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.doris</groupId> <groupId>org.apache.doris</groupId>
<artifactId>flink-doris-connector-1.13_2.12</artifactId> <artifactId>flink-doris-connector-1.13_${scala.binary.version}</artifactId>
<version>1.0.3</version> <version>1.0.3</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<artifactId>dlink-connector-jdbc-1.11</artifactId> <artifactId>dlink-connector-jdbc-1.11</artifactId>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<flink.version>1.11.6</flink.version> <flink.version>1.11.6</flink.version>
<maven.compiler.source>${target.java.version}</maven.compiler.source> <maven.compiler.source>${target.java.version}</maven.compiler.source>
...@@ -41,26 +40,10 @@ ...@@ -41,26 +40,10 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>com.dlink</groupId>
<artifactId>flink-connector-jdbc_${scala.binary.version}</artifactId> <artifactId>dlink-flink-1.11</artifactId>
<version>${flink.version}</version> <scope>${scope.runtime}</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency> </dependency>
<!-- Postgres dependencies --> <!-- Postgres dependencies -->
<dependency> <dependency>
<groupId>org.postgresql</groupId> <groupId>org.postgresql</groupId>
...@@ -76,38 +59,6 @@ ...@@ -76,38 +59,6 @@
<version>${flink.version}</version> <version>${flink.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-common</artifactId>
<version>${flink.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!-- A planner dependency won't be necessary once FLIP-32 has been completed. -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
<!-- Postgres test dependencies --> <!-- Postgres test dependencies -->
<dependency> <dependency>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<artifactId>dlink-connector-jdbc-1.12</artifactId> <artifactId>dlink-connector-jdbc-1.12</artifactId>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<flink.version>1.12.7</flink.version> <flink.version>1.12.7</flink.version>
<maven.compiler.source>${target.java.version}</maven.compiler.source> <maven.compiler.source>${target.java.version}</maven.compiler.source>
...@@ -41,26 +40,10 @@ ...@@ -41,26 +40,10 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>com.dlink</groupId>
<artifactId>flink-connector-jdbc_${scala.binary.version}</artifactId> <artifactId>dlink-flink-1.12</artifactId>
<version>${flink.version}</version> <scope>${scope.runtime}</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency> </dependency>
<!-- Postgres dependencies --> <!-- Postgres dependencies -->
<dependency> <dependency>
<groupId>org.postgresql</groupId> <groupId>org.postgresql</groupId>
...@@ -69,45 +52,6 @@ ...@@ -69,45 +52,6 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-common</artifactId>
<version>${flink.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!-- A planner dependency won't be necessary once FLIP-32 has been completed. -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
<!-- Postgres test dependencies --> <!-- Postgres test dependencies -->
<dependency> <dependency>
...@@ -169,6 +113,7 @@ ...@@ -169,6 +113,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration> <configuration>
<!-- 指定打包的jar包输出路径 --> <!-- 指定打包的jar包输出路径 -->
<outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory> <outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<artifactId>dlink-connector-jdbc-1.13</artifactId> <artifactId>dlink-connector-jdbc-1.13</artifactId>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<flink.version>1.13.6</flink.version> <flink.version>1.13.6</flink.version>
<maven.compiler.source>${target.java.version}</maven.compiler.source> <maven.compiler.source>${target.java.version}</maven.compiler.source>
...@@ -41,24 +40,9 @@ ...@@ -41,24 +40,9 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>com.dlink</groupId>
<artifactId>flink-connector-jdbc_${scala.binary.version}</artifactId> <artifactId>dlink-flink-1.13</artifactId>
<version>${flink.version}</version> <scope>${scope.runtime}</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency> </dependency>
<!-- Postgres dependencies --> <!-- Postgres dependencies -->
...@@ -69,37 +53,6 @@ ...@@ -69,37 +53,6 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-common</artifactId>
<version>${flink.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!-- A planner dependency won't be necessary once FLIP-32 has been completed. -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
<!-- Postgres test dependencies --> <!-- Postgres test dependencies -->
<dependency> <dependency>
......
...@@ -38,27 +38,12 @@ ...@@ -38,27 +38,12 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-jdbc_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>com.dlink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId> <artifactId>dlink-flink-1.14</artifactId>
<version>${flink.version}</version> <scope>${scope.runtime}</scope>
<scope>provided</scope>
</dependency> </dependency>
<!-- Postgres dependencies --> <!-- Postgres dependencies -->
<dependency> <dependency>
<groupId>org.postgresql</groupId> <groupId>org.postgresql</groupId>
...@@ -67,21 +52,6 @@ ...@@ -67,21 +52,6 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-common</artifactId>
<version>${flink.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!-- A planner dependency won't be necessary once FLIP-32 has been completed. -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
<!-- Postgres test dependencies --> <!-- Postgres test dependencies -->
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<artifactId>dlink-connector-phoenix-1.13</artifactId> <artifactId>dlink-connector-phoenix-1.13</artifactId>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<flink.version>1.13.6</flink.version> <flink.version>1.13.6</flink.version>
<maven.compiler.source>${target.java.version}</maven.compiler.source> <maven.compiler.source>${target.java.version}</maven.compiler.source>
...@@ -40,68 +39,12 @@ ...@@ -40,68 +39,12 @@
</properties> </properties>
<dependencies> <dependencies>
<!--
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-jdbc_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>
-->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<!--<scope>provided</scope>-->
<scope>${phoenix.scope.runtime}</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<!--<scope>provided</scope>-->
<scope>${phoenix.scope.runtime}</scope>
</dependency>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>com.dlink</groupId>
<artifactId>flink-table-common</artifactId> <artifactId>dlink-flink-1.13</artifactId>
<version>${flink.version}</version> <scope>${scope.runtime}</scope>
<type>test-jar</type>
<scope>test</scope>
<!-- <scope>${phoenix.scope.runtime}</scope>-->
</dependency>
<!-- A planner dependency won't be necessary once FLIP-32 has been completed. -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
<!-- <scope>${phoenix.scope.runtime}</scope>-->
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<type>test-jar</type>
<scope>test</scope>
<!-- <scope>${phoenix.scope.runtime}</scope>-->
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
<!--<scope>${phoenix.scope.runtime}</scope>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.phoenix</groupId> <groupId>org.apache.phoenix</groupId>
<artifactId>phoenix-core</artifactId> <artifactId>phoenix-core</artifactId>
...@@ -116,6 +59,7 @@ ...@@ -116,6 +59,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration> <configuration>
<!-- 指定打包的jar包输出路径 --> <!-- 指定打包的jar包输出路径 -->
<outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory> <outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory>
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
<artifactId>dlink-connector-phoenix-1.14</artifactId> <artifactId>dlink-connector-phoenix-1.14</artifactId>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<flink.version>1.14.6</flink.version> <flink.version>1.14.6</flink.version>
<maven.compiler.source>${target.java.version}</maven.compiler.source> <maven.compiler.source>${target.java.version}</maven.compiler.source>
...@@ -39,53 +38,10 @@ ...@@ -39,53 +38,10 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>com.dlink</groupId>
<artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId> <artifactId>dlink-flink-1.14</artifactId>
<version>${flink.version}</version>
<scope>${phoenix.scope.runtime}</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<!--<scope>provided</scope>-->
<scope>${phoenix.scope.runtime}</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-common</artifactId>
<version>${flink.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!-- A planner dependency won't be necessary once FLIP-32 has been completed. -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
<!-- A planner dependency won't be necessary once FLIP-32 has been completed. -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
<!-- <dependency>
<groupId>org.apache.phoenix</groupId>
<artifactId>phoenix-core</artifactId>
<version>4.14.2-HBase-1.4</version>
<scope>${scope.runtime}</scope> <scope>${scope.runtime}</scope>
</dependency>--> </dependency>
<dependency> <dependency>
<groupId>org.apache.phoenix</groupId> <groupId>org.apache.phoenix</groupId>
<artifactId>phoenix-core</artifactId> <artifactId>phoenix-core</artifactId>
...@@ -105,6 +61,7 @@ ...@@ -105,6 +61,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration> <configuration>
<!-- 指定打包的jar包输出路径 --> <!-- 指定打包的jar包输出路径 -->
<outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory> <outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory>
......
...@@ -27,12 +27,9 @@ ...@@ -27,12 +27,9 @@
<artifactId>dlink-connector-pulsar-1.14</artifactId> <artifactId>dlink-connector-pulsar-1.14</artifactId>
<properties> <properties>
<pulsar.version>2.8.2</pulsar.version> <pulsar.version>2.9.1</pulsar.version>
<!--<scala.version>2.11.12</scala.version>-->
<scala.binary.version>2.11</scala.binary.version>
<hbase.version>1.4.3</hbase.version> <hbase.version>1.4.3</hbase.version>
<hadoop.version>2.4.1</hadoop.version> <hadoop.version>2.4.1</hadoop.version>
<!--<flink.shaded.version>9.0</flink.shaded.version>-->
<fastjson.version>1.2.7</fastjson.version> <fastjson.version>1.2.7</fastjson.version>
<flink.version>1.14.6</flink.version> <flink.version>1.14.6</flink.version>
</properties> </properties>
...@@ -67,134 +64,9 @@ ...@@ -67,134 +64,9 @@
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>org.apache.flink</groupId>
<artifactId>flink-connector-pulsar_2.11</artifactId> <artifactId>flink-connector-pulsar_${scala.binary.version}</artifactId>
<version>${flink.version}</version> <version>${flink.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-json</artifactId>
<version>${flink.version}</version>
</dependency>
<!-- test -->
<!--<dependency>-->
<!--<groupId>org.apache.flink</groupId>-->
<!--<artifactId>flink-streaming-java_2.11</artifactId>-->
<!--<version>${flink.version}</version>-->
<!--&lt;!&ndash;<scope>test</scope>&ndash;&gt;-->
<!--</dependency>-->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-api-java-bridge_2.11</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_2.11</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-scala_2.11</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-common</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
<!-- core dependencies -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-core</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
<!-- flink-java dependencies -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-java</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
<!-- flink-scala dependencies -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-scala_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>
<!-- Table ecosystem -->
<!-- Projects depending on this project won't depend on flink-table-*. -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
<exclusions>
<!-- Remove unneeded dependency, which is conflicting with our jetty-util version. -->
<exclusion>
<groupId>io.netty</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-clients_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-hadoop-compatibility_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.flink</groupId>
<artifactId>flink-shaded-include-yarn_${scala.binary.version}</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--Test dependencies are only available for Hadoop-2.-->
<!--<dependency>-->
<!--<groupId>org.apache.hbase</groupId>-->
<!--<artifactId>hbase-server</artifactId>-->
<!--<version>${hbase.version}</version>-->
<!--<type>test-jar</type>-->
<!--<scope>test</scope>-->
<!--</dependency>-->
<dependency> <dependency>
<groupId>org.apache.hadoop</groupId> <groupId>org.apache.hadoop</groupId>
...@@ -215,14 +87,6 @@ ...@@ -215,14 +87,6 @@
</exclusions> </exclusions>
</dependency> </dependency>
<!--<dependency>-->
<!--<groupId>org.apache.hbase</groupId>-->
<!--<artifactId>hbase-hadoop-compat</artifactId>-->
<!--<version>${hbase.version}</version>-->
<!--<scope>test</scope>-->
<!--<type>test-jar</type>-->
<!--</dependency>-->
<dependency> <dependency>
<groupId>org.apache.hadoop</groupId> <groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId> <artifactId>hadoop-hdfs</artifactId>
...@@ -231,13 +95,6 @@ ...@@ -231,13 +95,6 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!--<dependency>-->
<!--<groupId>org.apache.hbase</groupId>-->
<!--<artifactId>hbase-hadoop2-compat</artifactId>-->
<!--<version>${hbase.version}</version>-->
<!--<scope>test</scope>-->
<!--<type>test-jar</type>-->
<!--</dependency>-->
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils_${scala.binary.version}</artifactId> <artifactId>flink-test-utils_${scala.binary.version}</artifactId>
...@@ -245,11 +102,9 @@ ...@@ -245,11 +102,9 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>com.dlink</groupId>
<artifactId>flink-table-common</artifactId> <artifactId>dlink-flink-1.14</artifactId>
<version>${flink.version}</version> <scope>${scope.runtime}</scope>
<type>test-jar</type>
<scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>org.apache.flink</groupId>
...@@ -258,18 +113,6 @@ ...@@ -258,18 +113,6 @@
<type>test-jar</type> <type>test-jar</type>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!--<dependency>-->
<!--<groupId>org.apache.pulsar</groupId>-->
<!--<artifactId>pulsar-client</artifactId>-->
<!--<version>${pulsar.version}</version>-->
<!--<exclusions>-->
<!--<exclusion>-->
<!--<groupId>com.google.protobuf</groupId>-->
<!--<artifactId>protobuf-java</artifactId>-->
<!--</exclusion>-->
<!--</exclusions>-->
<!--</dependency>-->
</dependencies> </dependencies>
<build> <build>
...@@ -286,6 +129,7 @@ ...@@ -286,6 +129,7 @@
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<configuration> <configuration>
<descriptorRefs> <descriptorRefs>
...@@ -324,6 +168,7 @@ ...@@ -324,6 +168,7 @@
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
<version>1.2</version> <version>1.2</version>
<executions> <executions>
......
...@@ -104,7 +104,6 @@ ...@@ -104,7 +104,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration> <configuration>
<source>${target.java.version}</source> <source>${target.java.version}</source>
<target>${target.java.version}</target> <target>${target.java.version}</target>
...@@ -112,6 +111,7 @@ ...@@ -112,6 +111,7 @@
</plugin> </plugin>
<!--打jar包--> <!--打jar包-->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<configuration> <configuration>
<descriptorRefs> <descriptorRefs>
......
...@@ -43,6 +43,11 @@ ...@@ -43,6 +43,11 @@
<artifactId>flink-python_${scala.binary.version}</artifactId> <artifactId>flink-python_${scala.binary.version}</artifactId>
<version>${flink.version}</version> <version>${flink.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-common</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId> <artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
...@@ -67,7 +72,7 @@ ...@@ -67,7 +72,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>org.apache.flink</groupId>
<artifactId>flink-yarn_2.11</artifactId> <artifactId>flink-yarn_${scala.binary.version}</artifactId>
<version>${flink.version}</version> <version>${flink.version}</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
...@@ -113,8 +118,13 @@ ...@@ -113,8 +118,13 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.doris</groupId> <groupId>org.apache.doris</groupId>
<artifactId>flink-doris-connector-1.11_2.12</artifactId> <artifactId>flink-doris-connector-1.11_${scala.binary.version}</artifactId>
<version>1.0.3</version> <version>1.0.3</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-jdbc_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -43,6 +43,11 @@ ...@@ -43,6 +43,11 @@
<artifactId>flink-python_${scala.binary.version}</artifactId> <artifactId>flink-python_${scala.binary.version}</artifactId>
<version>${flink.version}</version> <version>${flink.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-common</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId> <artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
...@@ -67,7 +72,7 @@ ...@@ -67,7 +72,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>org.apache.flink</groupId>
<artifactId>flink-yarn_2.11</artifactId> <artifactId>flink-yarn_${scala.binary.version}</artifactId>
<version>${flink.version}</version> <version>${flink.version}</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
...@@ -113,9 +118,14 @@ ...@@ -113,9 +118,14 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.doris</groupId> <groupId>org.apache.doris</groupId>
<artifactId>flink-doris-connector-1.12_2.12</artifactId> <artifactId>flink-doris-connector-1.12_${scala.binary.version}</artifactId>
<version>1.0.3</version> <version>1.0.3</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-jdbc_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.flink</groupId> <groupId>org.apache.flink</groupId>
<artifactId>flink-yarn_2.11</artifactId> <artifactId>flink-yarn_${scala.binary.version}</artifactId>
<version>${flink.version}</version> <version>${flink.version}</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
...@@ -138,13 +138,18 @@ ...@@ -138,13 +138,18 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.doris</groupId> <groupId>org.apache.doris</groupId>
<artifactId>flink-doris-connector-1.13_2.12</artifactId> <artifactId>flink-doris-connector-1.13_${scala.binary.version}</artifactId>
<version>1.0.3</version> <version>1.0.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.hudi</groupId> <groupId>org.apache.hudi</groupId>
<artifactId>hudi-flink_2.11</artifactId> <artifactId>hudi-flink_${scala.binary.version}</artifactId>
<version>0.10.1</version> <version>0.10.1</version>
</dependency> </dependency>
<dependency>
<groupId>com.starrocks</groupId>
<artifactId>flink-connector-starrocks</artifactId>
<version>1.2.3_flink-1.13_${scala.binary.version}</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
<groupId>org.apache.flink</groupId> <groupId>org.apache.flink</groupId>
<artifactId>flink-table-runtime_${scala.binary.version}</artifactId> <artifactId>flink-table-runtime_${scala.binary.version}</artifactId>
<version>${flink.version}</version> <version>${flink.version}</version>
<scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
...@@ -163,7 +162,6 @@ ...@@ -163,7 +162,6 @@
<groupId>org.apache.flink</groupId> <groupId>org.apache.flink</groupId>
<artifactId>flink-connector-jdbc_${scala.binary.version}</artifactId> <artifactId>flink-connector-jdbc_${scala.binary.version}</artifactId>
<version>${flink.version}</version> <version>${flink.version}</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
...@@ -179,5 +177,15 @@ ...@@ -179,5 +177,15 @@
<artifactId>flink-doris-connector-1.14_${scala.binary.version}</artifactId> <artifactId>flink-doris-connector-1.14_${scala.binary.version}</artifactId>
<version>1.1.0</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency>
<groupId>com.starrocks</groupId>
<artifactId>flink-connector-starrocks</artifactId>
<version>1.2.3_flink-1.14_${scala.binary.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-json</artifactId>
<version>${flink.version}</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -27,16 +27,6 @@ ...@@ -27,16 +27,6 @@
<artifactId>dlink-function</artifactId> <artifactId>dlink-function</artifactId>
<dependencies> <dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-${dlink.flink.version}</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-${dlink.flink.version}</artifactId>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>cn.hutool</groupId> <groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId> <artifactId>hutool-all</artifactId>
...@@ -65,10 +55,106 @@ ...@@ -65,10 +55,106 @@
<dependency> <dependency>
<groupId>org.scala-lang</groupId> <groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId> <artifactId>scala-compiler</artifactId>
<version>2.12.7</version> <version>${scala.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>flink-1.11</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.11</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.11</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.12</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.12</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.12</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.13</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.13</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.13</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.14</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.14</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.14</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.15</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.15</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.15</artifactId>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
</profile>
<profile>
<id>flink-1.16</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.16</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.16</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project> </project>
...@@ -79,6 +79,7 @@ public class PythonFunction implements FunctionCompiler, FunctionPackage { ...@@ -79,6 +79,7 @@ public class PythonFunction implements FunctionCompiler, FunctionPackage {
configuration.set(PythonOptions.PYTHON_FILES, zipFile.getAbsolutePath()); configuration.set(PythonOptions.PYTHON_FILES, zipFile.getAbsolutePath());
configuration.set(PythonOptions.PYTHON_CLIENT_EXECUTABLE, Env.getPath()); configuration.set(PythonOptions.PYTHON_CLIENT_EXECUTABLE, Env.getPath());
configuration.set(PythonOptions.PYTHON_EXECUTABLE, Env.getPath()); configuration.set(PythonOptions.PYTHON_EXECUTABLE, Env.getPath());
PythonFunctionFactory.getPythonFunction(udf.getClassName(), configuration, null); PythonFunctionFactory.getPythonFunction(udf.getClassName(), configuration, null);
process.info("Python udf编译成功 ; className:" + udf.getClassName()); process.info("Python udf编译成功 ; className:" + udf.getClassName());
} catch (Exception e) { } catch (Exception e) {
...@@ -117,6 +118,6 @@ public class PythonFunction implements FunctionCompiler, FunctionPackage { ...@@ -117,6 +118,6 @@ public class PythonFunction implements FunctionCompiler, FunctionPackage {
try (ZipUtils zipWriter = new ZipUtils(file, Charset.defaultCharset())) { try (ZipUtils zipWriter = new ZipUtils(file, Charset.defaultCharset())) {
zipWriter.add(paths, inputStreams); zipWriter.add(paths, inputStreams);
} }
return new String[]{path}; return new String[] {path};
} }
} }
package com.dlink.function.util;
import org.apache.flink.runtime.util.EnvironmentInformation;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
/**
* @author ZackYoung
* @since 0.6.8
*/
public class FlinkUtils {
public static String getFlinkVersion() {
return EnvironmentInformation.getVersion();
}
/**
* @param version flink version。如:1.14.6
* @return flink 大版本,如 14
*/
public static String getFlinkBigVersion(String version) {
return StrUtil.split(version, ".").get(1);
}
/**
*
* @return 获取当前 flink 大版本
*/
public static Integer getCurFlinkBigVersion() {
return Convert.toInt(getFlinkBigVersion(getFlinkVersion()));
}
}
...@@ -56,16 +56,6 @@ ...@@ -56,16 +56,6 @@
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-${dlink.flink.version}</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-${dlink.flink.version}</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
<dependency> <dependency>
<groupId>com.dlink</groupId> <groupId>com.dlink</groupId>
<artifactId>dlink-client-hadoop</artifactId> <artifactId>dlink-client-hadoop</artifactId>
...@@ -92,4 +82,102 @@ for k8s commit tasks--> ...@@ -92,4 +82,102 @@ for k8s commit tasks-->
</dependencies> </dependencies>
<profiles>
<profile>
<id>flink-1.11</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.11</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.11</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.12</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.12</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.12</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.13</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.13</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.13</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.14</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.14</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.14</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.15</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.15</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.15</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>flink-1.16</id>
<dependencies>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-client-1.16</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
<dependency>
<groupId>com.dlink</groupId>
<artifactId>dlink-flink-1.16</artifactId>
<scope>${scope.runtime}</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project> </project>
\ No newline at end of file
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version> <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
<maven-assembly-plugin.version>3.4.2</maven-assembly-plugin.version> <maven-assembly-plugin.version>3.4.2</maven-assembly-plugin.version>
<maven.resource.version>3.2.0</maven.resource.version> <maven.resource.version>3.2.0</maven.resource.version>
<maven.clean.version>3.2.0</maven.clean.version>
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<protobuf-java.version>2.5.0</protobuf-java.version> <protobuf-java.version>2.5.0</protobuf-java.version>
<jedis.version>2.9.0</jedis.version> <jedis.version>2.9.0</jedis.version>
...@@ -505,6 +506,11 @@ ...@@ -505,6 +506,11 @@
<build> <build>
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven.clean.version}</version>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
...@@ -560,7 +566,6 @@ ...@@ -560,7 +566,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId> <artifactId>maven-clean-plugin</artifactId>
<version>3.2.0</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
...@@ -677,7 +682,6 @@ ...@@ -677,7 +682,6 @@
<profile> <profile>
<id>dev</id> <id>dev</id>
<activation> <activation>
<activeByDefault>true</activeByDefault>
<property> <property>
<name>dev</name> <name>dev</name>
</property> </property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment