public class CubeMetastoreClient extends Object
| Modifier and Type | Method and Description | 
|---|---|
| static Map<String,String> | addFactColStartTimePropertyToFactProperties(XFactTable fact) | 
| List<org.apache.hadoop.hive.ql.metadata.Partition> | addPartition(StoragePartitionDesc partSpec,
            String storageName,
            CubeTableType type)Add a partition specified by the storage partition desc on the storage passed. | 
| List<org.apache.hadoop.hive.ql.metadata.Partition> | addPartitions(List<StoragePartitionDesc> storagePartitionDescs,
             String storageName,
             CubeTableType type)batch addition | 
| void | addStorage(CubeDimensionTable dim,
          String storage,
          UpdatePeriod dumpPeriod,
          StorageTableDesc storageTableDesc)Adds storage to dimension and creates corresponding storage table | 
| void | addStorage(CubeFactTable fact,
          String storage,
          Set<UpdatePeriod> updatePeriods,
          Map<String,StorageTableDesc> storageTableDescs,
          Map<UpdatePeriod,String> updatePeriodStoragePrefix)Adds storage to fact and creates corresponding storage table | 
| void | alterCube(String cubeName,
         CubeInterface cube)Alter cube specified by the name to new definition | 
| void | alterCube(XCube cube) | 
| void | alterCubeDimensionTable(String dimTableName,
                       CubeDimensionTable cubeDimensionTable,
                       Map<String,StorageTableDesc> storageTableDescs)Alter dimension table with new dimension definition and underlying storage tables as well | 
| void | alterCubeDimensionTable(XDimensionTable dimensionTable) | 
| void | alterCubeFactTable(String factTableName,
                  FactTable cubeFactTable,
                  Map<String,StorageTableDesc> storageTableDescs,
                  Map<String,String> props)Alter a cubefact with new definition and alter underlying storage tables as well. | 
| void | alterCubeFactTable(XFact fact) | 
| void | alterDimension(String dimName,
              Dimension newDim) | 
| void | alterDimension(XDimension newDim)Alter dimension specified by the dimension name to new definition | 
| void | alterHiveTable(String table,
              org.apache.hadoop.hive.ql.metadata.Table hiveTable) | 
| void | alterSegmentation(String segName,
                 Segmentation seg) | 
| void | alterSegmentation(XSegmentation cubeSeg) | 
| void | alterStorage(String storageName,
            Storage storage) | 
| void | alterStorage(XStorage storage)Alter storage specified by the name to new definition | 
| void | alterVirtualCubeFactTable(CubeVirtualFactTable cubeVirtualFactTable)Alter a virtual cube fact with new definition | 
| void | clearHiveTableCache()clear hive table cache | 
| static void | close()Close the current metastore client | 
| void | createCube(CubeInterface cube)Create cube in metastore defined by  CubeorDerivedCubeobject | 
| void | createCube(String name,
          Set<CubeMeasure> measures,
          Set<CubeDimAttribute> dimensions)Create cube defined by measures and dimensions | 
| void | createCube(String name,
          Set<CubeMeasure> measures,
          Set<CubeDimAttribute> dimensions,
          Map<String,String> properties)Create cube defined by measures, dimensions and properties | 
| void | createCube(String name,
          Set<CubeMeasure> measures,
          Set<CubeDimAttribute> dimensions,
          Set<ExprColumn> expressions,
          Map<String,String> properties)Create cube defined by measures, dimensions and properties | 
| void | createCube(String name,
          Set<CubeMeasure> measures,
          Set<CubeDimAttribute> dimensions,
          Set<ExprColumn> expressions,
          Set<JoinChain> chains,
          Map<String,String> properties)Create cube defined by measures, dimensions and properties | 
| void | createCube(XCube cube) | 
| void | createCubeDimensionTable(String dimName,
                        String dimTblName,
                        List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns,
                        double weight,
                        Map<String,UpdatePeriod> dumpPeriods,
                        Map<String,String> properties,
                        Map<String,StorageTableDesc> storageTableDescs)Create a cube dimension table | 
| void | createCubeDimensionTable(String dimName,
                        String dimTblName,
                        List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns,
                        double weight,
                        Set<String> storageNames,
                        Map<String,String> properties,
                        Map<String,StorageTableDesc> storageTableDescs)Create a cube dimension table | 
