CE-110 move config to public fields

This commit is contained in:
Daan Hoogland 2017-03-23 16:45:43 +01:00
parent a8c09f2a19
commit 426894411e
3 changed files with 5 additions and 15 deletions

View File

@ -50,6 +50,8 @@ public interface StorageManager extends StorageService {
"Determines how long (in seconds) to wait before actually expunging destroyed volumes. The default value = the default value of storage.cleanup.interval.", false, ConfigKey.Scope.Global, null);
static final ConfigKey<Boolean> StorageCleanupEnabled = new ConfigKey<Boolean>(Boolean.class, "storage.cleanup.enabled", "Advanced", "true",
"Enables/disables the storage cleanup thread.", false, ConfigKey.Scope.Global, null);
static final ConfigKey<Boolean> TemplateCleanupEnabled = new ConfigKey<Boolean>(Boolean.class, "storage.template.cleanup.enabled", "Storage", "true",
"Enable/disable template cleanup activity, only take effect when overall storage cleanup is enabled", false, ConfigKey.Scope.Global, null);
/**
* Returns a comma separated list of tags for the specified storage pool

View File

@ -182,14 +182,6 @@ public enum Config {
"3600",
"Timeout (in seconds) to synchronize storage pool operations.",
null),
StorageTemplateCleanupEnabled(
"Storage",
ManagementServer.class,
Boolean.class,
"storage.template.cleanup.enabled",
"true",
"Enable/disable template cleanup activity, only take effect when overall storage cleanup is enabled",
null),
PrimaryStorageDownloadWait(
"Storage",
TemplateManager.class,

View File

@ -314,7 +314,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
protected SearchBuilder<StoragePoolVO> LocalStorageSearch;
ScheduledExecutorService _executor = null;
boolean _templateCleanupEnabled = true;
int _storagePoolAcquisitionWaitSeconds = 1800; // 30 minutes
int _downloadUrlCleanupInterval;
int _downloadUrlExpirationInterval;
@ -477,11 +476,8 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
_agentMgr.registerForHostEvents(new StoragePoolMonitor(this, _storagePoolDao, _dataStoreProviderMgr), true, false, true);
String value = _configDao.getValue(Config.StorageTemplateCleanupEnabled.key());
_templateCleanupEnabled = (value == null ? true : Boolean.parseBoolean(value));
s_logger.info("Storage cleanup enabled: " + StorageCleanupEnabled.value() + ", interval: " + StorageCleanupInterval.value() + ", delay: " + StorageCleanupDelay.value() +
", template cleanup enabled: " + _templateCleanupEnabled);
", template cleanup enabled: " + TemplateCleanupEnabled.value());
String cleanupInterval = configs.get("extract.url.cleanup.interval");
_downloadUrlCleanupInterval = NumbersUtil.parseInt(cleanupInterval, 7200);
@ -1065,7 +1061,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
if (scanLock.lock(3)) {
try {
// Cleanup primary storage pools
if (_templateCleanupEnabled) {
if (TemplateCleanupEnabled.value()) {
List<StoragePoolVO> storagePools = _storagePoolDao.listAll();
for (StoragePoolVO pool : storagePools) {
try {
@ -2426,7 +2422,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
@Override
public ConfigKey<?>[] getConfigKeys() {
return new ConfigKey<?>[] {StorageCleanupInterval, StorageCleanupDelay, StorageCleanupEnabled};
return new ConfigKey<?>[] {StorageCleanupInterval, StorageCleanupDelay, StorageCleanupEnabled, TemplateCleanupEnabled};
}
@Override