diff --git a/seatunnel-connectors-v2/connector-hw-elasticsearch/pom.xml b/seatunnel-connectors-v2/connector-hw-elasticsearch/pom.xml index e0e9f0538e7..7dae2793ab8 100644 --- a/seatunnel-connectors-v2/connector-hw-elasticsearch/pom.xml +++ b/seatunnel-connectors-v2/connector-hw-elasticsearch/pom.xml @@ -30,7 +30,6 @@ SeaTunnel : Connectors V2 : hw-Elasticsearch - 7.5.1 31.1-jre diff --git a/seatunnel-connectors-v2/connector-hw-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/hw/config/HwEsAuthConfig.java b/seatunnel-connectors-v2/connector-hw-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/hw/config/HwEsAuthConfig.java index 4daac0add3e..c09102b5853 100644 --- a/seatunnel-connectors-v2/connector-hw-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/hw/config/HwEsAuthConfig.java +++ b/seatunnel-connectors-v2/connector-hw-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/hw/config/HwEsAuthConfig.java @@ -9,17 +9,17 @@ * @date 2023/12/8 */ public class HwEsAuthConfig { - private final int connectTimeout; - private final int socketTimeout; - private final int connectionRequestTimeout; - private final int maxConnPerRoute; - private final int maxConnTotal; - private final String isSecureMode; - private final String principal; - private final String snifferEnable; - private final String customJaasPath; - private final String krb5Path; - private final String keytab; + private int connectTimeout; + private int socketTimeout; + private int connectionRequestTimeout; + private int maxConnPerRoute; + private int maxConnTotal; + private String isSecureMode; + private String principal; + private String snifferEnable; + private String customJaasPath; + private String krb5Path; + private String keytab; private static final String CONNECT_TIMEOUT = "connectTimeout"; private static final String SOCKET_TIMOUT = "socketTimeout"; @@ -34,17 +34,39 @@ public class HwEsAuthConfig { private static final String KEYTAB = "keytab"; public HwEsAuthConfig(Config config) { - this.connectTimeout = config.getInt(CONNECT_TIMEOUT); - this.socketTimeout = config.getInt(SOCKET_TIMOUT); - this.connectionRequestTimeout = config.getInt(CONNECTION_REQUEST_TIMOUT); - this.maxConnPerRoute = config.getInt(MAX_CONN_PER_ROUTE); - this.maxConnTotal = config.getInt(MAX_CONN_TOTAL); - this.isSecureMode = config.getString(IS_SECURE_MODE); - this.principal = config.getString(PRINCIPAL); - this.snifferEnable = config.getString(SNIFFER_ENABLE); - this.customJaasPath = config.getString(CUSTOM_JASS_PATH); - this.krb5Path = config.getString(KRB5_PATH); - this.keytab = config.getString(KEYTAB); + if (config.hasPath(CONNECT_TIMEOUT)) { + this.connectTimeout = config.getInt(CONNECT_TIMEOUT); + } + if (config.hasPath(SOCKET_TIMOUT)) { + this.socketTimeout = config.getInt(SOCKET_TIMOUT); + } + if (config.hasPath(CONNECTION_REQUEST_TIMOUT)) { + this.connectionRequestTimeout = config.getInt(CONNECTION_REQUEST_TIMOUT); + } + if (config.hasPath(MAX_CONN_PER_ROUTE)) { + this.maxConnPerRoute = config.getInt(MAX_CONN_PER_ROUTE); + } + if (config.hasPath(MAX_CONN_TOTAL)) { + this.maxConnTotal = config.getInt(MAX_CONN_TOTAL); + } + if (config.hasPath(IS_SECURE_MODE)) { + this.isSecureMode = config.getString(IS_SECURE_MODE); + } + if (config.hasPath(PRINCIPAL)) { + this.principal = config.getString(PRINCIPAL); + } + if (config.hasPath(SNIFFER_ENABLE)) { + this.snifferEnable = config.getString(SNIFFER_ENABLE); + } + if (config.hasPath(CUSTOM_JASS_PATH)) { + this.customJaasPath = config.getString(CUSTOM_JASS_PATH); + } + if (config.hasPath(KRB5_PATH)) { + this.krb5Path = config.getString(KRB5_PATH); + } + if (config.hasPath(KEYTAB)) { + this.keytab = config.getString(KEYTAB); + } } public int getConnectTimeout() { diff --git a/seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/utils/ConfigBuilder.java b/seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/utils/ConfigBuilder.java index 0859690febb..8d3dc3264f7 100644 --- a/seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/utils/ConfigBuilder.java +++ b/seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/utils/ConfigBuilder.java @@ -84,7 +84,7 @@ public static Config of(@NonNull Map objectMap, boolean isEncryp if (!isEncrypt) { config = ConfigShadeUtils.decryptConfig(config); } - log.info("Parsed config file: \n{}", config.root().render(CONFIG_RENDER_OPTIONS)); + // log.info("Parsed config file: \n{}", config.root().render(CONFIG_RENDER_OPTIONS)); return config; } diff --git a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpPostCommandProcessor.java b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpPostCommandProcessor.java index 02158bbf342..12e3e585a29 100644 --- a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpPostCommandProcessor.java +++ b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpPostCommandProcessor.java @@ -99,7 +99,7 @@ private void handleSubmitJob(HttpPostCommand httpPostCommand, String uri) throws IllegalArgumentException { Map requestParams = new HashMap<>(); RestUtil.buildRequestParams(requestParams, uri); - Config config = RestUtil.buildConfig(requestHandle(httpPostCommand), false); + Config config = RestUtil.buildConfig(requestHandle(httpPostCommand), true); JobConfig jobConfig = new JobConfig(); jobConfig.setName(requestParams.get(RestConstant.JOB_NAME));