From ad275e7a36bc54a14e379c55e37bcbe44c48c3cc Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 12 Sep 2024 17:21:00 +0530 Subject: [PATCH] remove dead code Signed-off-by: Abhishek Kumar --- .../agent/lb/IndirectAgentLBServiceImpl.java | 60 ------------------- 1 file changed, 60 deletions(-) diff --git a/server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java b/server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java index b1ed6317641..b6e7d81ffa4 100644 --- a/server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java +++ b/server/src/main/java/org/apache/cloudstack/agent/lb/IndirectAgentLBServiceImpl.java @@ -41,12 +41,9 @@ import com.cloud.dc.DataCenterVO; import com.cloud.dc.dao.ClusterDao; import com.cloud.dc.dao.DataCenterDao; import com.cloud.host.Host; -import com.cloud.host.HostVO; import com.cloud.host.dao.HostDao; import com.cloud.resource.ResourceState; import com.cloud.utils.component.ComponentLifecycleBase; -import com.cloud.utils.db.GenericSearchBuilder; -import com.cloud.utils.db.SearchCriteria; import com.cloud.utils.exception.CloudRuntimeException; public class IndirectAgentLBServiceImpl extends ComponentLifecycleBase implements IndirectAgentLB, Configurable { @@ -135,63 +132,6 @@ public class IndirectAgentLBServiceImpl extends ComponentLifecycleBase implement return hostIdList; } -// private List getAllAgentBasedHosts() { -// final List allHosts = hostDao.listAll(); -// if (allHosts == null) { -// return new ArrayList<>(); -// } -// final List agentBasedHosts = new ArrayList<>(); -// for (final Host host : allHosts) { -// conditionallyAddHost(agentBasedHosts, host); -// } -// return agentBasedHosts; -// } -// -// private void conditionallyAddHost(List agentBasedHosts, Host host) { -// if (host == null) { -// if (LOG.isTraceEnabled()) { -// LOG.trace("trying to add no host to a list"); -// } -// return; -// } -// -// EnumSet allowedStates = EnumSet.of( -// ResourceState.Enabled, -// ResourceState.Maintenance, -// ResourceState.Disabled, -// ResourceState.ErrorInMaintenance, -// ResourceState.PrepareForMaintenance); -// // so the remaining EnumSet disallowedStates = EnumSet.complementOf(allowedStates) -// // would be {ResourceState.Creating, ResourceState.Error}; -// if (!allowedStates.contains(host.getResourceState())) { -// if (LOG.isTraceEnabled()) { -// LOG.trace(String.format("host is in '%s' state, not adding to the host list, (id = %s)", host.getResourceState(), host.getUuid())); -// } -// return; -// } -// -// if (host.getType() != Host.Type.Routing -// && host.getType() != Host.Type.ConsoleProxy -// && host.getType() != Host.Type.SecondaryStorage -// && host.getType() != Host.Type.SecondaryStorageVM) { -// if (LOG.isTraceEnabled()) { -// LOG.trace(String.format("host is of wrong type, not adding to the host list, (id = %s, type = %s)", host.getUuid(), host.getType())); -// } -// return; -// } -// -// if (host.getHypervisorType() != null -// && ! (host.getHypervisorType() == Hypervisor.HypervisorType.KVM || host.getHypervisorType() == Hypervisor.HypervisorType.LXC)) { -// -// if (LOG.isTraceEnabled()) { -// LOG.trace(String.format("hypervisor is not the right type, not adding to the host list, (id = %s, hypervisortype = %s)", host.getUuid(), host.getHypervisorType())); -// } -// return; -// } -// -// agentBasedHosts.add(host); -// } - private List getAllAgentBasedHostsFromDB(final Long zoneId, final Long clusterId) { return hostDao.findHostIdsByZoneClusterResourceStateAndType(zoneId, clusterId, List.of(ResourceState.Enabled, ResourceState.Maintenance, ResourceState.Disabled,