Skip to content

Commit

Permalink
[Build] Remove connector/seatunnel directory (apache#5489)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hisoka-X authored and gnehil committed Oct 12, 2023
1 parent 39caf86 commit c5a53f7
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 40 deletions.
8 changes: 1 addition & 7 deletions bin/install-plugin.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,12 @@ if not exist "%SEATUNNEL_HOME%\connectors" (
echo create connectors directory
)

REM Create the seatunnel connectors directory (for v2)
if not exist "%SEATUNNEL_HOME%\connectors\seatunnel" (
mkdir "%SEATUNNEL_HOME%\connectors\seatunnel"
echo create seatunnel connectors directory
)

for /f "usebackq delims=" %%a in ("%SEATUNNEL_HOME%\config\plugin_config") do (
set "line=%%a"
setlocal enabledelayedexpansion
if "!line:~0,1!" neq "-" if "!line:~0,1!" neq "#" (
echo install connector : !line!
call "%SEATUNNEL_HOME%\mvnw.cmd" dependency:get -DgroupId="org.apache.seatunnel" -DartifactId="!line!" -Dversion="%version%" -Ddest="%SEATUNNEL_HOME%\connectors\seatunnel"
call "%SEATUNNEL_HOME%\mvnw.cmd" dependency:get -DgroupId="org.apache.seatunnel" -DartifactId="!line!" -Dversion="%version%" -Ddest="%SEATUNNEL_HOME%\connectors"
)
endlocal
)
9 changes: 1 addition & 8 deletions bin/install-plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,11 @@ if [ ! -d ${SEATUNNEL_HOME}/connectors ];
echo "create connectors directory"
fi

# create the seatunnel connectors directory (for v2)
if [ ! -d ${SEATUNNEL_HOME}/connectors/seatunnel ];
then
mkdir ${SEATUNNEL_HOME}/connectors/seatunnel
echo "create seatunnel connectors directory"
fi

while read line; do
if [ ${line:0:1} != "-" ] && [ ${line:0:1} != "#" ]
then
echo "install connector : " $line
${SEATUNNEL_HOME}/mvnw dependency:get -DgroupId=org.apache.seatunnel -DartifactId=${line} -Dversion=${version} -Ddest=${SEATUNNEL_HOME}/connectors/seatunnel
${SEATUNNEL_HOME}/mvnw dependency:get -DgroupId=org.apache.seatunnel -DartifactId=${line} -Dversion=${version} -Ddest=${SEATUNNEL_HOME}/connectors
fi

done < ${SEATUNNEL_HOME}/config/plugin_config
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ public static Path pluginRootDir() {
return Paths.get(getSeaTunnelHome(), "plugins");
}

/** Plugin Connector Jar Dir */
public static Path connectorJarDir(String engine) {
return Paths.get(getSeaTunnelHome(), "connectors", engine.toLowerCase());
}

/** Plugin Connector Dir */
public static Path connectorDir() {
return Paths.get(getSeaTunnelHome(), "connectors");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ static Map<String, String> getSparkConf(String configFile) throws FileNotFoundEx
Map.Entry::getKey, e -> e.getValue().unwrapped().toString()));
}

/** return connector's jars, which located in 'connectors/spark/*'. */
/** return connector's jars, which located in 'connectors/*'. */
private List<Path> getConnectorJarDependencies() {
Path pluginRootDir = Common.connectorJarDir("seatunnel");
Path pluginRootDir = Common.connectorDir();
if (!Files.exists(pluginRootDir) || !Files.isDirectory(pluginRootDir)) {
return Collections.emptyList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ static Map<String, String> getSparkConf(String configFile) throws FileNotFoundEx
Map.Entry::getKey, e -> e.getValue().unwrapped().toString()));
}

/** return connector's jars, which located in 'connectors/spark/*'. */
/** return connector's jars, which located in 'connectors/*'. */
private List<Path> getConnectorJarDependencies() {
Path pluginRootDir = Common.connectorJarDir("seatunnel");
Path pluginRootDir = Common.connectorDir();
if (!Files.exists(pluginRootDir) || !Files.isDirectory(pluginRootDir)) {
return Collections.emptyList();
}
Expand Down
2 changes: 1 addition & 1 deletion seatunnel-dist/src/main/assembly/assembly-bin-ci.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<exclude>org.apache.seatunnel:connector-file-base-hadoop</exclude>
<exclude>org.apache.seatunnel:connector-cdc-base</exclude>
</excludes>
<outputDirectory>/connectors/seatunnel</outputDirectory>
<outputDirectory>/connectors</outputDirectory>
<scope>provided</scope>
</dependencySet>

Expand Down
2 changes: 1 addition & 1 deletion seatunnel-dist/src/main/assembly/assembly-bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
<include>org.apache.seatunnel:connector-fake:jar</include>
<include>org.apache.seatunnel:connector-console:jar</include>
</includes>
<outputDirectory>/connectors/seatunnel</outputDirectory>
<outputDirectory>/connectors</outputDirectory>
<scope>provided</scope>
</dependencySet>
</dependencySets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ public static void copyConnectorJarToContainer(
jar ->
container.copyFileToContainer(
MountableFile.forHostPath(jar.getAbsolutePath()),
Paths.get(seatunnelHome, "connectors", connectorType, jar.getName())
.toString()));
Paths.get(seatunnelHome, "connectors", jar.getName()).toString()));
}

public static String copyConfigFileToContainer(GenericContainer<?> container, String confFile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,12 @@ public abstract class AbstractPluginDiscovery<T> implements PluginDiscovery<T> {
protected final ConcurrentHashMap<PluginIdentifier, Optional<URL>> pluginJarPath =
new ConcurrentHashMap<>(Common.COLLECTION_SIZE);

public AbstractPluginDiscovery(
String pluginSubDir, BiConsumer<ClassLoader, URL> addURLToClassloader) {
this(
Common.connectorJarDir(pluginSubDir),
loadConnectorPluginConfig(),
addURLToClassloader);
public AbstractPluginDiscovery(BiConsumer<ClassLoader, URL> addURLToClassloader) {
this(Common.connectorDir(), loadConnectorPluginConfig(), addURLToClassloader);
}

public AbstractPluginDiscovery(String pluginSubDir) {
this(Common.connectorJarDir(pluginSubDir), loadConnectorPluginConfig());
public AbstractPluginDiscovery() {
this(Common.connectorDir(), loadConnectorPluginConfig());
}

public AbstractPluginDiscovery(Path pluginDir) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
public class SeaTunnelSinkPluginDiscovery extends AbstractPluginDiscovery<SeaTunnelSink> {

public SeaTunnelSinkPluginDiscovery() {
super("seatunnel");
super();
}

public SeaTunnelSinkPluginDiscovery(BiConsumer<ClassLoader, URL> addURLToClassLoader) {
super("seatunnel", addURLToClassLoader);
super(addURLToClassLoader);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
public class SeaTunnelSourcePluginDiscovery extends AbstractPluginDiscovery<SeaTunnelSource> {

public SeaTunnelSourcePluginDiscovery() {
super("seatunnel");
super();
}

public SeaTunnelSourcePluginDiscovery(BiConsumer<ClassLoader, URL> addURLToClassLoader) {
super("seatunnel", addURLToClassLoader);
super(addURLToClassLoader);
}

@Override
Expand Down

0 comments on commit c5a53f7

Please sign in to comment.