From e79342acf51a12ee24e11e55dcdbd0bed20a7a04 Mon Sep 17 00:00:00 2001 From: zengqiao Date: Mon, 10 Oct 2022 19:19:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8DDSL=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=AF=BC=E8=87=B4ZK=E6=8C=87=E6=A0=87=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../streaming/km/persistence/es/dsls/DslsConstant.java | 2 +- .../dsl/ZookeeperMetricESDAO/getAggListZookeeperMetrics | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/km-persistence/src/main/java/com/xiaojukeji/know/streaming/km/persistence/es/dsls/DslsConstant.java b/km-persistence/src/main/java/com/xiaojukeji/know/streaming/km/persistence/es/dsls/DslsConstant.java index 94a8698e..f15fe7a8 100644 --- a/km-persistence/src/main/java/com/xiaojukeji/know/streaming/km/persistence/es/dsls/DslsConstant.java +++ b/km-persistence/src/main/java/com/xiaojukeji/know/streaming/km/persistence/es/dsls/DslsConstant.java @@ -81,5 +81,5 @@ public class DslsConstant { public static final String COUNT_GROUP_NOT_METRIC_VALUE = "GroupMetricESDAO/countGroupNotMetricValue"; /**************************************************** Zookeeper ****************************************************/ - public static final String GET_ZOOKEEPER_AGG_LIST_METRICS = "ZookeeperMetricESDAO/getAggListZookeeperMetrics"; + public static final String GET_ZOOKEEPER_AGG_LIST_METRICS = "ZookeeperMetricESDAO/getAggListZookeeperMetrics"; } diff --git a/km-persistence/src/main/resources/dsl/ZookeeperMetricESDAO/getAggListZookeeperMetrics b/km-persistence/src/main/resources/dsl/ZookeeperMetricESDAO/getAggListZookeeperMetrics index c05c221d..c498368b 100644 --- a/km-persistence/src/main/resources/dsl/ZookeeperMetricESDAO/getAggListZookeeperMetrics +++ b/km-persistence/src/main/resources/dsl/ZookeeperMetricESDAO/getAggListZookeeperMetrics @@ -10,13 +10,6 @@ } } }, - { - "term": { - "brokerId": { - "value": %d - } - } - }, { "range": { "timestamp": { From 66dd82f4fdddb619da7f716952934d78188652c1 Mon Sep 17 00:00:00 2001 From: zengqiao Date: Mon, 10 Oct 2022 19:49:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B4=A1=E7=8C=AE?= =?UTF-8?q?=E8=80=85=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/contributer_guide/开发者名单.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/contributer_guide/开发者名单.md b/docs/contributer_guide/开发者名单.md index 704ffc5c..ea147bdc 100644 --- a/docs/contributer_guide/开发者名单.md +++ b/docs/contributer_guide/开发者名单.md @@ -9,9 +9,12 @@ |姓名|Github|角色|发放日期| |--|--|--|--| |张亮 | [@zhangliangboy](https://github.com/zhangliangboy)||| +|赵情融 | [@zqrferrari](https://github.com/zqrferrari)||| |谢鹏|[@PenceXie](https://github.com/PenceXie)||| +|孙超|[@lucasun](https://github.com/lucasun)||| +|许喆 | [@potaaaaaato](https://github.com/potaaaaaato)||| |石臻臻 | [@shirenchuang](https://github.com/shirenchuang)||| -|周宇航|[@GraceWalk](https://github.com/GraceWalk)||| +|郭宇航|[@GraceWalk](https://github.com/GraceWalk)||| |曾巧|[@ZQKC](https://github.com/ZQKC)||| |赵寅锐|[@ZHAOYINRUI](https://github.com/ZHAOYINRUI)||| |王东方|[@wangdongfang-aden](https://github.com/wangdongfang-aden)||| @@ -20,7 +23,7 @@ |Huyueeer|[@Huyueeer](https://github.com/Huyueeer)||| |杨光|[@yaangvipguang](https://github.com/yangvipguang)| |王亚聪|[@wangyacongi](https://github.com/wangyacongi)| -|WYAOBO|[@WYAOBO](https://github.com/WYAOBO) +|王耀波|[@WYAOBO](https://github.com/WYAOBO) | Super .Wein(星痕)| [@superspeedone](https://github.com/superspeedone)||| | Yang Jing| [@yangbajing](https://github.com/yangbajing)||| | 刘新元 Liu XinYuan| [@Liu-XinYuan](https://github.com/Liu-XinYuan)||| @@ -34,8 +37,8 @@ | 谢晓东| [@Strangevy](https://github.com/Strangevy)||| | ZhaoXinlong| [@ZhaoXinlong](https://github.com/ZhaoXinlong)||| |xuehaipeng | [@xuehaipeng](https://github.com/xuehaipeng)||| -|mrazkong | [@mrazkong](https://github.com/mrazkong)||| -|xuzhengxi | [@hyper-xx)](https://github.com/hyper-xx)||| +|孔令续 | [@mrazkong](https://github.com/mrazkong)||| +|徐正熙 | [@hyper-xx)](https://github.com/hyper-xx)||| |pierre xiong | [@pierre94](https://github.com/pierre94)||| From 87cd058fd8b6510ea5680fcb1bae4bbceb64dc27 Mon Sep 17 00:00:00 2001 From: zengqiao Date: Mon, 10 Oct 2022 19:54:47 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Broker=E5=A2=9E=E5=8A=A0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=AD=98=E6=B4=BB=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../km/core/service/broker/BrokerService.java | 4 ++++ .../broker/impl/BrokerServiceImpl.java | 22 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/BrokerService.java b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/BrokerService.java index 62f03e65..c8c300a0 100644 --- a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/BrokerService.java +++ b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/BrokerService.java @@ -67,4 +67,8 @@ public interface BrokerService { * 获取总的Broker数 */ Integer countAllBrokers(); + + boolean allServerDown(Long clusterPhyId); + + boolean existServerDown(Long clusterPhyId); } diff --git a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/impl/BrokerServiceImpl.java b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/impl/BrokerServiceImpl.java index 7fc4f4f2..3fd74ee5 100644 --- a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/impl/BrokerServiceImpl.java +++ b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/impl/BrokerServiceImpl.java @@ -262,14 +262,32 @@ public class BrokerServiceImpl extends BaseVersionControlService implements Brok return version; } - - @Override public Integer countAllBrokers() { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); return brokerDAO.selectCount(lambdaQueryWrapper); } + @Override + public boolean allServerDown(Long clusterPhyId) { + List poList = this.getAllBrokerPOsFromDB(clusterPhyId); + if (ValidateUtils.isEmptyList(poList)) { + return false; + } + + return poList.stream().filter(elem -> elem.getStatus().equals(Constant.DOWN)).count() == poList.size(); + } + + @Override + public boolean existServerDown(Long clusterPhyId) { + List poList = this.getAllBrokerPOsFromDB(clusterPhyId); + if (ValidateUtils.isEmptyList(poList)) { + return false; + } + + return poList.stream().filter(elem -> elem.getStatus().equals(Constant.DOWN)).count() > 0; + } + /**************************************************** private method ****************************************************/ private List listAllBrokersAndUpdateCache(Long clusterPhyId) {