/** * Normalized cost of an update period. update period weight multiplied by number of partitions of that update period. * * @param updatePeriod * @param driver * @return normalized cost. * @throws LensException */ private double getNormalizedUpdatePeriodCost(final UpdatePeriod updatePeriod, LensDriver driver) throws LensException { double weight = driver.getConf().getDouble(UPDATE_PERIOD_WEIGHT_PREFIX + updatePeriod.name().toLowerCase(), updatePeriod.getNormalizationFactor()); return weight * updatePeriod.weight() / UpdatePeriod.DAILY.weight(); }
/** * Normalized cost of an update period. update period weight multiplied by number of partitions of that update period. * * @param updatePeriod * @param driver * @return normalized cost. * @throws LensException */ private double getNormalizedUpdatePeriodCost(final UpdatePeriod updatePeriod, LensDriver driver) throws LensException { double weight = driver.getConf().getDouble(UPDATE_PERIOD_WEIGHT_PREFIX + updatePeriod.name().toLowerCase(), updatePeriod.getNormalizationFactor()); return weight * updatePeriod.weight() / UpdatePeriod.DAILY.weight(); }
if (diff < i.weight()) {
if (diff < i.weight()) {
static CoveringInfo getCoveringInfo(Date from, Date to, UpdatePeriod interval) { switch (interval) { case SECONDLY: case CONTINUOUS: return getMilliSecondCoveringInfo(from, to, 1000, interval); case MINUTELY: case HOURLY: case DAILY: return getMilliSecondCoveringInfo(from, to, interval.weight(), interval); case WEEKLY: return getWeeklyCoveringInfo(from, to); case MONTHLY: return getMonthlyCoveringInfo(from, to); case QUARTERLY: return getQuarterlyCoveringInfo(from, to); case YEARLY: return getYearlyCoveringInfo(from, to); default: return new CoveringInfo(0, false); } }
static CoveringInfo getCoveringInfo(Date from, Date to, UpdatePeriod interval) { switch (interval) { case SECONDLY: case CONTINUOUS: return getMilliSecondCoveringInfo(from, to, 1000, interval); case MINUTELY: case HOURLY: case DAILY: return getMilliSecondCoveringInfo(from, to, interval.weight(), interval); case WEEKLY: return getWeeklyCoveringInfo(from, to); case MONTHLY: return getMonthlyCoveringInfo(from, to); case QUARTERLY: return getQuarterlyCoveringInfo(from, to); case YEARLY: return getYearlyCoveringInfo(from, to); default: return new CoveringInfo(0, false); } }