cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [5/6] git commit: updated refs/heads/simulatorStorageFixes to a6bb56b
Date Thu, 27 Jun 2013 15:05:07 GMT
Don't report back resource state to ResourceManagerImpl

on adding sec. storage no need to report back to resourceManager since
the sc. storage is no longer a directly connected host.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>


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

Branch: refs/heads/simulatorStorageFixes
Commit: 373dd2b8b9db50c4c5b63ed9ddf419f1296977c1
Parents: 2488694
Author: Prasanna Santhanam <tsp@apache.org>
Authored: Wed Jun 26 19:03:24 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Thu Jun 27 20:34:26 2013 +0530

----------------------------------------------------------------------
 .../agent/manager/MockAgentManagerImpl.java     | 42 ++++++++------------
 .../agent/manager/MockStorageManagerImpl.java   |  6 +--
 2 files changed, 18 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/373dd2b8/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
index 8542de3..69efc83 100755
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockAgentManagerImpl.java
@@ -16,24 +16,6 @@
 // under the License.
 package com.cloud.agent.manager;
 
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.regex.PatternSyntaxException;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.log4j.Logger;
-
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CheckHealthCommand;
@@ -45,7 +27,6 @@ import com.cloud.agent.api.HostStatsEntry;
 import com.cloud.agent.api.MaintainAnswer;
 import com.cloud.agent.api.PingTestCommand;
 import com.cloud.dc.dao.HostPodDao;
-import com.cloud.host.Host;
 import com.cloud.resource.AgentResourceBase;
 import com.cloud.resource.AgentRoutingResource;
 import com.cloud.resource.AgentStorageResource;
@@ -62,8 +43,24 @@ import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.net.NetUtils;
+import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.PatternSyntaxException;
+
 @Component
 @Local(value = { MockAgentManager.class })
 public class MockAgentManagerImpl extends ManagerBase implements MockAgentManager {
@@ -195,9 +192,6 @@ public class MockAgentManagerImpl extends ManagerBase implements MockAgentManage
             random = SecureRandom.getInstance("SHA1PRNG");
             _executor = new ThreadPoolExecutor(1, 5, 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(),
                     new NamedThreadFactory("Simulator-Agent-Mgr"));
-            // ComponentLocator locator = ComponentLocator.getCurrentLocator();
-            // _simulatorMgr = (SimulatorManager)
-            // locator.getComponent(SimulatorManager.Name);
         } catch (NoSuchAlgorithmException e) {
             s_logger.debug("Failed to initialize random:" + e.toString());
             return false;
@@ -330,10 +324,6 @@ public class MockAgentManagerImpl extends ManagerBase implements MockAgentManage
                     details.put("guid", this.guid);
                     storageResource.configure("secondaryStorage", params);
                     storageResource.start();
-                    // on the simulator the ssvm is as good as a direct
-                    // agent
-                    _resourceMgr.addHost(mockHost.getDataCenterId(), storageResource, Host.Type.SecondaryStorageVM,
-                            details);
                     _resources.put(this.guid, storageResource);
                 } catch (ConfigurationException e) {
                     s_logger.debug("Failed to load secondary storage resource: " + e.toString());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/373dd2b8/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
index 41c56a6..870dd8e 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
@@ -889,13 +889,12 @@ public class MockStorageManagerImpl extends ManagerBase implements MockStorageMa
     @Override
     public void preinstallTemplates(String url, long zoneId) {
         MockSecStorageVO storage = null;
-        Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
         try {
             storage = _mockSecStorageDao.findByUrl(url);
         } catch (Exception ex) {
             throw new CloudRuntimeException("Unable to find sec storage at " + url, ex);
         } finally {
-            txn = Transaction.open(Transaction.CLOUD_DB);
+            Transaction txn = Transaction.open(Transaction.CLOUD_DB);
             txn.close();
         }
         if (storage == null) {
@@ -916,7 +915,7 @@ public class MockStorageManagerImpl extends ManagerBase implements MockStorageMa
             storage.setCapacity(DEFAULT_HOST_STORAGE_SIZE);
 
             storage.setMountPoint(dir);
-            txn = Transaction.open(Transaction.SIMULATOR_DB);
+            Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
             try {
                 txn.start();
                 storage = _mockSecStorageDao.persist(storage);
@@ -974,7 +973,6 @@ public class MockStorageManagerImpl extends ManagerBase implements MockStorageMa
                 txn.close();
             }
         }
-
     }
 
     @Override


Mime
View raw message