DaanHoogland commented on code in PR #8012:
URL: https://github.com/apache/cloudstack/pull/8012#discussion_r1339683010
##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -1008,21 +1057,79 @@ private Object getObjectPossibleMethodValue(Object obj,
String methodName) {
}
private Pair<List<UserVmJoinVO>, Integer>
searchForUserVMsInternal(ListVMsCmd cmd) {
+ Pair<List<Long>, Integer> vmIdPage = searchForUserVMIdsAndCount(cmd);
+
+ Integer count = vmIdPage.second();
+ Long[] idArray = vmIdPage.first().toArray(new Long[0]);
+
+ if (count == 0) {
+ return new Pair<>(new ArrayList<>(), count);
+ }
+
+ // search vm details by ids
+ List<UserVmJoinVO> vms = _userVmJoinDao.searchByIds( idArray);
+ return new Pair<>(vms, count);
+ }
+
+ private Pair<List<Long>, Integer> searchForUserVMIdsAndCount(ListVMsCmd
cmd) {
Review Comment:
this is a 400 line method and I would like to reduce its complexity a bit,
but given the gain from the change, I'd say 'not now'.
--
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]