shwstppr commented on code in PR #8362:
URL: https://github.com/apache/cloudstack/pull/8362#discussion_r1489995602
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -2414,25 +2415,24 @@ public CapacityVO getSecondaryStorageUsedStats(Long
hostId, Long zoneId) {
return capacity;
}
- @Override
- public CapacityVO getStoragePoolUsedStats(Long poolId, Long clusterId,
Long podId, Long zoneId) {
+ private CapacityVO getStoragePoolUsedStatsInternal(Long zoneId, Long
podId, Long clusterId, List<Long> poolIds, Long poolId) {
SearchCriteria<StoragePoolVO> sc =
_storagePoolDao.createSearchCriteria();
- List<StoragePoolVO> pools = new ArrayList<StoragePoolVO>();
+ List<StoragePoolVO> pools = new ArrayList<>();
if (zoneId != null) {
sc.addAnd("dataCenterId", SearchCriteria.Op.EQ, zoneId);
}
-
if (podId != null) {
sc.addAnd("podId", SearchCriteria.Op.EQ, podId);
}
-
if (clusterId != null) {
sc.addAnd("clusterId", SearchCriteria.Op.EQ, clusterId);
}
-
+ if (CollectionUtils.isNotEmpty(poolIds)) {
+ sc.addAnd("id", SearchCriteria.Op.IN, poolIds.toArray());
+ }
if (poolId != null) {
- sc.addAnd("hostOrPoolId", SearchCriteria.Op.EQ, poolId);
+ sc.addAnd("id", SearchCriteria.Op.EQ, poolId);
Review Comment:
Not directly but this was causing an issue with listCapacity API.
SearchCriteria here is directly created from dao and there is no `hostOrPoolId`
member in `StoragePoolVO` class
--
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]