| void | createCubeDimensionTable(XDimensionTable xDimTable) | 
| void | createCubeFactTable(String cubeName,
                   String factName,
                   List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns,
                   Map<String,Set<UpdatePeriod>> storageAggregatePeriods,
                   double weight,
                   Map<String,String> properties,
                   Map<String,StorageTableDesc> storageTableDescs)Create a cube fact table | 
| void | createCubeFactTable(String cubeName,
                   String factName,
                   List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns,
                   Map<String,Set<UpdatePeriod>> storageAggregatePeriods,
                   double weight,
                   Map<String,String> properties,
                   Map<String,StorageTableDesc> storageTableDescs,
                   Map<String,Map<UpdatePeriod,String>> storageUpdatePeriodMap) | 
| void | createCubeTable(AbstractCubeTable cubeTable,
               Map<String,StorageTableDesc> storageTableDescs)Create cube table defined and create all the corresponding storage tables | 
| void | createDerivedCube(String parent,
                 String name,
                 Set<String> measures,
                 Set<String> dimensions,
                 Map<String,String> properties,
                 double weight)Create derived cube defined by measures, dimensions and properties | 
| void | createDimension(Dimension dim)Create dimension in metastore defined by  Dimensionobject | 
| void | createDimension(String name,
               Set<CubeDimAttribute> attributes,
               Map<String,String> properties,
               double weight)Create dimension defined by attributes and properties | 
| void | createDimension(XDimension dim) | 
| <T extends org.jvnet.jaxb2_commons.lang.Equals & org.jvnet.jaxb2_commons.lang.HashCode & org.jvnet.jaxb2_commons.lang.ToString> | createEntity(T entity) | 
| void | createFactTable(XFact fact) | 
| void | createSegmentation(Segmentation cubeSeg) | 
| void | createSegmentation(String baseCubeName,
                  String segmentationName,
                  Set<Segment> segments,
                  double weight,
                  Map<String,String> properties) | 
| void | createSegmentation(XSegmentation cubeSeg) | 
| void | createStorage(Storage storage) | 
| void | createStorage(XStorage storage) | 
| void | createVirtualFactTable(String cubeName,
                      String virtualFactName,
                      String sourceFactName,
                      Double weight,
                      Map<String,String> properties) | 
| boolean | dimTableLatestPartitionExists(String storageTableName) | 
| void | dropCube(String cubeName)Drop a cube | 
| void | dropDimension(String dimName)Drop a dimension | 
| void | dropDimensionTable(String dimTblName,
                  boolean cascade)Drop the dimension table | 
| void | dropFact(String factName,
        boolean cascade)Drop a fact with cascade  flag | 
| void | dropHiveTable(String table) | 
| void | dropPartition(String cubeTableName,
             String storageName,
             Map<String,Date> timePartSpec,
             Map<String,String> nonTimePartSpec,
             UpdatePeriod updatePeriod)Add a partition specified by the storage partition desc on the storage passed. | 
| void | dropSegmentation(String segName) | 
| void | dropStorage(String storageName)Drop a storage | 
| void | dropStorageFromDim(String dimTblName,
                  String storage)Drop a storage from dimension | 
| void | dropStorageFromFact(String factName,
                   String storage)Drop a storage from fact | 
| void | dropVirtualFact(String virtualFactName)Drop a virtual fact | 
| boolean | factPartitionExists(FactTable fact,
                   FactPartition part,
                   String storageTableName)extract storage name and check in timeline cache for existance | 
| boolean | factPartitionExists(String factName,
                   String storageName,
                   UpdatePeriod updatePeriod,
                   Map<String,Date> partitionTimestamp,
                   Map<String,String> partSpec) | 
| Collection<CubeInterface> | getAllCubes()Get all cubes in metastore | 
| List<DerivedCube> | getAllDerivedQueryableCubes(CubeInterface cube)Get all derived cubes of the cube, that have all fields queryable together | 
| Collection<Dimension> | getAllDimensions()Get all cubes in metastore | 
| Collection<CubeDimensionTable> | getAllDimensionTables()Get all dimension tables in metastore | 
| List<CubeDimensionTable> | getAllDimensionTables(Dimension dim)Get all dimension tables of the dimension. | 
| Collection<FactTable> | getAllFacts()Get all facts in metastore | 
| Collection<FactTable> | getAllFacts(boolean includeVirtualFacts)Get all facts in metastore (virtual facts optional) | 
| List<FactTable> | getAllFacts(CubeInterface cube)Get all fact tables of the cube. | 
| List<FactTable> | getAllFacts(CubeInterface cube,
           boolean includeVirtualFacts)Get all facts of cube (optional virtual facts) | 
