From 832fd4c21eb072bfe680783626a2c8157508372b Mon Sep 17 00:00:00 2001 From: song <58645531+Song246@users.noreply.github.com> Date: Wed, 19 Jun 2024 17:21:09 +0800 Subject: [PATCH] refactor: delete EtcdRefresherHandler redundant comments (#1554) * refactor: delete EtcdRefresherHandler redundant comments * refactor: refactor JsonConfigParser import classes --- .../dynamic/mode/config/parser/JsonConfigParser.java | 7 ++++++- .../springboot/starter/refresher/EtcdRefresherHandler.java | 3 --- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/dynamic/mode/config/src/main/java/cn/hippo4j/threadpool/dynamic/mode/config/parser/JsonConfigParser.java b/kernel/dynamic/mode/config/src/main/java/cn/hippo4j/threadpool/dynamic/mode/config/parser/JsonConfigParser.java index 87fe6ba1..c0acf1d9 100644 --- a/kernel/dynamic/mode/config/src/main/java/cn/hippo4j/threadpool/dynamic/mode/config/parser/JsonConfigParser.java +++ b/kernel/dynamic/mode/config/src/main/java/cn/hippo4j/threadpool/dynamic/mode/config/parser/JsonConfigParser.java @@ -23,7 +23,12 @@ import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; 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. diff --git a/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java b/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java index 26064938..004c1f12 100644 --- a/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java +++ b/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/EtcdRefresherHandler.java @@ -17,7 +17,6 @@ package cn.hippo4j.config.springboot.starter.refresher; -import cn.hippo4j.common.toolkit.JSONUtil; import cn.hippo4j.common.toolkit.StringUtil; import cn.hippo4j.threadpool.dynamic.mode.config.properties.BootstrapConfigProperties; import io.etcd.jetcd.ByteSequence; @@ -65,7 +64,6 @@ public class EtcdRefresherHandler extends AbstractConfigThreadPoolDynamicRefresh String key = etcd.get(KEY); Charset charset = StringUtil.isBlank(etcd.get(CHARSET)) ? StandardCharsets.UTF_8 : Charset.forName(etcd.get(CHARSET)); initClient(etcd, charset); - // TODO Currently only supports json GetResponse getResponse = client.getKVClient().get(ByteSequence.from(key, charset)).get(); KeyValue keyValue = getResponse.getKvs().get(0); if (Objects.isNull(keyValue)) { @@ -103,7 +101,6 @@ public class EtcdRefresherHandler extends AbstractConfigThreadPoolDynamicRefresh * @param charset charset */ private void initClient(Map etcd, Charset charset) { - // TODO if (Objects.isNull(client)) { String user = etcd.get(USER); String password = etcd.get(PASSWORD);