cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jburwell <>
Subject [GitHub] cloudstack pull request: Quota
Date Tue, 15 Sep 2015 04:29:35 GMT
Github user jburwell commented on a diff in the pull request:
    --- Diff: usage/src/org/apache/cloudstack/quota/ ---
    @@ -0,0 +1,397 @@
    +//Licensed to the Apache Software Foundation (ASF) under one
    +//or more contributor license agreements.  See the NOTICE file
    +//distributed with this work for additional information
    +//regarding copyright ownership.  The ASF licenses this file
    +//to you under the Apache License, Version 2.0 (the
    +//"License"); you may not use this file except in compliance
    +//with the License.  You may obtain a copy of the License at
    +//Unless required by applicable law or agreed to in writing,
    +//software distributed under the License is distributed on an
    +//KIND, either express or implied.  See the License for the
    +//specific language governing permissions and limitations
    +//under the License.
    +package org.apache.cloudstack.quota;
    +import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
    +import org.apache.cloudstack.quota.constant.QuotaTypes;
    +import org.apache.cloudstack.quota.dao.QuotaAccountDao;
    +import org.apache.cloudstack.quota.dao.QuotaBalanceDao;
    +import org.apache.cloudstack.quota.dao.QuotaTariffDao;
    +import org.apache.cloudstack.quota.dao.QuotaUsageDao;
    +import org.apache.cloudstack.quota.dao.ServiceOfferingDao;
    +import org.apache.cloudstack.quota.vo.QuotaAccountVO;
    +import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
    +import org.apache.cloudstack.quota.vo.QuotaTariffVO;
    +import org.apache.cloudstack.quota.vo.QuotaUsageVO;
    +import org.apache.cloudstack.quota.vo.ServiceOfferingVO;
    +import org.apache.cloudstack.utils.usage.UsageUtils;
    +import org.apache.log4j.Logger;
    +import org.springframework.stereotype.Component;
    +import javax.ejb.Local;
    +import javax.inject.Inject;
    +import javax.naming.ConfigurationException;
    +import java.math.BigDecimal;
    +import java.math.RoundingMode;
    +import java.util.ArrayList;
    +import java.util.Date;
    +import java.util.List;
    +import java.util.Map;
    +import java.util.TimeZone;
    +@Local(value = QuotaManager.class)
    +public class QuotaManagerImpl extends ManagerBase implements QuotaManager {
    +    private static final Logger s_logger = Logger.getLogger(QuotaManagerImpl.class.getName());
    +    @Inject
    +    private AccountDao _accountDao;
    +    @Inject
    +    private QuotaAccountDao _quotaAcc;
    +    @Inject
    +    private UsageDao _usageDao;
    +    @Inject
    +    private QuotaTariffDao _quotaTariffDao;
    +    @Inject
    +    private QuotaUsageDao _quotaUsageDao;
    +    @Inject
    +    private ServiceOfferingDao _serviceOfferingDao;
    +    @Inject
    +    private QuotaBalanceDao _quotaBalanceDao;
    +    @Inject
    +    private ConfigurationDao _configDao;
    +    private TimeZone _usageTimezone;
    +    private int _aggregationDuration = 0;
    +    final static BigDecimal s_hoursInMonth = new BigDecimal(30 * 24);
    +    final static BigDecimal s_minutesInMonth = new BigDecimal(30 * 24 * 60);
    +    final static BigDecimal s_gb = new BigDecimal(1024 * 1024 * 1024);
    --- End diff --
    These constants are duplicated from ``QuotaServiceImpl``.  Refactor to a common utility
class.  Per previous comments, is the overhead of ``BigDecimal`` required?

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message