Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
liugddx committed Jan 23, 2025
1 parent 180b031 commit 2bb258f
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 54 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.apache.seatunnel.api.table.type.SeaTunnelRow;
import org.apache.seatunnel.common.constants.PluginType;
import org.apache.seatunnel.common.exception.SeaTunnelRuntimeException;
import org.apache.seatunnel.core.starter.enums.EngineType;
import org.apache.seatunnel.core.starter.exception.TaskExecuteException;
import org.apache.seatunnel.plugin.discovery.seatunnel.SeaTunnelFactoryDiscovery;
import org.apache.seatunnel.plugin.discovery.seatunnel.SeaTunnelSinkPluginDiscovery;
Expand Down Expand Up @@ -84,7 +85,7 @@ protected List<Optional<? extends Factory>> initializePlugins(
(TableSinkFactory)
factoryDiscovery.createPluginInstance(
PluginIdentifier.of(
ENGINE_TYPE,
EngineType.SEATUNNEL.getEngine(),
PluginType.SINK.getType(),
pluginName));

Expand All @@ -95,7 +96,7 @@ protected List<Optional<? extends Factory>> initializePlugins(
sinkPluginDiscovery.getPluginJarPaths(
Lists.newArrayList(
PluginIdentifier.of(
ENGINE_TYPE,
EngineType.SEATUNNEL.getEngine(),
PluginType.SINK.getType(),
sinkConfig.getString(
PLUGIN_NAME.key())))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
public abstract class FlinkAbstractPluginExecuteProcessor<T>
implements PluginExecuteProcessor<DataStreamTableInfo, FlinkRuntimeEnvironment> {

protected static final String ENGINE_TYPE = "seatunnel";

protected static final BiConsumer<ClassLoader, URL> ADD_URL_TO_CLASSLOADER =
(classLoader, url) -> {
if (classLoader.getClass().getName().endsWith("SafetyNetWrapperClassLoader")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.apache.seatunnel.api.table.type.SeaTunnelRow;
import org.apache.seatunnel.common.constants.PluginType;
import org.apache.seatunnel.common.exception.SeaTunnelRuntimeException;
import org.apache.seatunnel.core.starter.enums.EngineType;
import org.apache.seatunnel.core.starter.exception.TaskExecuteException;
import org.apache.seatunnel.plugin.discovery.seatunnel.SeaTunnelFactoryDiscovery;
import org.apache.seatunnel.plugin.discovery.seatunnel.SeaTunnelSinkPluginDiscovery;
Expand Down Expand Up @@ -86,7 +87,7 @@ protected List<Optional<? extends Factory>> initializePlugins(
(TableSinkFactory)
factoryDiscovery.createPluginInstance(
PluginIdentifier.of(
ENGINE_TYPE,
EngineType.SEATUNNEL.getEngine(),
PluginType.SINK.getType(),
pluginName));

Expand All @@ -97,7 +98,7 @@ protected List<Optional<? extends Factory>> initializePlugins(
sinkPluginDiscovery.getPluginJarPaths(
Lists.newArrayList(
PluginIdentifier.of(
ENGINE_TYPE,
EngineType.SEATUNNEL.getEngine(),
PluginType.SINK.getType(),
sinkConfig.getString(
PLUGIN_NAME.key())))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
import org.apache.seatunnel.api.table.factory.FactoryUtil;
import org.apache.seatunnel.api.table.factory.TableSourceFactory;
import org.apache.seatunnel.api.table.type.SeaTunnelRow;
import org.apache.seatunnel.core.starter.enums.PluginType;
import org.apache.seatunnel.common.constants.PluginType;
import org.apache.seatunnel.core.starter.enums.EngineType;
import org.apache.seatunnel.core.starter.execution.SourceTableInfo;
import org.apache.seatunnel.plugin.discovery.seatunnel.SeaTunnelFactoryDiscovery;
import org.apache.seatunnel.plugin.discovery.seatunnel.SeaTunnelSourcePluginDiscovery;
Expand Down Expand Up @@ -58,7 +59,6 @@
@Slf4j
@SuppressWarnings("unchecked,rawtypes")
public class SourceExecuteProcessor extends FlinkAbstractPluginExecuteProcessor<SourceTableInfo> {
private static final String PLUGIN_TYPE = PluginType.SOURCE.getType();

public SourceExecuteProcessor(
List<URL> jarPaths,
Expand Down Expand Up @@ -113,7 +113,9 @@ protected List<SourceTableInfo> initializePlugins(
for (Config sourceConfig : pluginConfigs) {
PluginIdentifier pluginIdentifier =
PluginIdentifier.of(
ENGINE_TYPE, PLUGIN_TYPE, sourceConfig.getString(PLUGIN_NAME.key()));
EngineType.SEATUNNEL.getEngine(),
PluginType.SOURCE.getType(),
sourceConfig.getString(PLUGIN_NAME.key()));
jars.addAll(
sourcePluginDiscovery.getPluginJarPaths(Lists.newArrayList(pluginIdentifier)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.seatunnel.api.transform.SeaTunnelMapTransform;
import org.apache.seatunnel.api.transform.SeaTunnelTransform;
import org.apache.seatunnel.common.constants.PluginType;
import org.apache.seatunnel.core.starter.enums.EngineType;
import org.apache.seatunnel.core.starter.exception.TaskExecuteException;
import org.apache.seatunnel.plugin.discovery.seatunnel.SeaTunnelFactoryDiscovery;
import org.apache.seatunnel.plugin.discovery.seatunnel.SeaTunnelTransformPluginDiscovery;
Expand Down Expand Up @@ -79,15 +80,18 @@ protected List<TableTransformFactory> initializePlugins(
pluginName ->
(TableTransformFactory)
factoryDiscovery.createPluginInstance(
PluginIdentifier.of(ENGINE_TYPE, "transform", pluginName));
PluginIdentifier.of(
EngineType.SEATUNNEL.getEngine(),
PluginType.TRANSFORM.getType(),
pluginName));
return pluginConfigs.stream()
.map(
transformConfig -> {
jarPaths.addAll(
transformPluginDiscovery.getPluginJarPaths(
Lists.newArrayList(
PluginIdentifier.of(
ENGINE_TYPE,
EngineType.SEATUNNEL.getEngine(),
PluginType.TRANSFORM.getType(),
transformConfig.getString(
PLUGIN_NAME.key())))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import org.apache.seatunnel.api.env.EnvCommonOptions;
import org.apache.seatunnel.common.config.Common;
import org.apache.seatunnel.common.config.DeployMode;
import org.apache.seatunnel.common.constants.PluginType;
import org.apache.seatunnel.core.starter.Starter;
import org.apache.seatunnel.core.starter.enums.EngineType;
import org.apache.seatunnel.core.starter.enums.PluginType;
import org.apache.seatunnel.core.starter.spark.args.SparkCommandArgs;
import org.apache.seatunnel.core.starter.utils.CommandLineUtils;
import org.apache.seatunnel.core.starter.utils.CompressionUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import org.apache.seatunnel.api.env.EnvCommonOptions;
import org.apache.seatunnel.common.config.Common;
import org.apache.seatunnel.common.config.DeployMode;
import org.apache.seatunnel.common.constants.PluginType;
import org.apache.seatunnel.core.starter.Starter;
import org.apache.seatunnel.core.starter.enums.EngineType;
import org.apache.seatunnel.core.starter.enums.PluginType;
import org.apache.seatunnel.core.starter.spark.args.SparkCommandArgs;
import org.apache.seatunnel.core.starter.utils.CommandLineUtils;
import org.apache.seatunnel.core.starter.utils.CompressionUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
import org.apache.seatunnel.api.table.catalog.CatalogTable;
import org.apache.seatunnel.api.table.factory.FactoryUtil;
import org.apache.seatunnel.common.Constants;
import org.apache.seatunnel.common.constants.PluginType;
import org.apache.seatunnel.common.utils.SerializationUtils;
import org.apache.seatunnel.core.starter.enums.EngineType;
import org.apache.seatunnel.core.starter.execution.SourceTableInfo;
import org.apache.seatunnel.plugin.discovery.seatunnel.SeaTunnelSourcePluginDiscovery;
import org.apache.seatunnel.translation.spark.execution.DatasetTableInfo;
Expand All @@ -56,7 +58,6 @@

@SuppressWarnings("rawtypes")
public class SourceExecuteProcessor extends SparkAbstractPluginExecuteProcessor<SourceTableInfo> {
private static final String PLUGIN_TYPE = "source";
private Map envOption = new HashMap<String, String>();

public SourceExecuteProcessor(
Expand Down Expand Up @@ -124,7 +125,9 @@ protected List<SourceTableInfo> initializePlugins(List<? extends Config> pluginC
for (Config sourceConfig : pluginConfigs) {
PluginIdentifier pluginIdentifier =
PluginIdentifier.of(
ENGINE_TYPE, PLUGIN_TYPE, sourceConfig.getString(PLUGIN_NAME.key()));
EngineType.SEATUNNEL.getEngine(),
PluginType.SOURCE.getType(),
sourceConfig.getString(PLUGIN_NAME.key()));
jars.addAll(
sourcePluginDiscovery.getPluginJarPaths(Lists.newArrayList(pluginIdentifier)));
Tuple2<SeaTunnelSource<Object, SourceSplit, Serializable>, List<CatalogTable>> source =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public abstract class SparkAbstractPluginExecuteProcessor<T>
protected final List<? extends Config> pluginConfigs;
protected final JobContext jobContext;
protected final List<T> plugins;
protected static final String ENGINE_TYPE = "seatunnel";
protected final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();

protected SparkAbstractPluginExecuteProcessor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.seatunnel.common.Constants;
import org.apache.seatunnel.common.config.CheckResult;
import org.apache.seatunnel.common.constants.JobMode;
import org.apache.seatunnel.core.starter.enums.PluginType;
import org.apache.seatunnel.common.constants.PluginType;
import org.apache.seatunnel.core.starter.execution.RuntimeEnvironment;

import org.apache.spark.SparkConf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import org.apache.seatunnel.api.transform.SeaTunnelFlatMapTransform;
import org.apache.seatunnel.api.transform.SeaTunnelMapTransform;
import org.apache.seatunnel.api.transform.SeaTunnelTransform;
import org.apache.seatunnel.common.constants.PluginType;
import org.apache.seatunnel.core.starter.enums.EngineType;
import org.apache.seatunnel.core.starter.exception.TaskExecuteException;
import org.apache.seatunnel.plugin.discovery.seatunnel.SeaTunnelTransformPluginDiscovery;
import org.apache.seatunnel.translation.spark.execution.DatasetTableInfo;
Expand Down Expand Up @@ -85,8 +87,9 @@ protected List<TableTransformFactory> initializePlugins(List<? extends Config> p
transformPluginDiscovery.getPluginJarPaths(
Lists.newArrayList(
PluginIdentifier.of(
ENGINE_TYPE,
"transform",
EngineType.SEATUNNEL
.getEngine(),
PluginType.TRANSFORM.getType(),
transformConfig.getString(
PLUGIN_NAME.key())))));
return discoverOptionalFactory(
Expand Down

0 comments on commit 2bb258f

Please sign in to comment.