bug 8806: improvements to the flow; using group by to eliminate need for extra ds

This commit is contained in:
abhishek 2011-03-02 10:07:31 -08:00
parent 68aa8c4eb7
commit f0a74e6314
2 changed files with 4 additions and 8 deletions

View File

@ -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();

View File

@ -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;