@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { Map<String, String> configs = _configDao.getConfiguration("management-server", params); String stoppedValue = configs.get("vm.resource.release.interval"); // String destroyedValue = // configs.get("capacity.skipcounting.destroyed.hours"); String destroyedValue = null; _secondsToSkipStoppedVMs = NumbersUtil.parseInt(stoppedValue, 86400); _secondsToSkipDestroyedVMs = NumbersUtil.parseInt(destroyedValue, 0); return true; }
protected void configureDiskActivityChecks(final Map<String, Object> params) { _diskActivityCheckEnabled = Boolean.parseBoolean((String)params.get("vm.diskactivity.checkenabled")); if (_diskActivityCheckEnabled) { final int timeout = NumbersUtil.parseInt((String)params.get("vm.diskactivity.checktimeout_s"), 0); if (timeout > 0) { _diskActivityCheckTimeoutSeconds = timeout; } final long inactiveTime = NumbersUtil.parseLong((String)params.get("vm.diskactivity.inactivetime_ms"), 0L); if (inactiveTime > 0) { _diskActivityInactiveThresholdMilliseconds = inactiveTime; } } }
@Override public int hashCode() { return NumbersUtil.hash(id); } }
@Override public boolean configure(String name, Map<String, Object> params) { _time = NumbersUtil.parseLong((String)params.get("seconds"), 5) * 1000; return true; }
/** * Converts bytes to long on input. */ public static long bytesToLong(byte b[]) { return bytesToLong(b, 0); }
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { super.configure(name, params); storageOverprovisioningFactor = new BigDecimal(1); extraBytesPerVolume = NumbersUtil.parseLong((String)params.get("extra.bytes.per.volume"), 50 * 1024L * 1024L); return true; }
public static long getManagementServerId(final byte[] bytes) { return NumbersUtil.bytesToLong(bytes, 16); }
private void init() throws ConfigurationException { if (_mshostDao != null) return; Properties dbProps = DbProperties.getDbProperties(); _clusterServicePort = NumbersUtil.parseInt(dbProps.getProperty("cluster.servlet.port"), DEFAULT_SERVICE_PORT); if (s_logger.isInfoEnabled()) s_logger.info("Cluster servlet port : " + _clusterServicePort); } }
final int count = NumbersUtil.parseInt(value, 1); _workers = new WorkerThread[count]; for (int i = 0; i < _workers.length; i++) { _timeToSleep = (long)NumbersUtil.parseInt(value, 60) * 1000; _maxRetries = NumbersUtil.parseInt(value, 5); _timeBetweenFailures = NumbersUtil.parseLong(value, 3600) * 1000; _timeBetweenCleanups = NumbersUtil.parseLong(value, 3600 * 24); _stopRetryInterval = NumbersUtil.parseInt(value, 10 * 60); _restartRetryInterval = NumbersUtil.parseInt(value, 10 * 60); _investigateRetryInterval = NumbersUtil.parseInt(value, 1 * 60); _migrateRetryInterval = NumbersUtil.parseInt(value, 2 * 60);
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { _configs = _configDao.getConfiguration("management-server", params); if (s_logger.isInfoEnabled()) { s_logger.info(format("Configuring LBHealthCheck Manager %1$s", name)); } this.name = name; _interval = NumbersUtil.parseLong(_configs.get(Config.LBHealthCheck.key()), 600); _executor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("LBHealthCheck")); return true; }
@Override public int hashCode() { return NumbersUtil.hash(id); } }
public static long getAgentId(final byte[] bytes) { return NumbersUtil.bytesToLong(bytes, 24); }
public boolean configureHostParams(final Map<String, String> params) { if (_params.get("router.aggregation.command.each.timeout") == null) { String value = (String)params.get("router.aggregation.command.each.timeout"); _eachTimeout = Duration.standardSeconds(NumbersUtil.parseInt(value, 10)); } return true; }
@Override public boolean configure(String name, Map<String, Object> params) { String maxVolumeSizeInGbString = _configDao.getValue(Config.MaxVolumeSize.toString()); _maxVolumeSizeInGb = NumbersUtil.parseLong(maxVolumeSizeInGbString, 2000); return true; }
@Override public int hashCode() { return NumbersUtil.hash(id); }
public static long getViaAgentId(final byte[] bytes) { return NumbersUtil.bytesToLong(bytes, 32); }
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { String value = configurationDao.getValue("vmsnapshot.create.wait"); _wait = NumbersUtil.parseInt(value, 1800); return true; }
@Override public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException { final String maxVolumeSizeInGbString = _configDao.getValue(Config.MaxVolumeSize.key()); _maxVolumeSizeInGb = NumbersUtil.parseInt(maxVolumeSizeInGbString, Integer.parseInt(Config.MaxVolumeSize.getDefaultValue())); final String defaultPageSizeString = _configDao.getValue(Config.DefaultPageSize.key()); _defaultPageSize = NumbersUtil.parseLong(defaultPageSizeString, Long.parseLong(Config.DefaultPageSize.getDefaultValue())); populateConfigValuesForValidationSet(); weightBasedParametersForValidation(); overProvisioningFactorsForValidation(); return true; }
@Override public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { super.configure(name, params); _defaultLbCapacity = NumbersUtil.parseLong(_configDao.getValue(Config.DefaultExternalLoadBalancerCapacity.key()), 50); _resourceMgr.registerResourceStateAdapter(this.getClass().getSimpleName(), this); return true; }