You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2014/01/09 02:57:31 UTC

git commit: updated refs/heads/4.3 to 02f6e02

Updated Branches:
  refs/heads/4.3 1f70154c3 -> 02f6e02a7


CLOUDSTACK-5840:Remove old API method.


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

Branch: refs/heads/4.3
Commit: 02f6e02a73c3abaebb643795f917fff31d4d3279
Parents: 1f70154
Author: Min Chen <mi...@citrix.com>
Authored: Wed Jan 8 17:56:00 2014 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Wed Jan 8 17:57:15 2014 -0800

----------------------------------------------------------------------
 api/src/com/cloud/storage/StorageService.java   | 23 ++++++++++----------
 .../com/cloud/storage/StorageManagerImpl.java   | 22 -------------------
 2 files changed, 11 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/02f6e02a/api/src/com/cloud/storage/StorageService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/StorageService.java b/api/src/com/cloud/storage/StorageService.java
index 4d44045..54e1382 100644
--- a/api/src/com/cloud/storage/StorageService.java
+++ b/api/src/com/cloud/storage/StorageService.java
@@ -98,21 +98,20 @@ public interface StorageService{
     public ImageStore discoverImageStore(String name, String url, String providerName, Long dcId, Map details) throws IllegalArgumentException, DiscoveryException,
             InvalidParameterValueException;
 
-    /**
-     * Prepare NFS secondary storage for object store migration
-     *
-     * @param cmd
-     *            - the command specifying secondaryStorageId
-     * @return the storage pool
-     * @throws ResourceUnavailableException
-     *             TODO
-     * @throws InsufficientCapacityException
-     *             TODO
+
+        /**
+     * Migrate existing NFS to use object store.
+     * @param name object store name.
+     * @param url object store url.
+     * @param providerName object store provider Name.
+     * @param details object store other details
+     * @return Object store created.
+     * @throws IllegalArgumentException
+     * @throws DiscoveryException
+     * @throws InvalidParameterValueException
      */
     public ImageStore migrateToObjectStore(String name, String url, String providerName, Map details) throws IllegalArgumentException, DiscoveryException,
             InvalidParameterValueException;
 
-    public ImageStore prepareSecondaryStorageForObjectStoreMigration(Long storeId) throws ResourceUnavailableException,
-            InsufficientCapacityException;
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/02f6e02a/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 b901e49..0b8e7ff 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -1239,28 +1239,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
         return (PrimaryDataStoreInfo) dataStoreMgr.getDataStore(primaryStorage.getId(), DataStoreRole.Primary);
     }
 
-    @Override
-    @DB
-    public ImageStore prepareSecondaryStorageForObjectStoreMigration(Long storeId) throws ResourceUnavailableException, InsufficientCapacityException {
-        // Verify that image store exists
-        ImageStoreVO store = _imageStoreDao.findById(storeId);
-        if (store == null) {
-            throw new InvalidParameterValueException("Image store with id " + storeId + " doesn't exist");
-        } else if (!store.getProviderName().equals(DataStoreProvider.NFS_IMAGE)) {
-            throw new InvalidParameterValueException("We only support migrate NFS secondary storage to use object store!");
-        }
-        _accountMgr.checkAccessAndSpecifyAuthority(CallContext.current().getCallingAccount(), store.getDataCenterId());
-
-        DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider(store.getProviderName());
-        DataStoreLifeCycle lifeCycle = provider.getDataStoreLifeCycle();
-        DataStore secStore = dataStoreMgr.getDataStore(storeId, DataStoreRole.Image);
-        lifeCycle.migrateToObjectStore(secStore);
-        // update store_role in template_store_ref and snapshot_store_ref to ImageCache
-        _templateStoreDao.updateStoreRoleToCachce(storeId);
-        _snapshotStoreDao.updateStoreRoleToCache(storeId);
-        // converted to an image cache store
-        return (ImageStore)_dataStoreMgr.getDataStore(storeId, DataStoreRole.ImageCache);
-    }
 
     protected class StorageGarbageCollector extends ManagedContextRunnable {