@Override public Map<String, Set<UpdatePeriod>> getUpdatePeriods() { return this.sourceCubeFactTable.getUpdatePeriods(); }
@Override public Map<String, Set<UpdatePeriod>> getUpdatePeriods() { return this.sourceCubeFactTable.getUpdatePeriods(); }
/** * Returns storage table names for a storage. * Note: If each update period in the storage has a different storage table, this method will return N Storage Tables * where N is the number of update periods in the storage (LENS-1386) * * @param factTable * @param storage * @return * @throws LensException */ public Set<String> getStorageTables(FactTable factTable, String storage) throws LensException { Set<String> uniqueStorageTables = new HashSet<>(); for (UpdatePeriod updatePeriod : factTable.getUpdatePeriods().get(storage)) { String factName = factTable.getSourceFactName(); uniqueStorageTables.add(getStorageTableName(factName, storage, updatePeriod)); } return uniqueStorageTables; }
/** * Returns storage table names for a storage. * Note: If each update period in the storage has a different storage table, this method will return N Storage Tables * where N is the number of update periods in the storage (LENS-1386) * * @param factTable * @param storage * @return * @throws LensException */ public Set<String> getStorageTables(FactTable factTable, String storage) throws LensException { Set<String> uniqueStorageTables = new HashSet<>(); for (UpdatePeriod updatePeriod : factTable.getUpdatePeriods().get(storage)) { String factName = factTable.getSourceFactName(); uniqueStorageTables.add(getStorageTableName(factName, storage, updatePeriod)); } return uniqueStorageTables; }
private void ensureEntryForTimeLineKey(String fact, String storage, UpdatePeriod updatePeriod, String storageTableName, String timeLineKey) throws LensException { // Not found in table properties either, compute from all partitions of the fact-storage table. // First make sure all combinations of update period and partition column have an entry even // if no partitions exist if (getFactTable(fact).getUpdatePeriods() != null && getFactTable(fact).getUpdatePeriods().get(storage) != null) { log.info("loading from all partitions: {}", storageTableName); Table storageTable = getTable(storageTableName); for (String partCol : getTimePartColNamesOfTable(storageTable)) { ensureEntry(timeLineKey, storageTableName, updatePeriod, partCol); } } }
private void ensureEntryForTimeLineKey(String fact, String storage, UpdatePeriod updatePeriod, String storageTableName, String timeLineKey) throws LensException { // Not found in table properties either, compute from all partitions of the fact-storage table. // First make sure all combinations of update period and partition column have an entry even // if no partitions exist if (getFactTable(fact).getUpdatePeriods() != null && getFactTable(fact).getUpdatePeriods().get(storage) != null) { log.info("loading from all partitions: {}", storageTableName); Table storageTable = getTable(storageTableName); for (String partCol : getTimePartColNamesOfTable(storageTable)) { ensureEntry(timeLineKey, storageTableName, updatePeriod, partCol); } } }
Set<String> uniqueStorageTables = new HashSet<>(); Map<UpdatePeriod, String> updatePeriodTableName = new HashMap<>(); for (UpdatePeriod updatePeriod : getFactTable(fact).getUpdatePeriods().get(storage)) { String storageTableName = getStorageTableName(fact, storage, updatePeriod); updatePeriodTableName.put(updatePeriod, storageTableName);
Set<String> uniqueStorageTables = new HashSet<>(); Map<UpdatePeriod, String> updatePeriodTableName = new HashMap<>(); for (UpdatePeriod updatePeriod : getFactTable(fact).getUpdatePeriods().get(storage)) { String storageTableName = getStorageTableName(fact, storage, updatePeriod); updatePeriodTableName.put(updatePeriod, storageTableName);
for (FactTable fact : getAllFacts(cube)) { for (String storage : fact.getStorages()) { for (UpdatePeriod updatePeriod : fact.getUpdatePeriods().get(storage)) { PartitionTimeline timeline = partitionTimelineCache.get(fact.getSourceFactName(), storage, updatePeriod, partCol);
for (FactTable fact : getAllFacts(cube)) { for (String storage : fact.getStorages()) { for (UpdatePeriod updatePeriod : fact.getUpdatePeriods().get(storage)) { PartitionTimeline timeline = partitionTimelineCache.get(fact.getSourceFactName(), storage, updatePeriod, partCol);
public XStorageTableElement getStorageOfFact(LensSessionHandle sessionid, String fact, String storageName) throws LensException { try (SessionContext ignored = new SessionContext(sessionid)) { CubeMetastoreClient msClient = getClient(sessionid); FactTable factTable = msClient.getFactTable(fact); Set<UpdatePeriod> updatePeriods = factTable.getUpdatePeriods().get(storageName); XStorageTableElement tblElement = JAXBUtils.getXStorageTableFromHiveTable( msClient.getHiveTable(MetastoreUtil.getFactOrDimtableStorageTableName(fact, storageName))); tblElement.setStorageName(storageName); for (UpdatePeriod p : updatePeriods) { tblElement.getUpdatePeriods().getUpdatePeriod().add(XUpdatePeriod.valueOf(p.name())); } return tblElement; } }
if (fact.getUpdatePeriods().isEmpty()) { log.info("Not considering fact: {} as it has no update periods", fact.getName()); } else if (validFactTables != null && !validFactTables.contains(fact.getName())) {
if (fact.getUpdatePeriods().isEmpty()) { log.info("Not considering fact: {} as it has no update periods", fact.getName()); } else if (validFactTables != null && !validFactTables.contains(fact.getName())) {
for (UpdatePeriod updatePeriod : sc.getFact().getUpdatePeriods().get(sc.getStorageName())) { if (maxInterval != null && updatePeriod.compareTo(maxInterval) > 0) {
for (UpdatePeriod updatePeriod : sc.getFact().getUpdatePeriods().get(sc.getStorageName())) { if (maxInterval != null && updatePeriod.compareTo(maxInterval) > 0) {