mirror of https://github.com/apache/cloudstack.git
bug 8806: improvements to the flow; using group by to eliminate need for extra ds
This commit is contained in:
parent
68aa8c4eb7
commit
f0a74e6314
|
|
@ -68,6 +68,7 @@ public class ClusterDaoImpl extends GenericDaoBase<ClusterVO, Long> implements C
|
|||
|
||||
ZoneSearch = createSearchBuilder();
|
||||
ZoneSearch.and("dataCenterId", ZoneSearch.entity().getDataCenterId(), SearchCriteria.Op.EQ);
|
||||
ZoneSearch.groupBy(ZoneSearch.entity().getHypervisorType());
|
||||
ZoneSearch.done();
|
||||
|
||||
AvailHyperSearch = createSearchBuilder();
|
||||
|
|
|
|||
|
|
@ -4721,16 +4721,11 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
int i = 0;
|
||||
List<ClusterVO> clustersForZone = _clusterDao.listByZoneId(zoneId);
|
||||
if(clustersForZone != null && clustersForZone.size() > 0) {
|
||||
Set<String> result = new HashSet<String>();
|
||||
String[] result = new String[clustersForZone.size()];
|
||||
for(ClusterVO cluster : clustersForZone) {
|
||||
result.add(cluster.getHypervisorType().toString());
|
||||
result[i++] = cluster.getHypervisorType().toString();
|
||||
}
|
||||
|
||||
String[] resultArray = new String[result.size()];
|
||||
for(String entity : result) {
|
||||
resultArray[i++] = entity;
|
||||
}
|
||||
return resultArray;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue