TyrantLucifer commented on code in PR #2639:
URL:
https://github.com/apache/incubator-seatunnel/pull/2639#discussion_r962335644
##########
seatunnel-core/seatunnel-spark-starter/src/main/java/org/apache/seatunnel/core/starter/spark/SparkStarter.java:
##########
@@ -191,7 +191,7 @@ private List<Path> getPluginsJarDependencies() throws
IOException {
return stream
Review Comment:
The same suggestion as above. Move this method to
`org.apache.seatunnel.common.config`
##########
seatunnel-core/seatunnel-flink-starter/src/main/java/org/apache/seatunnel/core/starter/flink/execution/FlinkExecution.java:
##########
@@ -70,4 +84,32 @@ public void execute() throws TaskExecuteException {
throw new TaskExecuteException("Execute Flink job error", e);
}
}
+
+ /**
+ * return plugin's dependent jars, which located in
'plugins/${pluginName}/lib/*'.
+ */
+ private List<URL> getPluginsJarDependencies() {
Review Comment:
This method is implemented once in both sparkstarter and flinkstarter, and
there is almost no difference in the code, so you can put this method as a
static method in this class `org.apache.seatunnel.common.config`,
The method is defined as follows:
```java
List<Path> getPluginsJarDependencies() throws IOException {}
```
In flinkstarter, you can use it like this:
```java
List<URL> pluginDependencies =
Common.getPluginsJarDependencies().stream().map(jar -> jar.toUri().toURL())
```
This can greatly reduce the redundancy of the code, what do you think about
it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]