org.apache.lens.cube.metadata
Class CubeMetastoreClient

java.lang.Object
  extended by org.apache.lens.cube.metadata.CubeMetastoreClient

public class CubeMetastoreClient
extends Object

Wrapper class around Hive metastore to do cube metastore operations.


Method Summary
 void addPartition(StoragePartitionDesc partSpec, String storageName)
          Add a partition specified by the storage partition desc on the storage passed.
 void addPartitions(List<StoragePartitionDesc> storagePartitionDescs, String storageName)
           
 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, StorageTableDesc storageTableDesc)
          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 alterCubeDimensionTable(String dimTableName, CubeDimensionTable cubeDimensionTable)
          Alter dimension table with new dimension definition
 void alterCubeFactTable(String factTableName, CubeFactTable cubeFactTable)
          Alter a cubefact with new definition
 void alterDimension(String dimName, Dimension newDim)
          Alter dimension specified by the dimension name to new definition
 void alterStorage(String storageName, Storage storage)
          Alter storage specified by the name to new definition
static void close()
          Close the current metastore client
 void createCube(CubeInterface cube)
          Create cube in metastore defined by Cube or DerivedCube object
 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 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 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 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 Dimension object
 void createDimension(String name, Set<CubeDimAttribute> attributes, Map<String,String> properties, double weight)
          Create dimension defined by attributes and properties
 void createStorage(Storage storage)
           
 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 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
 List<CubeInterface> getAllCubes()
          Get all cubes in metastore
 List<DerivedCube> getAllDerivedCubes(CubeInterface cube)
          Get all derived cubes of the cube.
 List<DerivedCube> getAllDerivedQueryableCubes(CubeInterface cube)
          Get all derived cubes of the cube, that have all fields queryable together
 List<Dimension> getAllDimensions()
          Get all cubes in metastore
 List<CubeDimensionTable> getAllDimensionTables()
          Get all dimension tables in metastore
 List<CubeDimensionTable> getAllDimensionTables(Dimension dim)
          Get all dimension tables of the dimension.
 List<CubeFactTable> getAllFacts()
          Get all facts in metastore
 List<CubeFactTable> getAllFactTables(CubeInterface cube)
          Get all fact tables of the cube.
 List<org.apache.hadoop.hive.ql.metadata.Partition> getAllParts(String storageTableName)
           
 List<Storage> getAllStorages()
          Get all storages in metastore
 org.apache.hadoop.hive.conf.HiveConf getConf()
          Get cube metastore client conf
 CubeInterface getCube(String tableName)
          Get Cube object corresponding to the name
 CubeFactTable getCubeFact(String tableName)
          Get Cube object corresponding to the name
 Dimension getDimension(String tableName)
          Get Cube object corresponding to the name
 CubeDimensionTable getDimensionTable(String tableName)
          Get CubeDimensionTable object corresponding to the name
 CubeFactTable getFactTable(String tableName)
          Get CubeFactTable object corresponding to the name
 org.apache.hadoop.hive.ql.metadata.Table getHiveTable(String tableName)
          Get the hive Table corresponding to the name
