From 62b373324dec7acce535c71e116bbe3a661447d4 Mon Sep 17 00:00:00 2001 From: bayuzhen Date: Thu, 30 May 2024 15:00:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=A4=A7=E5=B1=8F=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E8=B5=84=E6=BA=90=E4=BD=BF=E7=94=A8=E6=83=85=E5=86=B5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bocloud/cos/service/ResourceScreenServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bocloud.cos.service/src/main/java/com/bocloud/cos/service/ResourceScreenServiceImpl.java b/bocloud.cos.service/src/main/java/com/bocloud/cos/service/ResourceScreenServiceImpl.java index 470687e..67897b2 100644 --- a/bocloud.cos.service/src/main/java/com/bocloud/cos/service/ResourceScreenServiceImpl.java +++ b/bocloud.cos.service/src/main/java/com/bocloud/cos/service/ResourceScreenServiceImpl.java @@ -105,7 +105,10 @@ public class ResourceScreenServiceImpl implements ResourceScreenService { long cpuTotal = 0L; Long memTotal = 0L; int diskTotal = 0; - List hosts = imsInternalService.listHosts(); + List hostAll = imsInternalService.listHosts(); + List hosts = hostAll.stream().filter( + server -> null != server.getVendorType() && vendors.contains(server.getVendorType())) + .collect(Collectors.toList()); hosts.removeIf(server -> null == server.getVendorId()); Map> hostMap = hosts.stream().filter(server -> null != server.getVendorId()) .collect(Collectors.groupingBy(Server::getVendorId));