mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CS-16158 : Load Test - Adding host takes much longer in 3.0.x compared to 2.2.14.
Changes: There is an unnecessary search over capacity table that scans entire table.
This commit is contained in:
parent
856958a784
commit
3d0069bb56
@ -2124,14 +2124,11 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag
|
||||
@Override
|
||||
public void createCapacityEntry(StoragePoolVO storagePool, short capacityType, long allocated) {
|
||||
SearchCriteria<CapacityVO> capacitySC = _capacityDao.createSearchCriteria();
|
||||
|
||||
List<CapacityVO> capacities = _capacityDao.search(capacitySC, null);
|
||||
capacitySC = _capacityDao.createSearchCriteria();
|
||||
capacitySC.addAnd("hostOrPoolId", SearchCriteria.Op.EQ, storagePool.getId());
|
||||
capacitySC.addAnd("dataCenterId", SearchCriteria.Op.EQ, storagePool.getDataCenterId());
|
||||
capacitySC.addAnd("capacityType", SearchCriteria.Op.EQ, capacityType);
|
||||
|
||||
capacities = _capacityDao.search(capacitySC, null);
|
||||
List<CapacityVO> capacities = _capacityDao.search(capacitySC, null);
|
||||
|
||||
long totalOverProvCapacity;
|
||||
if (storagePool.getPoolType() == StoragePoolType.NetworkFilesystem) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user