| List<org.apache.hadoop.hive.ql.metadata.Partition> | getAllParts(String storageTableName) | 
| Collection<Segmentation> | getAllSegmentations()Get all segmentations in metastore | 
| List<Segmentation> | getAllSegmentations(CubeInterface cube) | 
| Collection<Storage> | getAllStorages()Get all storages in metastore | 
| DataCompletenessChecker | getCompletenessChecker() | 
| org.apache.hadoop.hive.conf.HiveConf | getConf()Get cube metastore client conf | 
| CubeInterface | getCube(String tableName)Get  Cubeobject corresponding to the name | 
| CubeFactTable | getCubeFactTable(String factName) | 
| CubeVirtualFactTable | getCubeVirtualFactTable(String factName) | 
| Dimension | getDimension(String tableName)Get  Cubeobject corresponding to the name | 
| CubeDimensionTable | getDimensionTable(String tableName)Get  CubeDimensionTableobject corresponding to the name | 
| FactTable | getFactTable(String tableName)Get  Cubeobject corresponding to the name | 
| org.apache.hadoop.hive.ql.metadata.Table | getHiveTable(String tableName)Get the hive  Tablecorresponding to the name | 
| static CubeMetastoreClient | getInstance(org.apache.hadoop.hive.conf.HiveConf conf)Get the instance of  CubeMetastoreClientcorresponding toHiveConf | 
| Date | getLatestDateOfCube(Cube cube,
                   String timeDimension)get latest date for timeDimension from all fact-storage tables belonging to the given cube having timeDimension,
 return the most recent of all. | 
| org.apache.hadoop.hive.ql.metadata.Partition | getPartitionByFilter(String storageTableName,
                    String filter) | 
| List<org.apache.hadoop.hive.ql.metadata.Partition> | getPartitionsByFilter(String storageTableName,
                     String filter) | 
| Segmentation | getSegmentation(String segName) | 
| Segmentation | getSegmentation(String segName,
               boolean throwException) | 
| Segmentation | getSegmentationTable(String tableName) | 
| Storage | getStorage(String storageName)Get  Storageobject corresponding to the name | 
| Storage | getStorage(String storageName,
          boolean throwException) | 
| Date | getStorageTableEndDate(String storageTable,
                      FactTable factTableName) | 
| String | getStorageTableName(String factOrDimTableName,
                   String storage,
                   UpdatePeriod updatePeriod) | 
| Set<String> | getStorageTables(FactTable factTable,
                String storage)Returns storage table names for a storage. | 
| Date | getStorageTableStartDate(String storageTable,
                        FactTable factTableName) | 
| org.apache.hadoop.hive.ql.metadata.Table | getTable(String tableName) | 
| org.apache.hadoop.hive.ql.metadata.Table | getTable(String tableName,
        boolean throwException) | 
| org.apache.hadoop.hive.ql.metadata.Table | getTableWithType(String tableName,
                CubeTableType type,
                boolean throwException) | 
| org.apache.hadoop.hive.ql.metadata.Table | getTableWithTypeFailFast(String tableName,
                        CubeTableType type) | 
| List<PartitionTimeline> | getTimelines(String factName,
            String storage,
            String updatePeriodStr,
            String timeDimension) | 
| List<String> | getTimePartColNamesOfTable(String storageTableName) | 
| List<String> | getTimePartColNamesOfTable(org.apache.hadoop.hive.ql.metadata.Table table)extract from table properties | 
| XDimensionTable | getXDimensionTable(CubeDimensionTable dimTable) | 
| XDimensionTable | getXDimensionTable(String dimTable) | 
| XFact | getXFactTable(FactTable ft) | 
| XFact | getXFactTable(String tableName) | 
| boolean | isCube(String tableName)Is the table name passed a cube? | 
| boolean | isDataCompletenessCheckEnabled() | 
| boolean | isDimension(String tableName)Is the table name passed a dimension? | 
| boolean | isDimensionTable(String tableName)Is the table name passed a dimension table? | 
| boolean | isFactTable(String tableName)Is the table name passed a fact table? | 
| boolean | isLensQueryableTable(String tableName) | 
| boolean | isStorageTableCandidateForRange(String storageTableName,
                               Date fromDate,
                               Date toDate) | 
