incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [25/34] git commit: refs/heads/ui-ntier2 - CLOUDSTACK-1624: Initialize configuration variables properly to avoid influence of any racing conditions
Date Wed, 13 Mar 2013 20:21:34 GMT
CLOUDSTACK-1624: Initialize configuration variables properly to avoid influence of any racing
conditions


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/d55560a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/d55560a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/d55560a6

Branch: refs/heads/ui-ntier2
Commit: d55560a6270238aefca3949d000ec53e7d7221a5
Parents: 0ca8565
Author: Kelven Yang <kelveny@gmail.com>
Authored: Tue Mar 12 14:56:35 2013 -0700
Committer: Kelven Yang <kelveny@gmail.com>
Committed: Tue Mar 12 15:02:31 2013 -0700

----------------------------------------------------------------------
 .../configuration/ConfigurationManagerImpl.java    |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d55560a6/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 7f449de..b1ad6b7 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -252,17 +252,19 @@ public class ConfigurationManagerImpl extends ManagerBase implements
Configurati
     // FIXME - why don't we have interface for DataCenterLinkLocalIpAddressDao?
     @Inject protected DataCenterLinkLocalIpAddressDao _LinkLocalIpAllocDao;
 
-    private int _maxVolumeSizeInGb;
-    private long _defaultPageSize;
+    private int _maxVolumeSizeInGb = Integer.parseInt(Config.MaxVolumeSize.getDefaultValue());
+    private long _defaultPageSize = Long.parseLong(Config.DefaultPageSize.getDefaultValue());
     protected Set<String> configValuesForValidation;
 
     @Override
     public boolean configure(final String name, final Map<String, Object> params) throws
ConfigurationException {
-        String maxVolumeSizeInGbString = _configDao.getValue("storage.max.volume.size");
-        _maxVolumeSizeInGb = NumbersUtil.parseInt(maxVolumeSizeInGbString, 2000);
+        String maxVolumeSizeInGbString = _configDao.getValue(Config.MaxVolumeSize.key());
+        _maxVolumeSizeInGb = NumbersUtil.parseInt(maxVolumeSizeInGbString, 
+        	Integer.parseInt(Config.MaxVolumeSize.getDefaultValue()));
 
-        String defaultPageSizeString = _configDao.getValue("default.page.size");
-        _defaultPageSize = NumbersUtil.parseLong(defaultPageSizeString, 500L);
+        String defaultPageSizeString = _configDao.getValue(Config.DefaultPageSize.key());
+        _defaultPageSize = NumbersUtil.parseLong(defaultPageSizeString, 
+        	Long.parseLong(Config.DefaultPageSize.getDefaultValue()));
 
         populateConfigValuesForValidationSet();
         return true;


Mime
View raw message