Skip to content

Commit

Permalink
fix(clickhouse): 取掉配置文件打印,修改华为云es连接报错
Browse files Browse the repository at this point in the history
  • Loading branch information
chaorongzhi committed Jan 9, 2024
1 parent cc8a83b commit fb35c27
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 25 deletions.
1 change: 0 additions & 1 deletion seatunnel-connectors-v2/connector-hw-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<name>SeaTunnel : Connectors V2 : hw-Elasticsearch</name>

<properties>
<elasticsearch-rest-client.version>7.5.1</elasticsearch-rest-client.version>
<guava.version>31.1-jre</guava.version>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static Config of(@NonNull Map<String, Object> 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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private void handleSubmitJob(HttpPostCommand httpPostCommand, String uri)
throws IllegalArgumentException {
Map<String, String> 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));

Expand Down

0 comments on commit fb35c27

Please sign in to comment.