Github user mike-tutkowski commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1403#discussion_r63136000
  
    --- Diff: engine/schema/src/com/cloud/dc/dao/ClusterDaoImpl.java ---
    @@ -260,4 +268,41 @@ public boolean remove(Long id) {
             sc.setParameters("dataCenterId", zoneId);
             return customSearch(sc, null);
         }
    +
    +    @Override
    +    public boolean computeWhetherClusterSupportsResigning(long clusterId) {
    +        ClusterVO cluster = findById(clusterId);
    +
    +        if (cluster == null || cluster.getAllocationState() != 
Grouping.AllocationState.Enabled) {
    +            return false;
    +        }
    +
    +        List<HostVO> hosts = hostDao.findByClusterId(clusterId);
    +
    +        if (hosts == null) {
    +            return false;
    +        }
    +
    +        for (HostVO host : hosts) {
    +            if (host == null) {
    +                return false;
    +            }
    +
    +            DetailVO hostDetail = hostDetailsDao.findDetail(host.getId(), 
"supportsResign");
    +
    +            if (hostDetail == null) {
    +                return false;
    +            }
    +
    +            String value = hostDetail.getValue();
    +
    +            Boolean booleanValue = Boolean.valueOf(value);
    +
    +            if (booleanValue == false) {
    +                return false;
    +            }
    +        }
    +
    +        return true;
    +    }
    --- End diff --
    
    Isn't there a limit of like 16 - 32 hosts in a cluster (therefore only 16 - 
32 DB calls in the for loop)?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to