static CubeMetastoreClient getInstance(org.apache.hadoop.hive.conf.HiveConf conf)
          Get the instance of CubeMetastoreClient corresponding to HiveConf
 Date getLatestTimeStamp(org.apache.hadoop.hive.ql.metadata.Partition part, String partCol)
           
 int getNumPartitionsByFilter(String storageTableName, String filter)
           
 List<String> getPartColNames(String tableName)
           
 List<org.apache.hadoop.hive.ql.metadata.Partition> getPartitionsByFilter(String storageTableName, String filter)
           
 SchemaGraph getSchemaGraph()
           
 Storage getStorage(String storageName)
          Get Storage object corresponding to the name
 boolean isCube(String tableName)
          Is the table name passed a cube?
 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 isStorage(String tableName)
          Is the table name passed a storage?
 boolean partColExists(String tableName, String partCol)
           
 boolean partitionExists(String storageTableName, UpdatePeriod updatePeriod, Map<String,Date> partitionTimestamps)
           
 boolean partitionExistsByFilter(String storageTableName, String filter)
           
 boolean tableExists(String cubeName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CubeMetastoreClient getInstance(org.apache.hadoop.hive.conf.HiveConf conf)
                                       throws org.apache.hadoop.hive.ql.metadata.HiveException
Get the instance of CubeMetastoreClient corresponding to HiveConf

Parameters:
conf -
Returns:
CubeMetastoreClient
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getConf

public org.apache.hadoop.hive.conf.HiveConf getConf()
Get cube metastore client conf

Returns:
HiveConf

close

public static void close()
Close the current metastore client


createStorage

public void createStorage(Storage storage)
                   throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createCube

public void createCube(CubeInterface cube)
                throws org.apache.hadoop.hive.ql.metadata.HiveException
Create cube in metastore defined by Cube or DerivedCube object

Parameters:
cube - the Cube object.
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createCube

public void createCube(String name,
                       Set<CubeMeasure> measures,
                       Set<CubeDimAttribute> dimensions)
                throws org.apache.hadoop.hive.ql.metadata.HiveException
Create cube defined by measures and dimensions

Parameters:
name - Name of the cube
measures - Measures of the cube
dimensions - Dimensions of the cube
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createCube

public void createCube(String name,
                       Set<CubeMeasure> measures,
                       Set<CubeDimAttribute> dimensions,
                       Map<String,String> properties)
                throws org.apache.hadoop.hive.ql.metadata.HiveException
Create cube defined by measures, dimensions and properties

Parameters:
name - Name of the cube
measures - Measures of the cube
dimensions - Dimensions of the cube
properties - Properties of the cube
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createCube

public void createCube(String name,
                       Set<CubeMeasure> measures,
                       Set<CubeDimAttribute> dimensions,
                       Set<ExprColumn> expressions,
                       Map<String,String> properties)
                throws org.apache.hadoop.hive.ql.metadata.HiveException
Create cube defined by measures, dimensions and properties

Parameters:
name - Name of the cube
measures - Measures of the cube
dimensions - Dimensions of the cube
properties - Properties of the cube
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createCube

public void createCube(String name,
                       Set<CubeMeasure> measures,
                       Set<CubeDimAttribute> dimensions,
                       Set<ExprColumn> expressions,
                       Set<JoinChain> chains,
                       Map<String,String> properties)
                throws org.apache.hadoop.hive.ql.metadata.HiveException
Create cube defined by measures, dimensions and properties

Parameters:
name - Name of the cube
measures - Measures of the cube
dimensions - Dimensions of the cube
expressions - Expressions of the cube
chains - JoinChains of the cube
properties - Properties of the cube
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createDimension

public void createDimension(String name,
                            Set<CubeDimAttribute> attributes,
                            Map<String,String> properties,
                            double weight)
                     throws org.apache.hadoop.hive.ql.metadata.HiveException
Create dimension defined by attributes and properties

Parameters:
name - Name of the dimension
attributes - Attributes of the dimension
properties - Properties of the dimension
weight - Weight of the dimension
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createDimension

public void createDimension(Dimension dim)
                     throws org.apache.hadoop.hive.ql.metadata.HiveException
Create dimension in metastore defined by Dimension object

Parameters:
dim - the Dimension object.
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createDerivedCube

public void createDerivedCube(String parent,
                              String name,
                              Set<String> measures,
                              Set<String> dimensions,
                              Map<String,String> properties,
                              double weight)
                       throws org.apache.hadoop.hive.ql.metadata.HiveException
Create derived cube defined by measures, dimensions and properties

Parameters:
parent - Name of the parent cube
name - Name of the derived cube
measures - Measures of the derived cube
dimensions - Dimensions of the derived cube
properties - Properties of the derived cube
weight - Weight of the derived cube
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createCubeFactTable

public 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 org.apache.hadoop.hive.ql.metadata.HiveException
Create a cube fact table

Parameters:
cubeName - The cube name to which fact belongs to.
factName - The fact name
columns - The columns of fact table
storageAggregatePeriods - Aggregate periods for the storages
weight - Weight of the cube
properties - Properties of fact table
storageTableDescs - Map of storage to its storage table description
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createCubeDimensionTable

public 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 org.apache.hadoop.hive.ql.metadata.HiveException
Create a cube dimension table

Parameters:
dimName - The dimension name to which the dim-table belongs to
dimTblName - dimension table name
columns - Columns of the dimension table
weight - Weight of the dimension table
storageNames - Storages on which dimension is available without any dumps
properties - Properties of dimension table
storageTableDescs - Map of storage to its storage table description
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createCubeDimensionTable

public 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 org.apache.hadoop.hive.ql.metadata.HiveException
Create a cube dimension table

Parameters:
dimName - The dimension name to which the dim-table belongs to
dimTblName - dimension table name
columns - Columns of the dimension table
weight - Weight of the dimension table
dumpPeriods - Storage names and their dump periods on which dimension is available
properties - properties of dimension table
storageTableDescs - Map of storage to its storage table description
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

createCubeTable

public void createCubeTable(AbstractCubeTable cubeTable,
                            Map<String,StorageTableDesc> storageTableDescs)
                     throws org.apache.hadoop.hive.ql.metadata.HiveException
Create cube table defined and create all the corresponding storage tables

Parameters:
cubeTable - Can be fact or dimension table
storageTableDescs - Map of storage to its storage table description
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

addStorage

public void addStorage(CubeFactTable fact,
                       String storage,
                       Set<UpdatePeriod> updatePeriods,
                       StorageTableDesc storageTableDesc)
                throws org.apache.hadoop.hive.ql.metadata.HiveException
Adds storage to fact and creates corresponding storage table

Parameters:
fact - The CubeFactTable
storage - The storage
updatePeriods - Update periods of the fact on the storage
storageTableDesc - The storage table description
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

addStorage

public void addStorage(CubeDimensionTable dim,
                       String storage,
                       UpdatePeriod dumpPeriod,
                       StorageTableDesc storageTableDesc)
                throws org.apache.hadoop.hive.ql.metadata.HiveException
Adds storage to dimension and creates corresponding storage table

Parameters:
dim - The CubeDimensionTable
storage - The storage
dumpPeriod - The dumpPeriod if any, null otherwise
storageTableDesc - The storage table description
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

addPartition

public void addPartition(StoragePartitionDesc partSpec,
                         String storageName)
                  throws org.apache.hadoop.hive.ql.metadata.HiveException
Add a partition specified by the storage partition desc on the storage passed.

Parameters:
partSpec - The storage partition description
storageName - The storage object
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

addPartitions

public void addPartitions(List<StoragePartitionDesc> storagePartitionDescs,
                          String storageName)
                   throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getLatestTimeStamp

public Date getLatestTimeStamp(org.apache.hadoop.hive.ql.metadata.Partition part,
                               String partCol)
                        throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

dropPartition

public void dropPartition(String cubeTableName,
                          String storageName,
                          Map<String,Date> timePartSpec,
                          Map<String,String> nonTimePartSpec,
                          UpdatePeriod updatePeriod)
                   throws org.apache.hadoop.hive.ql.metadata.HiveException
Add a partition specified by the storage partition desc on the storage passed.

Parameters:
cubeTableName - cube fact/dimension table name
storageName - storage name
timePartSpec - time partitions
nonTimePartSpec - non time partitions
updatePeriod - update period of the partition
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

tableExists

public boolean tableExists(String cubeName)
                    throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

partitionExists

public boolean partitionExists(String storageTableName,
                               UpdatePeriod updatePeriod,
                               Map<String,Date> partitionTimestamps)
                        throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

partitionExistsByFilter

public boolean partitionExistsByFilter(String storageTableName,
                                       String filter)
                                throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getAllParts

public List<org.apache.hadoop.hive.ql.metadata.Partition> getAllParts(String storageTableName)
                                                               throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getPartitionsByFilter

public List<org.apache.hadoop.hive.ql.metadata.Partition> getPartitionsByFilter(String storageTableName,
                                                                                String filter)
                                                                         throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getNumPartitionsByFilter

public int getNumPartitionsByFilter(String storageTableName,
                                    String filter)
                             throws org.apache.hadoop.hive.metastore.api.MetaException,
                                    org.apache.hadoop.hive.metastore.api.NoSuchObjectException,
                                    org.apache.hadoop.hive.ql.metadata.HiveException,
                                    org.apache.thrift.TException
Throws:
org.apache.hadoop.hive.metastore.api.MetaException
org.apache.hadoop.hive.metastore.api.NoSuchObjectException
org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.thrift.TException

getHiveTable

public org.apache.hadoop.hive.ql.metadata.Table getHiveTable(String tableName)
                                                      throws org.apache.hadoop.hive.ql.metadata.HiveException
Get the hive Table corresponding to the name

Parameters:
tableName -
Returns:
Table object
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

dropHiveTable

public void dropHiveTable(String table)
                   throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

isFactTable

public boolean isFactTable(String tableName)
                    throws org.apache.hadoop.hive.ql.metadata.HiveException
Is the table name passed a fact table?

Parameters:
tableName - table name
Returns:
true if it is cube fact, false otherwise
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

isDimensionTable

public boolean isDimensionTable(String tableName)
                         throws org.apache.hadoop.hive.ql.metadata.HiveException
Is the table name passed a dimension table?

Parameters:
tableName - table name
Returns:
true if it is cube dimension, false otherwise
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

isCube

public boolean isCube(String tableName)
               throws org.apache.hadoop.hive.ql.metadata.HiveException
Is the table name passed a cube?

Parameters:
tableName - table name
Returns:
true if it is cube, false otherwise
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

isDimension

public boolean isDimension(String tableName)
                    throws org.apache.hadoop.hive.ql.metadata.HiveException
Is the table name passed a dimension?

Parameters:
tableName - table name
Returns:
true if it is dimension, false otherwise
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

isStorage

public boolean isStorage(String tableName)
                  throws org.apache.hadoop.hive.ql.metadata.HiveException
Is the table name passed a storage?

Parameters:
tableName - table name
Returns:
true if it is storage, false otherwise
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getFactTable

public CubeFactTable getFactTable(String tableName)
                           throws org.apache.hadoop.hive.ql.metadata.HiveException
Get CubeFactTable object corresponding to the name

Parameters:
tableName - The cube fact name
Returns:
Returns CubeFactTable if table name passed is a fact table, null otherwise
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getDimensionTable

public CubeDimensionTable getDimensionTable(String tableName)
                                     throws org.apache.hadoop.hive.ql.metadata.HiveException
Get CubeDimensionTable object corresponding to the name

Parameters:
tableName - The cube dimension name
Returns:
Returns CubeDimensionTable if table name passed is a dimension table, null otherwise
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getStorage

public Storage getStorage(String storageName)
                   throws org.apache.hadoop.hive.ql.metadata.HiveException
Get Storage object corresponding to the name

Parameters:
storageName - The storage name
Returns:
Returns storage if name passed is a storage, null otherwise
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getCube

public CubeInterface getCube(String tableName)
                      throws org.apache.hadoop.hive.ql.metadata.HiveException
Get Cube object corresponding to the name

Parameters:
tableName - The cube name
Returns:
Returns cube is table name passed is a cube, null otherwise
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getDimension

public Dimension getDimension(String tableName)
                       throws org.apache.hadoop.hive.ql.metadata.HiveException
Get Cube object corresponding to the name

Parameters:
tableName - The cube name
Returns:
Returns cube is table name passed is a cube, null otherwise
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getCubeFact

public CubeFactTable getCubeFact(String tableName)
                          throws org.apache.hadoop.hive.ql.metadata.HiveException
Get Cube object corresponding to the name

Parameters:
tableName - The cube name
Returns:
Returns cube is table name passed is a cube, null otherwise
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getAllDimensionTables

public List<CubeDimensionTable> getAllDimensionTables()
                                               throws org.apache.hadoop.hive.ql.metadata.HiveException
Get all dimension tables in metastore

Returns:
List of dimension tables
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getAllStorages

public List<Storage> getAllStorages()
                             throws org.apache.hadoop.hive.ql.metadata.HiveException
Get all storages in metastore

Returns:
List of Storage objects
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getAllCubes

public List<CubeInterface> getAllCubes()
                                throws org.apache.hadoop.hive.ql.metadata.HiveException
Get all cubes in metastore

Returns:
List of Cube objects
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getAllDimensions

public List<Dimension> getAllDimensions()
                                 throws org.apache.hadoop.hive.ql.metadata.HiveException
Get all cubes in metastore

Returns:
List of Cube objects
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getAllFacts

public List<CubeFactTable> getAllFacts()
                                throws org.apache.hadoop.hive.ql.metadata.HiveException
Get all facts in metastore

Returns:
List of Cube Fact Table objects
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getAllFactTables

public List<CubeFactTable> getAllFactTables(CubeInterface cube)
                                     throws org.apache.hadoop.hive.ql.metadata.HiveException
Get all fact tables of the cube.

Parameters:
cube - Cube object
Returns:
List of fact tables
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getAllDerivedCubes

public List<DerivedCube> getAllDerivedCubes(CubeInterface cube)
                                     throws org.apache.hadoop.hive.ql.metadata.HiveException
Get all derived cubes of the cube.

Parameters:
cube - Cube object
Returns:
List of DerivedCube objects
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getAllDerivedQueryableCubes

public List<DerivedCube> getAllDerivedQueryableCubes(CubeInterface cube)
                                              throws org.apache.hadoop.hive.ql.metadata.HiveException
Get all derived cubes of the cube, that have all fields queryable together

Parameters:
cube - Cube object
Returns:
List of DerivedCube objects
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getAllDimensionTables

public List<CubeDimensionTable> getAllDimensionTables(Dimension dim)
                                               throws org.apache.hadoop.hive.ql.metadata.HiveException
Get all dimension tables of the dimension.

Parameters:
dim - Dimension object
Returns:
List of fact tables
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getPartColNames

public List<String> getPartColNames(String tableName)
                             throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

partColExists

public boolean partColExists(String tableName,
                             String partCol)
                      throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

getSchemaGraph

public SchemaGraph getSchemaGraph()
                           throws org.apache.hadoop.hive.ql.metadata.HiveException
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

alterCube

public void alterCube(String cubeName,
                      CubeInterface cube)
               throws org.apache.hadoop.hive.ql.metadata.HiveException
Alter cube specified by the name to new definition

Parameters:
cubeName - The cube name to be altered
cube - The new cube definition Cube or DerivedCube
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.metastore.api.InvalidOperationException

alterDimension

public void alterDimension(String dimName,
                           Dimension newDim)
                    throws org.apache.hadoop.hive.ql.metadata.HiveException
Alter dimension specified by the dimension name to new definition

Parameters:
dimName - The cube name to be altered
newDim - The new dimension definition
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.metastore.api.InvalidOperationException

alterStorage

public void alterStorage(String storageName,
                         Storage storage)
                  throws org.apache.hadoop.hive.ql.metadata.HiveException
Alter storage specified by the name to new definition

Parameters:
storageName - The storage name to be altered
storage - The new storage definition
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.metastore.api.InvalidOperationException

dropStorage

public void dropStorage(String storageName)
                 throws org.apache.hadoop.hive.ql.metadata.HiveException
Drop a storage

Parameters:
storageName -
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

dropCube

public void dropCube(String cubeName)
              throws org.apache.hadoop.hive.ql.metadata.HiveException
Drop a cube

Parameters:
cubeName -
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

dropDimension

public void dropDimension(String dimName)
                   throws org.apache.hadoop.hive.ql.metadata.HiveException
Drop a dimension

Parameters:
dimName - dimension name to be dropped
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

dropFact

public void dropFact(String factName,
                     boolean cascade)
              throws org.apache.hadoop.hive.ql.metadata.HiveException
Drop a fact with cascade flag

Parameters:
factName -
cascade - If true, will drop all the storages of the fact
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

dropStorageFromFact

public void dropStorageFromFact(String factName,
                                String storage)
                         throws org.apache.hadoop.hive.ql.metadata.HiveException
Drop a storage from fact

Parameters:
factName -
storage -
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.metastore.api.InvalidOperationException

dropStorageFromDim

public void dropStorageFromDim(String dimTblName,
                               String storage)
                        throws org.apache.hadoop.hive.ql.metadata.HiveException
Drop a storage from dimension

Parameters:
dimTblName -
storage -
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

dropDimensionTable

public void dropDimensionTable(String dimTblName,
                               boolean cascade)
                        throws org.apache.hadoop.hive.ql.metadata.HiveException
Drop the dimension table

Parameters:
dimTblName -
cascade - If true, will drop all the dimension storages
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

alterCubeFactTable

public void alterCubeFactTable(String factTableName,
                               CubeFactTable cubeFactTable)
                        throws org.apache.hadoop.hive.ql.metadata.HiveException
Alter a cubefact with new definition

Parameters:
factTableName -
cubeFactTable -
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.metastore.api.InvalidOperationException

alterCubeDimensionTable

public void alterCubeDimensionTable(String dimTableName,
                                    CubeDimensionTable cubeDimensionTable)
                             throws org.apache.hadoop.hive.ql.metadata.HiveException
Alter dimension table with new dimension definition

Parameters:
dimTableName -
cubeDimensionTable -
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.metastore.api.InvalidOperationException


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.