mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CE-110 move config to public fields
This commit is contained in:
parent
a8c09f2a19
commit
426894411e
@ -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);
|
"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",
|
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);
|
"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
|
* Returns a comma separated list of tags for the specified storage pool
|
||||||
|
|||||||
@ -182,14 +182,6 @@ public enum Config {
|
|||||||
"3600",
|
"3600",
|
||||||
"Timeout (in seconds) to synchronize storage pool operations.",
|
"Timeout (in seconds) to synchronize storage pool operations.",
|
||||||
null),
|
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(
|
PrimaryStorageDownloadWait(
|
||||||
"Storage",
|
"Storage",
|
||||||
TemplateManager.class,
|
TemplateManager.class,
|
||||||
|
|||||||
@ -314,7 +314,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||||||
protected SearchBuilder<StoragePoolVO> LocalStorageSearch;
|
protected SearchBuilder<StoragePoolVO> LocalStorageSearch;
|
||||||
|
|
||||||
ScheduledExecutorService _executor = null;
|
ScheduledExecutorService _executor = null;
|
||||||
boolean _templateCleanupEnabled = true;
|
|
||||||
int _storagePoolAcquisitionWaitSeconds = 1800; // 30 minutes
|
int _storagePoolAcquisitionWaitSeconds = 1800; // 30 minutes
|
||||||
int _downloadUrlCleanupInterval;
|
int _downloadUrlCleanupInterval;
|
||||||
int _downloadUrlExpirationInterval;
|
int _downloadUrlExpirationInterval;
|
||||||
@ -477,11 +476,8 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||||||
|
|
||||||
_agentMgr.registerForHostEvents(new StoragePoolMonitor(this, _storagePoolDao, _dataStoreProviderMgr), true, false, true);
|
_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() +
|
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");
|
String cleanupInterval = configs.get("extract.url.cleanup.interval");
|
||||||
_downloadUrlCleanupInterval = NumbersUtil.parseInt(cleanupInterval, 7200);
|
_downloadUrlCleanupInterval = NumbersUtil.parseInt(cleanupInterval, 7200);
|
||||||
@ -1065,7 +1061,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||||||
if (scanLock.lock(3)) {
|
if (scanLock.lock(3)) {
|
||||||
try {
|
try {
|
||||||
// Cleanup primary storage pools
|
// Cleanup primary storage pools
|
||||||
if (_templateCleanupEnabled) {
|
if (TemplateCleanupEnabled.value()) {
|
||||||
List<StoragePoolVO> storagePools = _storagePoolDao.listAll();
|
List<StoragePoolVO> storagePools = _storagePoolDao.listAll();
|
||||||
for (StoragePoolVO pool : storagePools) {
|
for (StoragePoolVO pool : storagePools) {
|
||||||
try {
|
try {
|
||||||
@ -2426,7 +2422,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ConfigKey<?>[] getConfigKeys() {
|
public ConfigKey<?>[] getConfigKeys() {
|
||||||
return new ConfigKey<?>[] {StorageCleanupInterval, StorageCleanupDelay, StorageCleanupEnabled};
|
return new ConfigKey<?>[] {StorageCleanupInterval, StorageCleanupDelay, StorageCleanupEnabled, TemplateCleanupEnabled};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user