You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2012/09/05 00:12:51 UTC

[17/50] [abbrv] git commit: CS-16158 : Load Test - Adding host takes much longer in 3.0.x compared to 2.2.14.

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/4.0
Commit: 3d0069bb56159a56f9f8e4917fc9faeeae2ba000
Parents: 856958a
Author: Prachi Damle <pr...@cloud.com>
Authored: Tue Aug 28 19:44:00 2012 -0700
Committer: Prachi Damle <pr...@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) {