DaanHoogland commented on code in PR #8321:
URL: https://github.com/apache/cloudstack/pull/8321#discussion_r1425068951
##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -3973,50 +3981,49 @@ private Pair<List<Long>, Integer>
searchForServiceOfferingIdsAndCount(ListServic
}
if (vmTypeStr != null) {
- sc.setParameters("vmType", vmTypeStr);
+ sc.setParameters("svmType", vmTypeStr);
}
useStorageType(sc, storageType);
if (zoneId != null) {
- sc.setJoinParameters("ZoneDetailSearch", "name", "zoneid");
- sc.setJoinParameters("ZoneDetailSearch", "value", zoneId);
+ sc.setJoinParameters("ZoneDetailSearch", "zoneId", zoneId);
if (DataCenter.Type.Edge.equals(zone.getType())) {
sc.setJoinParameters("diskOfferingSearch", "useLocalStorage",
true);
}
}
if (cpuNumber != null) {
- sc.setJoinParameters("maxComputeDetailsSearch", "name",
"maxcpunumber");
- sc.setJoinParameters("minComputeDetailsSearch", "name",
"mincpunumber");
- sc.setParameters("cpuConstraintEQ", cpuNumber);
- sc.setParameters("cpuConstraintMinComputeLTEQ", cpuNumber);
- sc.setParameters("cpuConstraintMaxComputeGTEQ", cpuNumber);
+ /*
+ and("cpuConstraintMinComputeGTEQ", entity().getCpu(),
Op.GTEQ).cp();
+ or("cpuConstraintGTEQ", entity().getCpu(), Op.GTEQ);
+
+ or().op().op();
+
+ and("cpuConstraintMinComputeLTEQ", entity().getCpu(),
Op.LTEQ).cp();
+ or("minComputeDetailsSearch", "cpuConstraintMinComputeLTEQ",
minComputeDetailsSearch.entity().getValue(), Op.LTEQ).cp();
+
+ and("cpuConstraintMaxComputeGTEQ", entity().getCpu(),
Op.GTEQ).cp();
+ or("maxComputeDetailsSearch", "cpuConstraintMaxComputeGTEQ",
maxComputeDetailsSearch.entity().getValue(), Op.GTEQ).cp();
+ cp().cp();
+ */
Review Comment:
comment in code. that said, is it maybe time to disect the query manager and
have it constructed of the manager and some join/view objects. It has become
rather big and is shrinking in maintainability.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]