use of com.cloud.engine.subsystem.api.storage.DataStoreProvider in project cosmic by MissionCriticalCloud.
the class DataStoreProviderManagerImpl method getPrimaryDataStoreProviders.
public List<StorageProviderResponse> getPrimaryDataStoreProviders() {
final List<StorageProviderResponse> providers = new ArrayList<>();
for (final DataStoreProvider provider : providerMap.values()) {
if (provider.getTypes().contains(DataStoreProviderType.PRIMARY)) {
final StorageProviderResponse response = new StorageProviderResponse();
response.setName(provider.getName());
response.setType(DataStoreProvider.DataStoreProviderType.PRIMARY.toString());
providers.add(response);
}
}
return providers;
}
use of com.cloud.engine.subsystem.api.storage.DataStoreProvider in project cosmic by MissionCriticalCloud.
the class DataStoreProviderManagerImpl method getImageDataStoreProviders.
public List<StorageProviderResponse> getImageDataStoreProviders() {
final List<StorageProviderResponse> providers = new ArrayList<>();
for (final DataStoreProvider provider : providerMap.values()) {
if (provider.getTypes().contains(DataStoreProviderType.IMAGE)) {
final StorageProviderResponse response = new StorageProviderResponse();
response.setName(provider.getName());
response.setType(DataStoreProvider.DataStoreProviderType.IMAGE.toString());
providers.add(response);
}
}
return providers;
}
use of com.cloud.engine.subsystem.api.storage.DataStoreProvider in project cosmic by MissionCriticalCloud.
the class PrimaryDataStoreProviderManagerImpl method getPrimaryDataStore.
@Override
public PrimaryDataStore getPrimaryDataStore(final long dataStoreId) {
final StoragePoolVO dataStoreVO = dataStoreDao.findById(dataStoreId);
if (dataStoreVO == null) {
throw new CloudRuntimeException("Unable to locate datastore with id " + dataStoreId);
}
final String providerName = dataStoreVO.getStorageProviderName();
final DataStoreProvider provider = providerManager.getDataStoreProvider(providerName);
final PrimaryDataStoreImpl dataStore = PrimaryDataStoreImpl.createDataStore(dataStoreVO, driverMaps.get(provider.getName()), provider);
return dataStore;
}
use of com.cloud.engine.subsystem.api.storage.DataStoreProvider in project cosmic by MissionCriticalCloud.
the class CapacityManagerImpl method getUsedBytes.
@Override
public long getUsedBytes(final StoragePoolVO pool) {
final DataStoreProvider storeProvider = _dataStoreProviderMgr.getDataStoreProvider(pool.getStorageProviderName());
final DataStoreDriver storeDriver = storeProvider.getDataStoreDriver();
if (storeDriver instanceof PrimaryDataStoreDriver) {
final PrimaryDataStoreDriver primaryStoreDriver = (PrimaryDataStoreDriver) storeDriver;
return primaryStoreDriver.getUsedBytes(pool);
}
throw new CloudRuntimeException("Storage driver in CapacityManagerImpl.getUsedBytes(StoragePoolVO) is not a PrimaryDataStoreDriver.");
}
use of com.cloud.engine.subsystem.api.storage.DataStoreProvider in project cosmic by MissionCriticalCloud.
the class CapacityManagerImpl method getUsedIops.
@Override
public long getUsedIops(final StoragePoolVO pool) {
final DataStoreProvider storeProvider = _dataStoreProviderMgr.getDataStoreProvider(pool.getStorageProviderName());
final DataStoreDriver storeDriver = storeProvider.getDataStoreDriver();
if (storeDriver instanceof PrimaryDataStoreDriver) {
final PrimaryDataStoreDriver primaryStoreDriver = (PrimaryDataStoreDriver) storeDriver;
return primaryStoreDriver.getUsedIops(pool);
}
throw new CloudRuntimeException("Storage driver in CapacityManagerImpl.getUsedIops(StoragePoolVO) is not a PrimaryDataStoreDriver.");
}
Aggregations