| boolean | isStorageTableCandidateForRange(String storageTableName,
                               String fromDate,
                               String toDate) | 
| boolean | isStorageTablePartitionACandidate(String storageTableName,
                                 Date partDate) | 
| boolean | isVirtualFactTable(String virtualTableName)Is the table name passed a virtual fact table? | 
| boolean | partColExists(FactTable factTable,
             String storage,
             String partCol) | 
| boolean | partitionExists(String storageTableName,
               UpdatePeriod updatePeriod,
               Map<String,Date> partitionTimestamps) | 
| boolean | partitionExistsByFilter(String storageTableName,
                       String filter) | 
| boolean | partitionExistsByFilter(String cubeTableName,
                       String storageName,
                       UpdatePeriod updatePeriod,
                       String filter) | 
| void | pushHiveTable(org.apache.hadoop.hive.ql.metadata.Table hiveTable) | 
| boolean | tableExists(String tblName) | 
| <T extends org.jvnet.jaxb2_commons.lang.Equals & org.jvnet.jaxb2_commons.lang.HashCode & org.jvnet.jaxb2_commons.lang.ToString> | updateEntity(String name,
            T entity) | 
| void | updatePartition(String fact,
               String storageName,
               org.apache.hadoop.hive.ql.metadata.Partition partition,
               UpdatePeriod updatePeriod) | 
| void | updatePartitions(String factOrDimtableName,
                String storageName,
                Map<UpdatePeriod,List<org.apache.hadoop.hive.ql.metadata.Partition>> partitions) | 
| void | verifyStorageExists(AbstractCubeTable cdt,
                   String storage) | 
public DataCompletenessChecker getCompletenessChecker()
public boolean isDataCompletenessCheckEnabled()
public Date getLatestDateOfCube(Cube cube, String timeDimension) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
cube - Cube to get latest date oftimeDimension - time dimensionorg.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic void clearHiveTableCache()
public List<PartitionTimeline> getTimelines(String factName, String storage, String updatePeriodStr, String timeDimension) throws LensException, org.apache.hadoop.hive.ql.metadata.HiveException
LensExceptionorg.apache.hadoop.hive.ql.metadata.HiveExceptionpublic void updatePartition(String fact, String storageName, org.apache.hadoop.hive.ql.metadata.Partition partition, UpdatePeriod updatePeriod) throws org.apache.hadoop.hive.ql.metadata.HiveException, org.apache.hadoop.hive.metastore.api.InvalidOperationException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionorg.apache.hadoop.hive.metastore.api.InvalidOperationExceptionLensExceptionpublic void updatePartitions(String factOrDimtableName, String storageName, Map<UpdatePeriod,List<org.apache.hadoop.hive.ql.metadata.Partition>> partitions) throws org.apache.hadoop.hive.ql.metadata.HiveException, org.apache.hadoop.hive.metastore.api.InvalidOperationException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionorg.apache.hadoop.hive.metastore.api.InvalidOperationExceptionLensExceptionpublic boolean isLensQueryableTable(String tableName)
public void verifyStorageExists(AbstractCubeTable cdt, String storage) throws LensException
LensExceptionpublic void createCubeFactTable(String cubeName, String factName, List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns, Map<String,Set<UpdatePeriod>> storageAggregatePeriods, double weight, Map<String,String> properties, Map<String,StorageTableDesc> storageTableDescs, Map<String,Map<UpdatePeriod,String>> storageUpdatePeriodMap) throws LensException
LensExceptionpublic <T extends org.jvnet.jaxb2_commons.lang.Equals & org.jvnet.jaxb2_commons.lang.HashCode & org.jvnet.jaxb2_commons.lang.ToString> void createEntity(T entity)
                                                                                                                                                  throws LensException
