|
174 | 174 | public class SecondaryStorageManagerImpl extends ManagerBase implements SecondaryStorageVmManager, VirtualMachineGuru, SystemVmLoadScanHandler<Long>, |
175 | 175 | ResourceStateAdapter, Configurable { |
176 | 176 | private static final Logger s_logger = Logger.getLogger(SecondaryStorageManagerImpl.class); |
177 | | - |
178 | | - private static final int DEFAULT_CAPACITY_SCAN_INTERVAL_IN_MILLISECONDS = 30000; |
179 | 177 | private static final int ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_SYNC_IN_SECONDS = 180; |
180 | 178 | private static final int STARTUP_DELAY_IN_MILLISECONDS = 60000; |
181 | 179 |
|
@@ -252,8 +250,6 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar |
252 | 250 | private IndirectAgentLB indirectAgentLB; |
253 | 251 | @Inject |
254 | 252 | private CAManager caManager; |
255 | | - |
256 | | - private long _capacityScanInterval = DEFAULT_CAPACITY_SCAN_INTERVAL_IN_MILLISECONDS; |
257 | 253 | private int _secStorageVmMtuSize; |
258 | 254 |
|
259 | 255 | private String _instance; |
@@ -873,18 +869,14 @@ public boolean configure(String name, Map<String, Object> params) throws Configu |
873 | 869 | } |
874 | 870 |
|
875 | 871 | _allowedInternalSites = _configDao.getValue("secstorage.allowed.internal.sites"); |
876 | | - |
877 | | - String value = configs.get("secstorage.capacityscan.interval"); |
878 | | - _capacityScanInterval = NumbersUtil.parseLong(value, DEFAULT_CAPACITY_SCAN_INTERVAL_IN_MILLISECONDS); |
879 | | - |
880 | 872 | _instance = configs.get("instance.name"); |
881 | 873 | if (_instance == null) { |
882 | 874 | _instance = "DEFAULT"; |
883 | 875 | } |
884 | 876 |
|
885 | 877 | Map<String, String> agentMgrConfigs = _configDao.getConfiguration("AgentManager", params); |
886 | 878 |
|
887 | | - value = agentMgrConfigs.get("port"); |
| 879 | + String value = agentMgrConfigs.get("port"); |
888 | 880 | _mgmtPort = NumbersUtil.parseInt(value, 8250); |
889 | 881 |
|
890 | 882 | _listener = new SecondaryStorageListener(this); |
@@ -926,7 +918,7 @@ public boolean configure(String name, Map<String, Object> params) throws Configu |
926 | 918 |
|
927 | 919 | if (_useServiceVM) { |
928 | 920 | _loadScanner = new SystemVmLoadScanner<>(this); |
929 | | - _loadScanner.initScan(STARTUP_DELAY_IN_MILLISECONDS, _capacityScanInterval); |
| 921 | + _loadScanner.initScan(STARTUP_DELAY_IN_MILLISECONDS, SecondaryStorageCapacityScanInterval.value()); |
930 | 922 | } |
931 | 923 |
|
932 | 924 | _httpProxy = configs.get(Config.SecStorageProxy.key()); |
@@ -1459,7 +1451,7 @@ public String getConfigComponentName() { |
1459 | 1451 |
|
1460 | 1452 | @Override |
1461 | 1453 | public ConfigKey<?>[] getConfigKeys() { |
1462 | | - return new ConfigKey<?>[] {NTPServerConfig, MaxNumberOfSsvmsForMigration}; |
| 1454 | + return new ConfigKey<?>[] {NTPServerConfig, MaxNumberOfSsvmsForMigration, SecondaryStorageCapacityScanInterval}; |
1463 | 1455 | } |
1464 | 1456 |
|
1465 | 1457 | } |
0 commit comments