DaanHoogland commented on a change in pull request #4826:
URL: https://github.com/apache/cloudstack/pull/4826#discussion_r686885121
##########
File path: server/src/main/java/com/cloud/storage/StorageManagerImpl.java
##########
@@ -475,49 +478,40 @@ public Answer sendToPool(StoragePool pool, Command cmd)
throws StorageUnavailabl
}
private GetStorageStatsAnswer getStoragePoolStats(StoragePool pool,
GetStorageStatsCommand cmd) {
- DataStoreProvider storeProvider =
_dataStoreProviderMgr.getDataStoreProvider(pool.getStorageProviderName());
- DataStoreDriver storeDriver = storeProvider.getDataStoreDriver();
GetStorageStatsAnswer answer = null;
- if (storeDriver instanceof PrimaryDataStoreDriver &&
((PrimaryDataStoreDriver)storeDriver).canProvideStorageStats()) {
- PrimaryDataStoreDriver primaryStoreDriver =
(PrimaryDataStoreDriver)storeDriver;
- Pair<Long, Long> storageStats =
primaryStoreDriver.getStorageStats(pool);
- if (storageStats == null) {
- answer = new GetStorageStatsAnswer((GetStorageStatsCommand)
cmd, "Failed to get storage stats for pool: " + pool.getId());
- } else {
- answer = new GetStorageStatsAnswer((GetStorageStatsCommand)
cmd, storageStats.first(), storageStats.second());
- }
+ DataStoreProvider storeProvider =
_dataStoreProviderMgr.getDataStoreProvider(pool.getStorageProviderName());
+ DataStoreDriver storeDriver = storeProvider.getDataStoreDriver();
+ PrimaryDataStoreDriver primaryStoreDriver = (PrimaryDataStoreDriver)
storeDriver;
Review comment:
got it, but please do, no telling who will call it in the future and
from where.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]