/** * Drop a storage * * @param storageName storage name * @throws LensException */ public void dropStorage(String storageName) throws LensException { getTableWithTypeFailFast(storageName, CubeTableType.STORAGE); allStorages.remove(storageName.trim().toLowerCase()); dropHiveTable(storageName); }
public void dropSegmentation(String segName) throws LensException { getTableWithTypeFailFast(segName, CubeTableType.SEGMENTATION); dropHiveTable(segName); allSegmentations.remove(segName.trim().toLowerCase()); }
/** * Drop a cube * * @param cubeName cube name * @throws LensException */ public void dropCube(String cubeName) throws LensException { getTableWithTypeFailFast(cubeName, CubeTableType.CUBE); allCubes.remove(cubeName.trim().toLowerCase()); dropHiveTable(cubeName); }
/** * Drop a dimension * * @param dimName dimension name to be dropped * @throws LensException */ public void dropDimension(String dimName) throws LensException { getTableWithTypeFailFast(dimName, CubeTableType.DIMENSION); allDims.remove(dimName.trim().toLowerCase()); dropHiveTable(dimName); }
/** * Drop a storage * * @param storageName storage name * @throws LensException */ public void dropStorage(String storageName) throws LensException { getTableWithTypeFailFast(storageName, CubeTableType.STORAGE); allStorages.remove(storageName.trim().toLowerCase()); dropHiveTable(storageName); }
public void dropSegmentation(String segName) throws LensException { getTableWithTypeFailFast(segName, CubeTableType.SEGMENTATION); checkIfAuthorized(); dropHiveTable(segName); allSegmentations.remove(segName.trim().toLowerCase()); }
/** * Drop a dimension * * @param dimName dimension name to be dropped * @throws LensException */ public void dropDimension(String dimName) throws LensException { getTableWithTypeFailFast(dimName, CubeTableType.DIMENSION); checkIfAuthorized(); allDims.remove(dimName.trim().toLowerCase()); dropHiveTable(dimName); }
public void alterDimension(String dimName, Dimension newDim) throws HiveException, LensException { Table tbl = getTableWithTypeFailFast(dimName, CubeTableType.DIMENSION); alterCubeTable(dimName, tbl, newDim); if (enableCaching) { allDims.put(dimName.trim().toLowerCase(), getDimension(refreshTable(dimName))); } }
/** * Drop a cube * * @param cubeName cube name * @throws LensException */ public void dropCube(String cubeName) throws LensException { checkIfAuthorized(); getCube(getTableWithTypeFailFast(cubeName, CubeTableType.CUBE)); allCubes.remove(cubeName.trim().toLowerCase()); dropHiveTable(cubeName); }
public void alterStorage(String storageName, Storage storage) throws LensException, HiveException { Table storageTbl = getTableWithTypeFailFast(storageName, CubeTableType.STORAGE); alterCubeTable(storageName, storageTbl, storage); if (enableCaching) { allStorages.put(storageName.trim().toLowerCase(), getStorage(refreshTable(storageName))); } }
public void alterStorage(String storageName, Storage storage) throws LensException, HiveException { checkIfAuthorized(); Table storageTbl = getTableWithTypeFailFast(storageName, CubeTableType.STORAGE); alterCubeTable(storageName, storageTbl, storage); if (enableCaching) { allStorages.put(storageName.trim().toLowerCase(), getStorage(refreshTable(storageName))); } }
public void alterDimension(String dimName, Dimension newDim) throws HiveException, LensException { checkIfAuthorized(); Table tbl = getTableWithTypeFailFast(dimName, CubeTableType.DIMENSION); alterCubeTable(dimName, tbl, newDim); if (enableCaching) { allDims.put(dimName.trim().toLowerCase(), getDimension(refreshTable(dimName))); } }
private void dropStorageFromDim(String dimTblName, String storage, boolean updateDimTbl) throws LensException { CubeDimensionTable cdt = getDimensionTable(dimTblName); String storageTableName = getFactOrDimtableStorageTableName(dimTblName, storage); dropHiveTable(storageTableName); latestLookupCache.remove(storageTableName.trim().toLowerCase()); if (updateDimTbl) { cdt.dropStorage(storage); alterCubeTable(dimTblName, getTableWithTypeFailFast(dimTblName, CubeTableType.DIM_TABLE), cdt); updateDimCache(dimTblName); } }
@Override public XNativeTable getNativeTable(LensSessionHandle sessionid, String name) throws LensException { try (SessionContext ignored = new SessionContext(sessionid)){ return JAXBUtils.nativeTableFromMetaTable(getClient(sessionid).getTableWithTypeFailFast(name, null)); } }
private void updateFactCache(String factTableName) throws LensException { if (enableCaching) { Table factTbl = getTableWithTypeFailFast(factTableName, CubeTableType.FACT); FactTable refreshedTable; if (factTbl.getParameters().get(getSourceFactNameKey(factTableName)) != null){ String sourceFactName = factTbl.getParameters().get(getSourceFactNameKey(factTableName)); refreshedTable = new CubeVirtualFactTable(refreshTable(factTableName), getCubeFactTable(sourceFactName)); }else { refreshedTable = new CubeFactTable(refreshTable(factTableName)); } allFactTables.put(factTableName.trim().toLowerCase(), refreshedTable); } }
private void dropStorageFromDim(String dimTblName, String storage, boolean updateDimTbl) throws LensException { checkIfAuthorized(); CubeDimensionTable cdt = getDimensionTable(dimTblName); String storageTableName = getFactOrDimtableStorageTableName(dimTblName, storage); dropHiveTable(storageTableName); latestLookupCache.remove(storageTableName.trim().toLowerCase()); if (updateDimTbl) { cdt.dropStorage(storage); alterCubeTable(dimTblName, getTableWithTypeFailFast(dimTblName, CubeTableType.DIM_TABLE), cdt); updateDimCache(dimTblName); } }
public void alterSegmentation(String segName, Segmentation seg) throws HiveException, LensException { getTableWithTypeFailFast(segName, CubeTableType.SEGMENTATION); if (!(getSegmentation(segName) == seg)) { dropSegmentation(segName); createSegmentation(seg); updateSegmentationCache(segName); } }
private void dropStorageFromFact(String factName, String storage, boolean updateFact) throws LensException { dropHiveTablesForStorage(factName, storage); if (updateFact) { CubeFactTable cft = getCubeFactTable(factName); cft.dropStorage(storage); alterCubeTable(factName, getTableWithTypeFailFast(factName, CubeTableType.FACT), cft); updateFactCache(factName); } }
private void dropStorageFromFact(String factName, String storage, boolean updateFact) throws LensException { dropHiveTablesForStorage(factName, storage); if (updateFact) { CubeFactTable cft = getCubeFactTable(factName); cft.dropStorage(storage); alterCubeTable(factName, getTableWithTypeFailFast(factName, CubeTableType.FACT), cft); updateFactCache(factName); } }
public void alterSegmentation(String segName, Segmentation seg) throws HiveException, LensException { getTableWithTypeFailFast(segName, CubeTableType.SEGMENTATION); checkIfAuthorized(); if (!(getSegmentation(segName) == seg)) { dropSegmentation(segName); createSegmentation(seg); updateSegmentationCache(segName); } }