LensExceptionpublic <T extends org.jvnet.jaxb2_commons.lang.Equals & org.jvnet.jaxb2_commons.lang.HashCode & org.jvnet.jaxb2_commons.lang.ToString> void updateEntity(String name, T entity) throws LensException, org.apache.hadoop.hive.ql.metadata.HiveException
LensExceptionorg.apache.hadoop.hive.ql.metadata.HiveExceptionpublic static Map<String,String> addFactColStartTimePropertyToFactProperties(XFactTable fact)
public void createFactTable(XFact fact) throws LensException
LensExceptionpublic void createVirtualFactTable(String cubeName, String virtualFactName, String sourceFactName, Double weight, Map<String,String> properties) throws LensException
LensExceptionpublic static CubeMetastoreClient getInstance(org.apache.hadoop.hive.conf.HiveConf conf) throws org.apache.hadoop.hive.ql.metadata.HiveException
CubeMetastoreClient corresponding to HiveConfconf - conforg.apache.hadoop.hive.ql.metadata.HiveExceptionpublic org.apache.hadoop.hive.conf.HiveConf getConf()
public static void close()
public void createStorage(XStorage storage) throws LensException
LensExceptionpublic void createStorage(Storage storage) throws LensException
LensExceptionpublic void createCube(XCube cube) throws LensException
LensExceptionpublic void createCube(CubeInterface cube) throws LensException
Cube or DerivedCube objectcube - the Cube object.LensExceptionpublic void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions) throws LensException
name - Name of the cubemeasures - Measures of the cubedimensions - Dimensions of the cubeLensExceptionpublic void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions, Map<String,String> properties) throws LensException
name - Name of the cubemeasures - Measures of the cubedimensions - Dimensions of the cubeproperties - Properties of the cubeLensExceptionpublic void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions, Set<ExprColumn> expressions, Map<String,String> properties) throws LensException
name - Name of the cubemeasures - Measures of the cubedimensions - Dimensions of the cubeproperties - Properties of the cubeLensExceptionpublic void createCube(String name, Set<CubeMeasure> measures, Set<CubeDimAttribute> dimensions, Set<ExprColumn> expressions, Set<JoinChain> chains, Map<String,String> properties) throws LensException
name - Name of the cubemeasures - Measures of the cubedimensions - Dimensions of the cubeexpressions - Expressions of the cubechains - JoinChains of the cubeproperties - Properties of the cubeLensExceptionpublic void createDimension(String name, Set<CubeDimAttribute> attributes, Map<String,String> properties, double weight) throws LensException
name - Name of the dimensionattributes - Attributes of the dimensionproperties - Properties of the dimensionweight - Weight of the dimensionLensExceptionpublic void createDimension(XDimension dim) throws LensException
LensExceptionpublic void createDimension(Dimension dim) throws LensException
Dimension objectdim - the Dimension object.LensExceptionpublic void createDerivedCube(String parent, String name, Set<String> measures, Set<String> dimensions, Map<String,String> properties, double weight) throws LensException
parent - Name of the parent cubename - Name of the derived cubemeasures - Measures of the derived cubedimensions - Dimensions of the derived cubeproperties - Properties of the derived cubeweight - Weight of the derived cubeLensExceptionpublic void createCubeFactTable(String cubeName, String factName, List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns, Map<String,Set<UpdatePeriod>> storageAggregatePeriods, double weight, Map<String,String> properties, Map<String,StorageTableDesc> storageTableDescs) throws LensException
cubeName - The cube name to which fact belongs to.factName - The fact namecolumns - The columns of fact tablestorageAggregatePeriods - Aggregate periods for the storagesweight - Weight of the cubeproperties - Properties of fact tablestorageTableDescs - Map of storage table prefix to its storage table descriptionLensExceptionpublic void createSegmentation(String baseCubeName, String segmentationName, Set<Segment> segments, double weight, Map<String,String> properties) throws LensException
baseCubeName - The cube name ot which segmentation belong tosegmentationName - The segmentation namesegments - Participating cube segementsweight - Weight of segmentationproperties - Properties of segmentationLensExceptionpublic void createCubeDimensionTable(XDimensionTable xDimTable) throws LensException
LensExceptionpublic void createCubeDimensionTable(String dimName, String dimTblName, List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns, double weight, Set<String> storageNames, Map<String,String> properties, Map<String,StorageTableDesc> storageTableDescs) throws LensException
dimName - The dimension name to which the dim-table belongs todimTblName - dimension table namecolumns - Columns of the dimension tableweight - Weight of the dimension tablestorageNames - Storages on which dimension is available without any dumpsproperties - Properties of dimension tablestorageTableDescs - Map of storage to its storage table descriptionLensExceptionpublic void createCubeDimensionTable(String dimName, String dimTblName, List<org.apache.hadoop.hive.metastore.api.FieldSchema> columns, double weight, Map<String,UpdatePeriod> dumpPeriods, Map<String,String> properties, Map<String,StorageTableDesc> storageTableDescs) throws LensException
dimName - The dimension name to which the dim-table belongs todimTblName - dimension table namecolumns - Columns of the dimension tableweight - Weight of the dimension tabledumpPeriods - Storage names and their dump periods on which dimension is availableproperties - properties of dimension tablestorageTableDescs - Map of storage to its storage table descriptionLensExceptionpublic void createCubeTable(AbstractCubeTable cubeTable, Map<String,StorageTableDesc> storageTableDescs) throws LensException
cubeTable - Can be fact or dimension tablestorageTableDescs - Map of storage tableName prefix to its storage table descriptionLensExceptionpublic void createSegmentation(XSegmentation cubeSeg) throws LensException
LensExceptionpublic void createSegmentation(Segmentation cubeSeg) throws LensException
LensExceptionpublic void addStorage(CubeFactTable fact, String storage, Set<UpdatePeriod> updatePeriods, Map<String,StorageTableDesc> storageTableDescs, Map<UpdatePeriod,String> updatePeriodStoragePrefix) throws LensException
fact - The CubeFactTablestorage - The storageupdatePeriods - Update periods of the fact on the storagestorageTableDescs - The storage table descriptionLensExceptionpublic void addStorage(CubeDimensionTable dim, String storage, UpdatePeriod dumpPeriod, StorageTableDesc storageTableDesc) throws LensException
dim - The CubeDimensionTablestorage - The storagedumpPeriod - The dumpPeriod if any, null otherwisestorageTableDesc - The storage table descriptionLensExceptionpublic List<org.apache.hadoop.hive.ql.metadata.Partition> addPartition(StoragePartitionDesc partSpec, String storageName, CubeTableType type) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
partSpec - The storage partition descriptionstorageName - The storage objecttype - org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic List<org.apache.hadoop.hive.ql.metadata.Partition> addPartitions(List<StoragePartitionDesc> storagePartitionDescs, String storageName, CubeTableType type) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic Date getStorageTableStartDate(String storageTable, FactTable factTableName) throws LensException
LensExceptionpublic Date getStorageTableEndDate(String storageTable, FactTable factTableName) throws LensException
LensExceptionpublic void dropPartition(String cubeTableName, String storageName, Map<String,Date> timePartSpec, Map<String,String> nonTimePartSpec, UpdatePeriod updatePeriod) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
cubeTableName - cube fact/dimension table namestorageName - storage nametimePartSpec - time partitionsnonTimePartSpec - non time partitionsupdatePeriod - update period of the partitionorg.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic boolean tableExists(String tblName) throws org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.ql.metadata.HiveExceptionpublic boolean factPartitionExists(FactTable fact, FactPartition part, String storageTableName) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic boolean factPartitionExists(String factName, String storageName, UpdatePeriod updatePeriod, Map<String,Date> partitionTimestamp, Map<String,String> partSpec) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic boolean partitionExists(String storageTableName, UpdatePeriod updatePeriod, Map<String,Date> partitionTimestamps) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic boolean partitionExistsByFilter(String cubeTableName, String storageName, UpdatePeriod updatePeriod, String filter) throws LensException
LensExceptionpublic boolean partitionExistsByFilter(String storageTableName, String filter) throws LensException
LensExceptionpublic List<org.apache.hadoop.hive.ql.metadata.Partition> getAllParts(String storageTableName) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic org.apache.hadoop.hive.ql.metadata.Partition getPartitionByFilter(String storageTableName, String filter) throws org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.ql.metadata.HiveExceptionpublic List<org.apache.hadoop.hive.ql.metadata.Partition> getPartitionsByFilter(String storageTableName, String filter) throws org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.ql.metadata.HiveExceptionpublic boolean dimTableLatestPartitionExists(String storageTableName)
public org.apache.hadoop.hive.ql.metadata.Table getHiveTable(String tableName) throws LensException
Table corresponding to the nametableName - table nameTable object corresponding to the nameLensExceptionpublic List<String> getTimePartColNamesOfTable(String storageTableName) throws LensException
LensExceptionpublic List<String> getTimePartColNamesOfTable(org.apache.hadoop.hive.ql.metadata.Table table)
public org.apache.hadoop.hive.ql.metadata.Table getTableWithTypeFailFast(String tableName, CubeTableType type) throws LensException
LensExceptionpublic org.apache.hadoop.hive.ql.metadata.Table getTableWithType(String tableName, CubeTableType type, boolean throwException) throws LensException
LensExceptionpublic org.apache.hadoop.hive.ql.metadata.Table getTable(String tableName) throws LensException
LensExceptionpublic org.apache.hadoop.hive.ql.metadata.Table getTable(String tableName, boolean throwException) throws LensException
LensExceptionpublic void dropHiveTable(String table) throws LensException
LensExceptionpublic boolean isFactTable(String tableName) throws LensException
tableName - table nameorg.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic boolean isVirtualFactTable(String virtualTableName) throws LensException
virtualTableName - table nameorg.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic boolean isDimensionTable(String tableName) throws LensException
tableName - table nameLensExceptionpublic boolean isCube(String tableName) throws LensException
tableName - table nameLensExceptionpublic boolean isDimension(String tableName) throws LensException
tableName - table nameLensExceptionpublic XFact getXFactTable(String tableName) throws LensException
LensExceptionpublic XFact getXFactTable(FactTable ft) throws LensException
LensExceptionpublic Segmentation getSegmentationTable(String tableName) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic XDimensionTable getXDimensionTable(String dimTable) throws LensException
LensExceptionpublic XDimensionTable getXDimensionTable(CubeDimensionTable dimTable) throws LensException
LensExceptionpublic CubeDimensionTable getDimensionTable(String tableName) throws LensException
CubeDimensionTable object corresponding to the nametableName - The cube dimension nameLensException - if there is no dimension table with the namepublic Storage getStorage(String storageName) throws LensException
Storage object corresponding to the namestorageName - The storage nameLensException - if there is no storage by the namepublic Storage getStorage(String storageName, boolean throwException) throws LensException
LensExceptionpublic CubeInterface getCube(String tableName) throws LensException
Cube object corresponding to the nametableName - The cube nameLensException - when the table name does not correspond to a cubepublic Dimension getDimension(String tableName) throws LensException
Cube object corresponding to the nametableName - The cube nameLensException - if the table name passed is not a Dimensionpublic FactTable getFactTable(String tableName) throws LensException
Cube object corresponding to the nametableName - The cube nameLensException - if there is no cube by the namepublic Segmentation getSegmentation(String segName) throws LensException
LensExceptionpublic Segmentation getSegmentation(String segName, boolean throwException) throws LensException
LensExceptionpublic Collection<CubeDimensionTable> getAllDimensionTables() throws LensException
LensExceptionpublic Collection<Storage> getAllStorages() throws LensException
LensExceptionpublic Collection<CubeInterface> getAllCubes() throws LensException
LensExceptionpublic Collection<Dimension> getAllDimensions() throws LensException
LensExceptionpublic Collection<FactTable> getAllFacts() throws LensException
LensExceptionpublic Collection<FactTable> getAllFacts(boolean includeVirtualFacts) throws LensException
includeVirtualFacts - set true for including virtual factsLensExceptionpublic Collection<Segmentation> getAllSegmentations() throws LensException
LensExceptionpublic List<FactTable> getAllFacts(CubeInterface cube) throws LensException
cube - Cube objectLensExceptionpublic List<FactTable> getAllFacts(CubeInterface cube, boolean includeVirtualFacts) throws LensException
cube - Cube objectincludeVirtualFacts - set true for virtual factsLensExceptionpublic List<Segmentation> getAllSegmentations(CubeInterface cube) throws LensException
LensExceptionpublic List<DerivedCube> getAllDerivedQueryableCubes(CubeInterface cube) throws LensException
cube - Cube objectLensExceptionpublic List<CubeDimensionTable> getAllDimensionTables(Dimension dim) throws LensException
dim - Dimension objectLensExceptionpublic boolean partColExists(FactTable factTable, String storage, String partCol) throws LensException
LensExceptionpublic Set<String> getStorageTables(FactTable factTable, String storage) throws LensException
factTable - storage - LensExceptionpublic void pushHiveTable(org.apache.hadoop.hive.ql.metadata.Table hiveTable)
                   throws org.apache.hadoop.hive.ql.metadata.HiveException,
                          LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic void alterHiveTable(String table, org.apache.hadoop.hive.ql.metadata.Table hiveTable) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic void alterCube(XCube cube) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic void alterCube(String cubeName, CubeInterface cube) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
