public Date getStorageTableEndDate(String storageTable, FactTable factTableName) throws LensException { List<Date> endDates = getStorageTimes(storageTable, MetastoreUtil.getStoragetableEndTimesKey()); endDates.add(factTableName.getEndTime()); return Collections.min(endDates); }
public Date getStorageTableEndDate(String storageTable, FactTable factTableName) throws LensException { List<Date> endDates = getStorageTimes(storageTable, MetastoreUtil.getStoragetableEndTimesKey()); endDates.add(factTableName.getEndTime()); return Collections.min(endDates); }
public boolean isStorageTableCandidateForRange(String storageTableName, Date fromDate, Date toDate) throws LensException { List<Date> storageEndDates = getStorageTimes(storageTableName, MetastoreUtil.getStoragetableEndTimesKey()); for(Date endDate : storageEndDates) { // endDate is exclusive if (endDate.before(fromDate) || endDate.equals(fromDate)) { log.debug("from date {} is after validity end time: {}, hence discarding {}", fromDate, endDate, storageTableName); return false; } } List<Date> storageStartDates = getStorageTimes(storageTableName, MetastoreUtil.getStoragetableStartTimesKey()); for(Date startDate : storageStartDates) { // toDate is exclusive on the range if (startDate.after(toDate) || startDate.equals(toDate)) { log.debug("to date {} is before validity start time: {}, hence discarding {}", toDate, startDate, storageTableName); return false; } } return true; }
public boolean isStorageTableCandidateForRange(String storageTableName, Date fromDate, Date toDate) throws LensException { List<Date> storageEndDates = getStorageTimes(storageTableName, MetastoreUtil.getStoragetableEndTimesKey()); for (Date endDate : storageEndDates) { // endDate is exclusive if (endDate.before(fromDate) || endDate.equals(fromDate)) { log.debug("from date {} is after validity end time: {}, hence discarding {}", fromDate, endDate, storageTableName); return false; } } List<Date> storageStartDates = getStorageTimes(storageTableName, MetastoreUtil.getStoragetableStartTimesKey()); for (Date startDate : storageStartDates) { // toDate is exclusive on the range if (startDate.after(toDate) || startDate.equals(toDate)) { log.debug("to date {} is before validity start time: {}, hence discarding {}", toDate, startDate, storageTableName); return false; } } return true; }
public boolean isStorageTablePartitionACandidate(String storageTableName, Date partDate) throws LensException { List<Date> storageStartDates = getStorageTimes(storageTableName, MetastoreUtil.getStoragetableStartTimesKey()); for(Date startDate : storageStartDates) { if (partDate.before(startDate)) { log.info("part date {} is before validity start time: {}, hence discarding {}", partDate, startDate, storageTableName); return false; } } List<Date> storageEndDates = getStorageTimes(storageTableName, MetastoreUtil.getStoragetableEndTimesKey()); for(Date endDate : storageEndDates) { // end date should be exclusive if (partDate.after(endDate) || partDate.equals(endDate)) { log.info("part date {} is after validity end time: {}, hence discarding {}", partDate, endDate, storageTableName); return false; } } return true; }
public boolean isStorageTablePartitionACandidate(String storageTableName, Date partDate) throws LensException { List<Date> storageStartDates = getStorageTimes(storageTableName, MetastoreUtil.getStoragetableStartTimesKey()); for (Date startDate : storageStartDates) { if (partDate.before(startDate)) { log.info("part date {} is before validity start time: {}, hence discarding {}", partDate, startDate, storageTableName); return false; } } List<Date> storageEndDates = getStorageTimes(storageTableName, MetastoreUtil.getStoragetableEndTimesKey()); for (Date endDate : storageEndDates) { // end date should be exclusive if (partDate.after(endDate) || partDate.equals(endDate)) { log.info("part date {} is after validity end time: {}, hence discarding {}", partDate, endDate, storageTableName); return false; } } return true; }
storageProps.put(getStoragetableEndTimesKey(), "now +10 days");
s1.getTblProps().put(MetastoreUtil.getStoragetableEndTimesKey(), "now.day - 1 day");
s1.getTblProps().put(MetastoreUtil.getStoragetableEndTimesKey(), "now.day - 1 day");
propStartTime.setValue("now -10 days"); XProperty propEndTime = cubeObjectFactory.createXProperty(); propEndTime.setName(MetastoreUtil.getStoragetableEndTimesKey()); propEndTime.setValue("now +5 days"); props.getProperty().add(propStartTime);