mirror of
https://gitee.com/devlive-community/datacap.git
synced 2024-11-29 10:37:57 +08:00
feat(executor): adapter seatunnel
This commit is contained in:
parent
524178fb01
commit
ee78761a1c
@ -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<String, Object> entry : factory.formatToMap().entrySet()) {
|
||||
jsonGenerator.writeStartObject();
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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<String, Object> formatToMap()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user