diff --git a/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/SeatunnelExecutorService.java b/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/SeatunnelExecutorService.java index d6bdcff6..b4a7ce74 100644 --- a/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/SeatunnelExecutorService.java +++ b/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/SeatunnelExecutorService.java @@ -29,8 +29,6 @@ import java.util.Collections; import java.util.Map; import java.util.Properties; -import static java.util.Objects.requireNonNull; - @SuppressFBWarnings(value = {"RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"}) @Slf4j public class SeatunnelExecutorService @@ -99,9 +97,14 @@ public class SeatunnelExecutorService jsonGenerator.writeFieldName(type); if (ObjectUtils.isNotEmpty(configure)) { String protocol = configure.getType(); - if (requireNonNull(configure.getProtocol()).equalsIgnoreCase("jdbc")) { + + try { + ConnectorType.valueOf(protocol); + } + catch (IllegalArgumentException e) { protocol = "Jdbc"; } + Connector factory = ConnectorFactory.createFormatter(ConnectorType.valueOf(protocol), configure); for (Map.Entry entry : factory.formatToMap().entrySet()) { jsonGenerator.writeStartObject(); diff --git a/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/connector/Connector.java b/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/connector/Connector.java index e8af48a4..ed3b22d4 100644 --- a/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/connector/Connector.java +++ b/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/connector/Connector.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.edurt.datacap.executor.configure.ExecutorConfigure; +import io.edurt.datacap.spi.model.Configure; import java.util.Map; import java.util.Properties; @@ -54,4 +55,9 @@ public abstract class Connector } return properties; } + + protected Properties formatToProperties(Configure originalConfigure) + { + return new Properties(); + } } diff --git a/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/connector/ConnectorJdbc.java b/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/connector/ConnectorJdbc.java index 63d14afe..fec9fc68 100644 --- a/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/connector/ConnectorJdbc.java +++ b/executor/datacap-executor-seatunnel/src/main/java/io/edurt/datacap/executor/seatunnel/connector/ConnectorJdbc.java @@ -2,8 +2,10 @@ package io.edurt.datacap.executor.seatunnel.connector; import com.google.common.collect.Maps; import io.edurt.datacap.executor.configure.ExecutorConfigure; +import io.edurt.datacap.spi.model.Configure; import java.util.Map; +import java.util.Properties; public class ConnectorJdbc extends Connector @@ -13,6 +15,13 @@ public class ConnectorJdbc super(type, configure, configure.getSupportOptions()); } + @Override + protected Properties formatToProperties(Configure originalConfigure) + { + Properties properties = new Properties(); + return properties; + } + @Override public Map formatToMap() {