Skip to content

Commit 7cfb751

Browse files
author
Daan Hoogland
committed
more literals removed
1 parent 9cd59a8 commit 7cfb751

3 files changed

Lines changed: 4 additions & 11 deletions

File tree

engine/storage/cache/src/main/java/org/apache/cloudstack/storage/cache/manager/StorageCacheManagerImpl.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import org.apache.cloudstack.framework.async.AsyncCallFuture;
5050
import org.apache.cloudstack.framework.config.ConfigKey;
5151
import org.apache.cloudstack.framework.config.Configurable;
52-
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
5352
import org.apache.cloudstack.managed.context.ManagedContextRunnable;
5453
import org.apache.cloudstack.storage.cache.allocator.StorageCacheAllocator;
5554
import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager;
@@ -58,7 +57,6 @@
5857
import com.cloud.agent.api.to.DataObjectType;
5958
import com.cloud.storage.DataStoreRole;
6059
import com.cloud.storage.StorageManager;
61-
import com.cloud.utils.NumbersUtil;
6260
import com.cloud.utils.component.Manager;
6361
import com.cloud.utils.concurrency.NamedThreadFactory;
6462
import com.cloud.utils.db.GlobalLock;
@@ -79,8 +77,6 @@ public class StorageCacheManagerImpl implements StorageCacheManager, Manager, Co
7977
DataStoreManager dataStoreManager;
8078
@Inject
8179
StorageCacheReplacementAlgorithm cacheReplacementAlgorithm;
82-
@Inject
83-
ConfigurationDao configDao;
8480
Boolean cacheReplacementEnabled = Boolean.TRUE;
8581
int workers;
8682
ScheduledExecutorService executors;
@@ -164,7 +160,7 @@ public void setRunLevel(int level) {
164160
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
165161
cacheReplacementEnabled = StorageCacheReplacementEnabled.value();
166162
cacheReplaceMentInterval = StorageCacheReplacementInterval.value();
167-
workers = NumbersUtil.parseInt(configDao.getValue(StorageManager.ExpungeWorkers.key()), 10);
163+
workers = StorageManager.ExpungeWorkers.value();
168164
executors = Executors.newScheduledThreadPool(workers, new NamedThreadFactory("StorageCacheManager-cache-replacement"));
169165
return true;
170166
}

plugins/storage/image/default/src/main/java/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
3434
import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
3535
import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
36-
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
3736
import org.apache.cloudstack.storage.image.NfsImageStoreDriverImpl;
3837
import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
3938
import org.apache.cloudstack.storage.image.store.ImageStoreImpl;
@@ -48,8 +47,6 @@
4847

4948
public class CloudStackImageStoreDriverImpl extends NfsImageStoreDriverImpl {
5049

51-
@Inject
52-
ConfigurationDao _configDao;
5350
@Inject
5451
HostDao _hostDao;
5552
@Inject
@@ -131,7 +128,7 @@ private String generateCopyUrl(String ipAddress, String fileName, String filePat
131128
String hostname = ipAddress;
132129
String scheme = "http";
133130
boolean _sslCopy = SecondaryStorageVmManager.SecStorageEncryptCopy.value();
134-
String _ssvmUrlDomain = _configDao.getValue("secstorage.ssl.cert.domain");
131+
String _ssvmUrlDomain = SecondaryStorageVmManager.SecStorageSecureCopyCert.value();
135132
if(_sslCopy && (_ssvmUrlDomain == null || _ssvmUrlDomain.isEmpty())){
136133
logger.warn("Empty secondary storage url domain, ignoring SSL");
137134
_sslCopy = false;

server/src/main/java/com/cloud/storage/StorageManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4575,7 +4575,7 @@ public Long getDiskIopsReadRate(final ServiceOffering offering, final DiskOfferi
45754575
if ((diskOffering != null) && (diskOffering.getIopsReadRate() != null) && (diskOffering.getIopsReadRate() > 0)) {
45764576
return diskOffering.getIopsReadRate();
45774577
} else {
4578-
Long iopsReadRate = Long.parseLong(_configDao.getValue(VmDiskThrottlingIopsReadRate.key()));
4578+
Long iopsReadRate = VmDiskThrottlingIopsReadRate.value().longValue();
45794579
if ((iopsReadRate > 0) && ((offering == null) || (!offering.isSystemUse()))) {
45804580
return iopsReadRate;
45814581
}
@@ -4589,7 +4589,7 @@ public Long getDiskIopsWriteRate(final ServiceOffering offering, final DiskOffer
45894589
if ((diskOffering != null) && (diskOffering.getIopsWriteRate() != null) && (diskOffering.getIopsWriteRate() > 0)) {
45904590
return diskOffering.getIopsWriteRate();
45914591
} else {
4592-
Long iopsWriteRate = Long.parseLong(_configDao.getValue(VmDiskThrottlingIopsWriteRate.key()));
4592+
Long iopsWriteRate = VmDiskThrottlingIopsWriteRate.value().longValue();
45934593
if ((iopsWriteRate > 0) && ((offering == null) || (!offering.isSystemUse()))) {
45944594
return iopsWriteRate;
45954595
}

0 commit comments

Comments
 (0)