cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject [18/50] [abbrv] git commit: refs/heads/cisco-vnmc-api-integration - Revert "Fix fresh db install problem. (still pending one part of finding db"
Date Wed, 13 Mar 2013 06:25:05 GMT
Revert "Fix fresh db install problem. (still pending one part of finding db"

This reverts commit 5b760f903f1a3145f62d05c1d3c142b710248026.


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

Branch: refs/heads/cisco-vnmc-api-integration
Commit: ebcf6b1b7cd5175ee826bdfb1443d96fd0a2f9b8
Parents: 5b760f9
Author: Min Chen <min.chen@citrix.com>
Authored: Fri Feb 22 21:38:15 2013 -0800
Committer: Min Chen <min.chen@citrix.com>
Committed: Fri Feb 22 21:38:15 2013 -0800

----------------------------------------------------------------------
 server/src/com/cloud/upgrade/DatabaseCreator.java  |   16 +-------------
 .../com/cloud/upgrade/DatabaseUpgradeChecker.java  |   10 ++++----
 .../src/com/cloud/upgrade/dao/VersionDaoImpl.java  |    2 +-
 3 files changed, 8 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ebcf6b1b/server/src/com/cloud/upgrade/DatabaseCreator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/DatabaseCreator.java b/server/src/com/cloud/upgrade/DatabaseCreator.java
index 9841fae..4d70634 100755
--- a/server/src/com/cloud/upgrade/DatabaseCreator.java
+++ b/server/src/com/cloud/upgrade/DatabaseCreator.java
@@ -29,7 +29,6 @@ import java.util.Properties;
 
 import com.cloud.utils.PropertiesUtil;
 
-import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.component.SystemIntegrityChecker;
 import com.cloud.utils.db.ScriptRunner;
 import com.cloud.utils.db.Transaction;
@@ -193,8 +192,6 @@ public class DatabaseCreator {
             }
         }
 
-        Transaction txn = Transaction.open(Transaction.CLOUD_DB);
-        try {
         // Process db upgrade classes
         for (String upgradeClass: upgradeClasses) {
             System.out.println("========> Processing upgrade: " + upgradeClass);
@@ -205,22 +202,13 @@ public class DatabaseCreator {
                     System.err.println("The class must be of SystemIntegrityChecker: " +
clazz.getName());
                     System.exit(1);
                 }
-                SystemIntegrityChecker checker = (SystemIntegrityChecker)clazz.newInstance();
-                checker.check();
             } catch (ClassNotFoundException e) {
                 System.err.println("Unable to find " + upgradeClass + ": " + e.getMessage());
                 System.exit(1);
-            } catch (InstantiationException e) {
-                System.err.println("Unable to instantiate " + upgradeClass + ": " + e.getMessage());
-                System.exit(1);
-            } catch (IllegalAccessException e) {
-                System.err.println("Unable to access " + upgradeClass + ": " + e.getMessage());
-                System.exit(1);
             }
 
-         }
-        } finally {
-            txn.close();
+            //SystemIntegrityChecker checker = (SystemIntegrityChecker)ComponentLocator.inject(clazz);
+            //checker.check();
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ebcf6b1b/server/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/DatabaseUpgradeChecker.java b/server/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
index 5bd749f..00b4b04 100755
--- a/server/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/server/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -31,6 +31,7 @@ import java.util.List;
 import java.util.TreeMap;
 
 import javax.ejb.Local;
+import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
 
@@ -76,10 +77,9 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
 
     protected HashMap<String, DbUpgrade[]> _upgradeMap = new HashMap<String, DbUpgrade[]>();
 
-    VersionDao _dao;
+    @Inject VersionDao _dao;
 
     public DatabaseUpgradeChecker() {
-        _dao = new VersionDaoImpl();
         _upgradeMap.put("2.1.7", new DbUpgrade[] { new Upgrade217to218(), new Upgrade218to22(),
new Upgrade221to222(),
                 new UpgradeSnapshot217to224(), new Upgrade222to224(), new Upgrade224to225(),
new Upgrade225to226(),
                 new Upgrade227to228(), new Upgrade228to229(), new Upgrade229to2210(), new
Upgrade2210to2211(),
@@ -115,12 +115,12 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
 
         _upgradeMap.put("2.2.4", new DbUpgrade[] { new Upgrade224to225(), new Upgrade225to226(),
new Upgrade227to228(),
                 new Upgrade228to229(), new Upgrade229to2210(), new Upgrade2210to2211(), new
Upgrade2211to2212(),
-                new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(),
new Upgrade30to301(),
+                new Upgrade2212to2213(), new Upgrade2213to2214(), new Upgrade2214to30(),
new Upgrade30to301(), 
                 new Upgrade301to302(), new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420()
});
 
         _upgradeMap.put("2.2.5", new DbUpgrade[] { new Upgrade225to226(), new Upgrade227to228(),
new Upgrade228to229(),
                 new Upgrade229to2210(), new Upgrade2210to2211(), new Upgrade2211to2212(),
new Upgrade2212to2213(),
-                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(),
+                new Upgrade2213to2214(), new Upgrade2214to30(), new Upgrade30to301(), new
Upgrade301to302(), 
                 new Upgrade302to40(), new Upgrade40to41(), new Upgrade410to420() });
 
         _upgradeMap.put("2.2.6", new DbUpgrade[] { new Upgrade227to228(), new Upgrade228to229(),
new Upgrade229to2210(),
@@ -159,7 +159,7 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker
{
         _upgradeMap.put("3.0.1", new DbUpgrade[] { new Upgrade301to302(), new Upgrade302to40(),
new Upgrade40to41(), new Upgrade410to420() });
 
         _upgradeMap.put("3.0.2", new DbUpgrade[] { new Upgrade302to40(), new Upgrade40to41(),
new Upgrade410to420() });
-
+        
         _upgradeMap.put("4.0.0", new DbUpgrade[] { new Upgrade40to41(), new Upgrade410to420()
});
 
         _upgradeMap.put("4.1.0", new DbUpgrade[] { new Upgrade410to420() });

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ebcf6b1b/server/src/com/cloud/upgrade/dao/VersionDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/upgrade/dao/VersionDaoImpl.java b/server/src/com/cloud/upgrade/dao/VersionDaoImpl.java
index 7c5c9cc..5e6e7bc 100644
--- a/server/src/com/cloud/upgrade/dao/VersionDaoImpl.java
+++ b/server/src/com/cloud/upgrade/dao/VersionDaoImpl.java
@@ -47,7 +47,7 @@ public class VersionDaoImpl extends GenericDaoBase<VersionVO, Long>
implements V
     final GenericSearchBuilder<VersionVO, String> CurrentVersionSearch;
     final SearchBuilder<VersionVO> AllFieldsSearch;
 
-    public VersionDaoImpl() {
+    protected VersionDaoImpl() {
         super();
 
         CurrentVersionSearch = createSearchBuilder(String.class);


Mime
View raw message