incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prachida...@apache.org
Subject [2/2] git commit: CS-16158 : Load Test - Adding host takes much longer in 3.0.x compared to 2.2.14.
Date Fri, 31 Aug 2012 20:40:37 GMT
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.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/3d0069bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/3d0069bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/3d0069bb

Branch: refs/heads/master
Commit: 3d0069bb56159a56f9f8e4917fc9faeeae2ba000
Parents: 856958a
Author: Prachi Damle <prachi@cloud.com>
Authored: Tue Aug 28 19:44:00 2012 -0700
Committer: Prachi Damle <prachi@cloud.com>
Committed: Fri Aug 31 13:40:17 2012 -0700

----------------------------------------------------------------------
 .../src/com/cloud/storage/StorageManagerImpl.java  |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3d0069bb/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 9d4ba0c..50a78db 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -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) {


Mime
View raw message