refactor: delete EtcdRefresherHandler redundant comments (#1554)

* refactor: delete EtcdRefresherHandler redundant comments

* refactor: refactor JsonConfigParser import classes
pull/1556/head
song 5 months ago committed by GitHub
parent 5ebe215f5f
commit 832fd4c21e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -23,7 +23,12 @@ import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.Map;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/** /**
* Json config parser. * Json config parser.

@ -17,7 +17,6 @@
package cn.hippo4j.config.springboot.starter.refresher; package cn.hippo4j.config.springboot.starter.refresher;
import cn.hippo4j.common.toolkit.JSONUtil;
import cn.hippo4j.common.toolkit.StringUtil; import cn.hippo4j.common.toolkit.StringUtil;
import cn.hippo4j.threadpool.dynamic.mode.config.properties.BootstrapConfigProperties; import cn.hippo4j.threadpool.dynamic.mode.config.properties.BootstrapConfigProperties;
import io.etcd.jetcd.ByteSequence; import io.etcd.jetcd.ByteSequence;
@ -65,7 +64,6 @@ public class EtcdRefresherHandler extends AbstractConfigThreadPoolDynamicRefresh
String key = etcd.get(KEY); String key = etcd.get(KEY);
Charset charset = StringUtil.isBlank(etcd.get(CHARSET)) ? StandardCharsets.UTF_8 : Charset.forName(etcd.get(CHARSET)); Charset charset = StringUtil.isBlank(etcd.get(CHARSET)) ? StandardCharsets.UTF_8 : Charset.forName(etcd.get(CHARSET));
initClient(etcd, charset); initClient(etcd, charset);
// TODO Currently only supports json
GetResponse getResponse = client.getKVClient().get(ByteSequence.from(key, charset)).get(); GetResponse getResponse = client.getKVClient().get(ByteSequence.from(key, charset)).get();
KeyValue keyValue = getResponse.getKvs().get(0); KeyValue keyValue = getResponse.getKvs().get(0);
if (Objects.isNull(keyValue)) { if (Objects.isNull(keyValue)) {
@ -103,7 +101,6 @@ public class EtcdRefresherHandler extends AbstractConfigThreadPoolDynamicRefresh
* @param charset charset * @param charset charset
*/ */
private void initClient(Map<String, String> etcd, Charset charset) { private void initClient(Map<String, String> etcd, Charset charset) {
// TODO
if (Objects.isNull(client)) { if (Objects.isNull(client)) {
String user = etcd.get(USER); String user = etcd.get(USER);
String password = etcd.get(PASSWORD); String password = etcd.get(PASSWORD);

Loading…
Cancel
Save