CLOUDSTACK-5840:Remove old API method.

This commit is contained in:
Min Chen 2014-01-08 18:11:12 -08:00
parent 3223028fd6
commit ac8bc74269
2 changed files with 12 additions and 34 deletions

View File

@ -95,20 +95,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;
}

View File

@ -1225,28 +1225,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 {