cubeName - The cube name to be alteredcube - The new cube definition Cube or DerivedCubeorg.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic void alterDimension(XDimension newDim) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
newDim - The new dimension definitionorg.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic void alterDimension(String dimName, Dimension newDim) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic void alterStorage(XStorage storage) throws LensException, org.apache.hadoop.hive.ql.metadata.HiveException
storage - The new storage definitionLensExceptionorg.apache.hadoop.hive.ql.metadata.HiveExceptionpublic void alterStorage(String storageName, Storage storage) throws LensException, org.apache.hadoop.hive.ql.metadata.HiveException
LensExceptionorg.apache.hadoop.hive.ql.metadata.HiveExceptionpublic void dropStorage(String storageName) throws LensException
storageName - storage nameLensExceptionpublic void dropCube(String cubeName) throws LensException
cubeName - cube nameLensExceptionpublic void dropDimension(String dimName) throws LensException
dimName - dimension name to be droppedLensExceptionpublic void dropFact(String factName, boolean cascade) throws LensException
factName - fact namecascade - If true, will drop all the storages of the factLensExceptionpublic void dropVirtualFact(String virtualFactName) throws LensException
virtualFactName - virtual fact nameLensExceptionpublic void dropSegmentation(String segName) throws LensException
LensExceptionpublic void dropStorageFromFact(String factName, String storage) throws LensException
factName - fact namestorage - storage nameLensExceptionpublic void dropStorageFromDim(String dimTblName, String storage) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
dimTblName - dim table namestorage - storageorg.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic void dropDimensionTable(String dimTblName, boolean cascade) throws LensException
dimTblName - dim table namecascade - If true, will drop all the dimension storagesorg.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic void alterCubeFactTable(XFact fact) throws LensException, org.apache.hadoop.hive.ql.metadata.HiveException
LensExceptionorg.apache.hadoop.hive.ql.metadata.HiveExceptionpublic void alterCubeFactTable(String factTableName, FactTable cubeFactTable, Map<String,StorageTableDesc> storageTableDescs, Map<String,String> props) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
factTableName - fact table namecubeFactTable - cube fact tablestorageTableDescs - storage table desc objectsorg.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic void alterSegmentation(XSegmentation cubeSeg) throws LensException, org.apache.hadoop.hive.ql.metadata.HiveException
LensExceptionorg.apache.hadoop.hive.ql.metadata.HiveExceptionpublic void alterVirtualCubeFactTable(CubeVirtualFactTable cubeVirtualFactTable) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
cubeVirtualFactTable - cube virtual fact tableorg.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic void alterSegmentation(String segName, Segmentation seg) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic CubeFactTable getCubeFactTable(String factName) throws LensException
LensExceptionpublic CubeVirtualFactTable getCubeVirtualFactTable(String factName) throws LensException
LensExceptionpublic void alterCubeDimensionTable(XDimensionTable dimensionTable) throws LensException, org.apache.hadoop.hive.ql.metadata.HiveException
LensExceptionorg.apache.hadoop.hive.ql.metadata.HiveExceptionpublic void alterCubeDimensionTable(String dimTableName, CubeDimensionTable cubeDimensionTable, Map<String,StorageTableDesc> storageTableDescs) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
dimTableName - dim table namecubeDimensionTable - cube dimention tableorg.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic boolean isStorageTableCandidateForRange(String storageTableName, Date fromDate, Date toDate) throws LensException
LensExceptionpublic boolean isStorageTablePartitionACandidate(String storageTableName, Date partDate) throws LensException
LensExceptionpublic boolean isStorageTableCandidateForRange(String storageTableName, String fromDate, String toDate) throws org.apache.hadoop.hive.ql.metadata.HiveException, LensException
org.apache.hadoop.hive.ql.metadata.HiveExceptionLensExceptionpublic String getStorageTableName(String factOrDimTableName, String storage, UpdatePeriod updatePeriod) throws LensException
LensExceptionCopyright © 2014–2018 Apache Software Foundation. All rights reserved.