@Override public Set<String> getStorages() { return this.sourceCubeFactTable.getStorages(); }
@Override public Set<String> getStorages() { return this.sourceCubeFactTable.getStorages(); }
/** extract storage name from fact and storage table name. String operation */ private String extractStorageName(FactTable fact, String storageTableName) throws LensException { int ind = storageTableName.lastIndexOf(fact.getSourceFactName()); if (ind <= 0) { throw new LensException("storageTable: " + storageTableName + ", does not belong to fact: " + fact.getName()); } String name = storageTableName.substring(0, ind - StorageConstants.STORGAE_SEPARATOR.length()); for (String storageName : fact.getStorages()) { if (name.equalsIgnoreCase(storageName)) { return storageName; } } throw new LensException("storageTable: " + storageTableName + ", does not belong to fact: " + fact.getName()); }
/** extract storage name from fact and storage table name. String operation */ private String extractStorageName(FactTable fact, String storageTableName) throws LensException { int ind = storageTableName.lastIndexOf(fact.getSourceFactName()); if (ind <= 0) { throw new LensException("storageTable: " + storageTableName + ", does not belong to fact: " + fact.getName()); } String name = storageTableName.substring(0, ind - StorageConstants.STORGAE_SEPARATOR.length()); for (String storageName : fact.getStorages()) { if (name.equalsIgnoreCase(storageName)) { return storageName; } } throw new LensException("storageTable: " + storageTableName + ", does not belong to fact: " + fact.getName()); }
/** * Drop a fact with cascade flag * * @param factName fact name * @param cascade If true, will drop all the storages of the fact * @throws LensException */ public void dropFact(String factName, boolean cascade) throws LensException { getTableWithTypeFailFast(factName, CubeTableType.FACT); FactTable fact = getFactTable(factName); if (cascade) { for (String storage : fact.getStorages()) { dropStorageFromFact(factName, storage, false); } } dropHiveTable(factName); allFactTables.remove(factName.trim().toLowerCase()); if (fact.isVirtualFact()) { String sourceFactTable = fact.getProperties().get(getSourceFactNameKey(fact.getName())); if (factToVirtualFactMapping.get(sourceFactTable) != null && factToVirtualFactMapping.get(sourceFactTable).contains(fact.getName())) { factToVirtualFactMapping.get(sourceFactTable).remove(fact.getName()); } } else { dropAllVirtualFactTables(factName); } }
/** * Drop a fact with cascade flag * * @param factName fact name * @param cascade If true, will drop all the storages of the fact * @throws LensException */ public void dropFact(String factName, boolean cascade) throws LensException { getTableWithTypeFailFast(factName, CubeTableType.FACT); FactTable fact = getFactTable(factName); checkIfAuthorized(); if (cascade) { for (String storage : fact.getStorages()) { dropStorageFromFact(factName, storage, false); } } dropHiveTable(factName); allFactTables.remove(factName.trim().toLowerCase()); if (fact.isVirtualFact()) { String sourceFactTable = fact.getProperties().get(getSourceFactNameKey(fact.getName())); if (factToVirtualFactMapping.get(sourceFactTable) != null && factToVirtualFactMapping.get(sourceFactTable).contains(fact.getName())) { factToVirtualFactMapping.get(sourceFactTable).remove(fact.getName()); } } else { dropAllVirtualFactTables(factName); } }
boolean updated = false; 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,
boolean updated = false; 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,
log.info("Not considering fact: {} as it's not valid as per user configuration.", fact.getName()); } else { for (String s : fact.getStorages()) { StorageCandidate sc = new StorageCandidate(cubeql.getCube(), fact, s, cubeql); if (isStorageSupportedOnDriver(sc.getStorageName())) {
log.info("Not considering fact: {} as it's not valid as per user configuration.", fact.getName()); } else { for (String s : fact.getStorages()) { StorageCandidate sc = new StorageCandidate(cubeql.getCube(), fact, s, cubeql); if (isStorageSupportedOnDriver(sc.getStorageName())) {