cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [2/2] git commit: updated refs/heads/master to 99c3e4f
Date Thu, 08 Aug 2013 23:17:34 GMT
CLOUDSTACK-4190: Add endpoint selector implementation for ImageCache
data store and also delete object from staging area for volume copy from
primary to secondary or vice versa.


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

Branch: refs/heads/master
Commit: 99c3e4f3f5d278e70882241d95bf1fe87e9110cf
Parents: bf69612
Author: Min Chen <min.chen@citrix.com>
Authored: Thu Aug 8 16:08:31 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Thu Aug 8 16:17:00 2013 -0700

----------------------------------------------------------------------
 .../storage/motion/AncientDataMotionStrategy.java        | 11 ++++++++---
 .../storage/endpoint/DefaultEndPointSelector.java        |  2 +-
 server/src/com/cloud/storage/VolumeManagerImpl.java      |  4 ----
 3 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/99c3e4f3/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
index c6b9b85..dc1b1bf 100644
--- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
@@ -182,7 +182,6 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
         int _primaryStorageDownloadWait = NumbersUtil.parseInt(value,
                 Integer.parseInt(Config.PrimaryStorageDownloadWait.getDefaultValue()));
         Answer answer = null;
-        boolean usingCache = false;
         DataObject cacheData = null;
         DataObject srcForCopy = srcData;
         try {
@@ -196,10 +195,16 @@ public class AncientDataMotionStrategy implements DataMotionStrategy
{
             answer = ep.sendMessage(cmd);
 
             if (cacheData != null) {
-                if (answer == null || !answer.getResult()) {
+                if (srcData.getType() == DataObjectType.VOLUME && destData.getType()
== DataObjectType.VOLUME) {
+                    // volume transfer from primary to secondary or vice versa. Volume transfer
between primary pools are already handled by copyVolumeBetweenPools
                     cacheMgr.deleteCacheObject(srcForCopy);
                 } else {
-                    cacheMgr.releaseCacheObject(srcForCopy);
+                    // for template, we want to leave it on cache for performance reason
+                    if (answer == null || !answer.getResult()) {
+                        cacheMgr.deleteCacheObject(srcForCopy);
+                    } else {
+                        cacheMgr.releaseCacheObject(srcForCopy);
+                    }
                 }
             }
             return answer;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/99c3e4f3/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
index fb04194..d2ddfd4 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
@@ -221,7 +221,7 @@ public class DefaultEndPointSelector implements EndPointSelector {
     public EndPoint select(DataStore store) {
         if (store.getRole() == DataStoreRole.Primary) {
             return findEndpointForPrimaryStorage(store);
-        } else if (store.getRole() == DataStoreRole.Image) {
+        } else if (store.getRole() == DataStoreRole.Image || store.getRole() == DataStoreRole.ImageCache)
{
             // in case there is no ssvm, directly send down command hypervisor
             // host
             // otherwise, send to localhost for bootstrap system vm template

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/99c3e4f3/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java
index 92ad954..5cf7b8d 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -2780,12 +2780,8 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager
{
 
         // Clean up code to remove all those previous uploadVO and uploadMonitor code. Previous
code is trying to fake an async operation purely in
         // db table with uploadVO and async_job entry, but internal implementation is actually
synchronous.
-        StoragePool srcPool = (StoragePool) dataStoreMgr.getPrimaryDataStore(volume.getPoolId());
         ImageStoreEntity secStore = (ImageStoreEntity) dataStoreMgr.getImageStore(zoneId);
-        String secondaryStorageURL = secStore.getUri();
 
-        String value = _configDao.getValue(Config.CopyVolumeWait.toString());
-        int copyvolumewait = NumbersUtil.parseInt(value, Integer.parseInt(Config.CopyVolumeWait.getDefaultValue()));
         // Copy volume from primary to secondary storage
         VolumeInfo srcVol = volFactory.getVolume(volume.getId());
         AsyncCallFuture<VolumeApiResult> cvAnswer = volService.copyVolume(srcVol, secStore);


Mime
View raw message