This project has retired. For details please refer to its Attic page.
CubeMetastoreServiceImpl (Lens 2.0.1-beta-incubating API)

org.apache.lens.server.metastore
Class CubeMetastoreServiceImpl

java.lang.Object
  extended by org.apache.hive.service.AbstractService
      extended by org.apache.hive.service.CompositeService
          extended by org.apache.lens.server.LensService
              extended by org.apache.lens.server.metastore.CubeMetastoreServiceImpl
All Implemented Interfaces:
Externalizable, Serializable, org.apache.hive.service.Service, CubeMetastoreService

public class CubeMetastoreServiceImpl
extends LensService
implements CubeMetastoreService

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hive.service.CompositeService
org.apache.hive.service.CompositeService.CompositeServiceShutdownHook
 
Nested classes/interfaces inherited from interface org.apache.hive.service.Service
org.apache.hive.service.Service.STATE
 
Field Summary
static org.apache.log4j.Logger LOG
           
 
Constructor Summary
CubeMetastoreServiceImpl(org.apache.hive.service.cli.CLIService cliService)
           
 
Method Summary
 void addDimTableStorage(LensSessionHandle sessionid, String dimTblName, XStorageTableElement storageTable)
          Add a storage to dimension table
 void addPartitionToDimStorage(LensSessionHandle sessionid, String dimTblName, String storageName, XPartition partition)
          Add partition to dimension table on a storage.
 void addPartitionToFactStorage(LensSessionHandle sessionid, String fact, String storageName, XPartition partition)
          Add partition to fact on a storage
 void addStorageToFact(LensSessionHandle sessionid, String fact, XStorageTableElement storageTable)
          Add storage to fact table
 void alterStorage(LensSessionHandle sessionid, String storageName, XStorage storage)
          Alter storage specified by name, with new definition
 void createCube(LensSessionHandle sessionid, XCube cube)
          Create cube based on the JAXB cube object
 void createDatabase(LensSessionHandle sessionid, String database, boolean ignore)
          Create a database in Hive metastore
 void createDimension(LensSessionHandle sessionid, XDimension dimension)
          Create a dimension based on JAXB Dimension object
 void createDimensionTable(LensSessionHandle sessionid, XDimensionTable xDimTable)
          Create a cube dimension table based on JAXB object
 void createFactTable(LensSessionHandle sessionid, XFactTable fact)
          Create fact table
 void createStorage(LensSessionHandle sessionid, XStorage storage)
          Create a storage
 void dropAllStoragesOfDimTable(LensSessionHandle sessionid, String dimTblName)
          Drop all storages of dimension table.
 void dropAllStoragesOfFact(LensSessionHandle sessionid, String factName)
          Drop all storages of fact
 void dropCube(LensSessionHandle sessionid, String cubeName)
          Drop a cube from the metastore in the currently deleted database
 void dropDatabase(LensSessionHandle sessionid, String database, boolean cascade)
          Drop a database from cube metastore
 void dropDimension(LensSessionHandle sessionid, String dimName)
          Drop a dimension from the metastore in the currently deleted database.
 void dropDimensionTable(LensSessionHandle sessionid, String dimTblName, boolean cascade)
          Drop a dimension table from the cube metastore
 void dropFactTable(LensSessionHandle sessionid, String fact, boolean cascade)
          Drop fact table.
 void dropPartitionFromStorageByFilter(LensSessionHandle sessionid, String cubeTableName, String storageName, String filter)
          Drop partition from storage with spec specified by filter
 void dropPartitionFromStorageByValues(LensSessionHandle sessionid, String cubeTableName, String storageName, String values)
          Drop partition from storage with spec specified as comma separated string
 void dropStorage(LensSessionHandle sessionid, String storageName)
          Drop a storage specified by name
 void dropStorageOfDimTable(LensSessionHandle sessionid, String dimTblName, String storage)
          Drop storage of dimension table specified by name.
 void dropStorageOfFact(LensSessionHandle sessionid, String fact, String storage)
          Drop storage of fact specified by fact name, storage name
 List<String> getAllBaseCubeNames(LensSessionHandle sessionid)
          Get names of all base cube names in the current database
 List<String> getAllCubeNames(LensSessionHandle sessionid)
          Get list of all cubes names in the current database
 List<String> getAllDatabases(LensSessionHandle sessionid)
          Get names of all databases in this metastore
 List<String> getAllDerivedCubeNames(LensSessionHandle sessionid)
          Get names of all derived cubes in the current database
 List<String> getAllDimensionNames(LensSessionHandle sessionid)
          Get all dimension names in the current session
 List<String> getAllDimTableNames(LensSessionHandle sessionid)
          Get all dimension tables
 List<String> getAllFactNames(LensSessionHandle sessionid)
          Get all fact names
 List<XFactTable> getAllFactsOfCube(LensSessionHandle sessionid, String cubeName)
          Get all facts of cube.
 List<String> getAllNativeTableNames(LensSessionHandle sessionid, String dbOption, String dbName)
          Get names of all native tables
 List<XPartition> getAllPartitionsOfDimTableStorage(LensSessionHandle sessionid, String dimension, String storageName, String filter)
          Get all partitions of a dimension table in a storage
 List<XPartition> getAllPartitionsOfFactStorage(LensSessionHandle sessionid, String fact, String storageName, String filter)
          Get all partitions of fact on a storage
 List<String> getAllQueryableCubeNames(LensSessionHandle sessionid)
          Get names of all cubes, which can be queried in the current database
 List<String> getAllStorageNames(LensSessionHandle sessionid)
          Get all storage names in current database
 XCube getCube(LensSessionHandle sessionid, String cubeName)
          Get a cube from the metastore
 String getCurrentDatabase(LensSessionHandle sessionid)
          Get current database used by the CubeMetastoreClient
 XDimension getDimension(LensSessionHandle sessionid, String dimName)
          Get a dimension from the metastore
 XDimensionTable getDimensionTable(LensSessionHandle sessionid, String dimTblName)
          Get the dimension table from metastore
 List<String> getDimTableStorages(LensSessionHandle sessionid, String dimension)
          Get all storages of dimension table
 XFactTable getFactTable(LensSessionHandle sessionid, String fact)
          Get fact table given by name
 XFlattenedColumns getFlattenedColumns(LensSessionHandle sessionHandle, String tableName)
          Get flattened columns - all columns of table + all reachable columns
 Date getLatestDateOfCube(LensSessionHandle sessionid, String cubeName, String timeDimension)
          Get the latest available date upto which data is available for the base cubes, for the time dimension
 XNativeTable getNativeTable(LensSessionHandle sessionid, String name)
          Get native table for the given name
 XStorage getStorage(LensSessionHandle sessionid, String storageName)
          Get Storage specified by name
 XStorageTableElement getStorageOfDim(LensSessionHandle sessionid, String dimTblName, String storageName)
          Get storage table element associated with dimension table for storage name specified
 XStorageTableElement getStorageOfFact(LensSessionHandle sessionid, String fact, String storageName)
          Get storage table of fact specifed by fact name, storage name
 List<String> getStoragesOfFact(LensSessionHandle sessionid, String fact)
          Get all storages of fact
 void setCurrentDatabase(LensSessionHandle sessionid, String database)
          Change the current database used by the CubeMetastoreClient
 void updateCube(LensSessionHandle sessionid, XCube cube)
          Update cube
 void updateDimension(LensSessionHandle sessionid, String dimName, XDimension dimension)
          Update an existing dimension
 void updateDimensionTable(LensSessionHandle sessionid, XDimensionTable dimensionTable)
          Update/Alter the dimension table
 void updateFactTable(LensSessionHandle sessionid, XFactTable fact)
          Update/Alter fact table
 
Methods inherited from class org.apache.lens.server.LensService
acquire, acquire, addResource, closeSession, deleteResource, getCliService, getHiveSessionHandle, getLensConf, getLensConf, getServerDomain, getSession, getSessionManager, openSession, prepareStopping, readExternal, release, release, restoreSession, writeExternal
 
Methods inherited from class org.apache.hive.service.CompositeService
getServices, init, start, stop
 
Methods inherited from class org.apache.hive.service.AbstractService
getHiveConf, getName, getServiceState, getStartTime, register, unregister
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
Constructor Detail

CubeMetastoreServiceImpl

public CubeMetastoreServiceImpl(org.apache.hive.service.cli.CLIService cliService)
Method Detail

getCurrentDatabase

public String getCurrentDatabase(LensSessionHandle sessionid)
                          throws LensException
Get current database used by the CubeMetastoreClient

Specified by:
getCurrentDatabase in interface CubeMetastoreService
Returns:
database name
Throws:
LensException

setCurrentDatabase

public void setCurrentDatabase(LensSessionHandle sessionid,
                               String database)
                        throws LensException
Change the current database used by the CubeMetastoreClient

Specified by:
setCurrentDatabase in interface CubeMetastoreService
Parameters:
database -
Throws:
LensException

dropDatabase

public void dropDatabase(LensSessionHandle sessionid,
                         String database,
                         boolean cascade)
                  throws LensException
Drop a database from cube metastore

Specified by:
dropDatabase in interface CubeMetastoreService
Parameters:
database - database name
cascade - flag indicating if the tables in the database should be dropped as well
Throws:
LensException

createDatabase

public void createDatabase(LensSessionHandle sessionid,
                           String database,
                           boolean ignore)
                    throws LensException
Create a database in Hive metastore

Specified by:
createDatabase in interface CubeMetastoreService
Parameters:
database - database name
ignore - ignore if database already exists
Throws:
LensException

getAllDatabases

public List<String> getAllDatabases(LensSessionHandle sessionid)
                             throws LensException
Description copied from interface: CubeMetastoreService
Get names of all databases in this metastore

Specified by:
getAllDatabases in interface CubeMetastoreService
Returns:
get all database names
Throws:
LensException

getAllCubeNames

public List<String> getAllCubeNames(LensSessionHandle sessionid)
                             throws LensException
Get list of all cubes names in the current database

Specified by:
getAllCubeNames in interface CubeMetastoreService
Returns:
List of cube names
Throws:
LensException

createCube

public void createCube(LensSessionHandle sessionid,
                       XCube cube)
                throws LensException
Create cube based on the JAXB cube object

Specified by:
createCube in interface CubeMetastoreService
Parameters:
cube -
Throws:
LensException

getCube

public XCube getCube(LensSessionHandle sessionid,
                     String cubeName)
              throws LensException
Get a cube from the metastore

Specified by:
getCube in interface CubeMetastoreService
Parameters:
cubeName -
Returns:
The cube object as XCube
Throws:
LensException

dropCube

public void dropCube(LensSessionHandle sessionid,
                     String cubeName)
              throws LensException
Drop a cube from the metastore in the currently deleted database

Specified by:
dropCube in interface CubeMetastoreService
Parameters:
cubeName -
Throws:
LensException

updateCube

public void updateCube(LensSessionHandle sessionid,
                       XCube cube)
                throws LensException
Update cube

Specified by:
updateCube in interface CubeMetastoreService
Parameters:
cube - JAXB Cube object
Throws:
LensException

createDimensionTable

public void createDimensionTable(LensSessionHandle sessionid,
                                 XDimensionTable xDimTable)
                          throws LensException
Create a cube dimension table based on JAXB object

Specified by:
createDimensionTable in interface CubeMetastoreService
Parameters:
xDimTable -
sessionid - The sessionid
Throws:
LensException

dropDimensionTable

public void dropDimensionTable(LensSessionHandle sessionid,
                               String dimTblName,
                               boolean cascade)
                        throws LensException
Description copied from interface: CubeMetastoreService
Drop a dimension table from the cube metastore

Specified by:
dropDimensionTable in interface CubeMetastoreService
Throws:
LensException

getDimensionTable

public XDimensionTable getDimensionTable(LensSessionHandle sessionid,
                                         String dimTblName)
                                  throws LensException
Description copied from interface: CubeMetastoreService
Get the dimension table from metastore

Specified by:
getDimensionTable in interface CubeMetastoreService
Returns:
The DimensionTable
Throws:
LensException

updateDimensionTable

public void updateDimensionTable(LensSessionHandle sessionid,
                                 XDimensionTable dimensionTable)
                          throws LensException
Description copied from interface: CubeMetastoreService
Update/Alter the dimension table

Specified by:
updateDimensionTable in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
dimensionTable - The new definition of dimension table
Throws:
LensException

getDimTableStorages

public List<String> getDimTableStorages(LensSessionHandle sessionid,
                                        String dimension)
                                 throws LensException
Description copied from interface: CubeMetastoreService
Get all storages of dimension table

Specified by:
getDimTableStorages in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
dimension - The dimension table name
Returns:
list of storage names
Throws:
LensException

addDimTableStorage

public void addDimTableStorage(LensSessionHandle sessionid,
                               String dimTblName,
                               XStorageTableElement storageTable)
                        throws LensException
Description copied from interface: CubeMetastoreService
Add a storage to dimension table

Specified by:
addDimTableStorage in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
storageTable - XStorageTableElement with storage name, table desc and dump period, if any.
Throws:
LensException

dropAllStoragesOfDimTable

public void dropAllStoragesOfDimTable(LensSessionHandle sessionid,
                                      String dimTblName)
                               throws LensException
Description copied from interface: CubeMetastoreService
Drop all storages of dimension table. Will drop underlying tables as well.

Specified by:
dropAllStoragesOfDimTable in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
Throws:
LensException

dropAllStoragesOfFact

public void dropAllStoragesOfFact(LensSessionHandle sessionid,
                                  String factName)
                           throws LensException
Description copied from interface: CubeMetastoreService
Drop all storages of fact

Specified by:
dropAllStoragesOfFact in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
Throws:
LensException

dropStorageOfDimTable

public void dropStorageOfDimTable(LensSessionHandle sessionid,
                                  String dimTblName,
                                  String storage)
                           throws LensException
Description copied from interface: CubeMetastoreService
Drop storage of dimension table specified by name.

Specified by:
dropStorageOfDimTable in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
Throws:
LensException

getAllFactsOfCube

public List<XFactTable> getAllFactsOfCube(LensSessionHandle sessionid,
                                          String cubeName)
                                   throws LensException
Description copied from interface: CubeMetastoreService
Get all facts of cube. Cube can also be a derived cube

Specified by:
getAllFactsOfCube in interface CubeMetastoreService
Parameters:
sessionid - The session id
cubeName - The cube name
Returns:
List of FactTable objects
Throws:
LensException

getFactTable

public XFactTable getFactTable(LensSessionHandle sessionid,
                               String fact)
                        throws LensException
Description copied from interface: CubeMetastoreService
Get fact table given by name

Specified by:
getFactTable in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
fact - The fact table name
Returns:
FactTable
Throws:
LensException

createFactTable

public void createFactTable(LensSessionHandle sessionid,
                            XFactTable fact)
                     throws LensException
Description copied from interface: CubeMetastoreService
Create fact table

Specified by:
createFactTable in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
fact - The fact table definition
Throws:
LensException

updateFactTable

public void updateFactTable(LensSessionHandle sessionid,
                            XFactTable fact)
                     throws LensException
Description copied from interface: CubeMetastoreService
Update/Alter fact table

Specified by:
updateFactTable in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
fact - The fact table's new definition
Throws:
LensException

dropFactTable

public void dropFactTable(LensSessionHandle sessionid,
                          String fact,
                          boolean cascade)
                   throws LensException
Description copied from interface: CubeMetastoreService
Drop fact table.

Specified by:
dropFactTable in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
fact - The fact table name
cascade - If true, underlying storage tables will also be dropped.
Throws:
LensException

getAllFactNames

public List<String> getAllFactNames(LensSessionHandle sessionid)
                             throws LensException
Description copied from interface: CubeMetastoreService
Get all fact names

Specified by:
getAllFactNames in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
Returns:
List of fact table names
Throws:
LensException

getAllDimTableNames

public List<String> getAllDimTableNames(LensSessionHandle sessionid)
                                 throws LensException
Description copied from interface: CubeMetastoreService
Get all dimension tables

Specified by:
getAllDimTableNames in interface CubeMetastoreService
Returns:
Throws:
LensException

getStoragesOfFact

public List<String> getStoragesOfFact(LensSessionHandle sessionid,
                                      String fact)
                               throws LensException
Description copied from interface: CubeMetastoreService
Get all storages of fact

Specified by:
getStoragesOfFact in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
fact - The fact table name
Returns:
List of all storage names on which fact is present
Throws:
LensException

getStorageOfFact

public XStorageTableElement getStorageOfFact(LensSessionHandle sessionid,
                                             String fact,
                                             String storageName)
                                      throws LensException
Description copied from interface: CubeMetastoreService
Get storage table of fact specifed by fact name, storage name

Specified by:
getStorageOfFact in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
fact - The fact table name
storageName - The storage name
Returns:
Throws:
LensException

getStorageOfDim

public XStorageTableElement getStorageOfDim(LensSessionHandle sessionid,
                                            String dimTblName,
                                            String storageName)
                                     throws LensException
Description copied from interface: CubeMetastoreService
Get storage table element associated with dimension table for storage name specified

Specified by:
getStorageOfDim in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
storageName - The storage name
Returns:
XStorageTableElement
Throws:
LensException

addStorageToFact

public void addStorageToFact(LensSessionHandle sessionid,
                             String fact,
                             XStorageTableElement storageTable)
                      throws LensException
Description copied from interface: CubeMetastoreService
Add storage to fact table

Specified by:
addStorageToFact in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
fact - The fact table name
storageTable - XStorageTableElement containing storage name, update periods and table description
Throws:
LensException

dropStorageOfFact

public void dropStorageOfFact(LensSessionHandle sessionid,
                              String fact,
                              String storage)
                       throws LensException
Description copied from interface: CubeMetastoreService
Drop storage of fact specified by fact name, storage name

Specified by:
dropStorageOfFact in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
fact - The fact table name
Throws:
LensException

getAllPartitionsOfFactStorage

public List<XPartition> getAllPartitionsOfFactStorage(LensSessionHandle sessionid,
                                                      String fact,
                                                      String storageName,
                                                      String filter)
                                               throws LensException
Description copied from interface: CubeMetastoreService
Get all partitions of fact on a storage

Specified by:
getAllPartitionsOfFactStorage in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
fact - The fact table name
filter - The filter for partition listing
Returns:
List of XPartition
Throws:
LensException

addPartitionToFactStorage

public void addPartitionToFactStorage(LensSessionHandle sessionid,
                                      String fact,
                                      String storageName,
                                      XPartition partition)
                               throws LensException
Description copied from interface: CubeMetastoreService
Add partition to fact on a storage

Specified by:
addPartitionToFactStorage in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
fact - The fact table name
storageName - The storage name
partition - XPartition
Throws:
LensException

getAllPartitionsOfDimTableStorage

public List<XPartition> getAllPartitionsOfDimTableStorage(LensSessionHandle sessionid,
                                                          String dimension,
                                                          String storageName,
                                                          String filter)
                                                   throws LensException
Description copied from interface: CubeMetastoreService
Get all partitions of a dimension table in a storage

Specified by:
getAllPartitionsOfDimTableStorage in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
dimension - The dimension table name
filter - The filter for the list of partitions
Returns:
list of XPartition
Throws:
LensException

addPartitionToDimStorage

public void addPartitionToDimStorage(LensSessionHandle sessionid,
                                     String dimTblName,
                                     String storageName,
                                     XPartition partition)
                              throws LensException
Description copied from interface: CubeMetastoreService
Add partition to dimension table on a storage.

Specified by:
addPartitionToDimStorage in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
storageName - The storage name
partition - XPartition
Throws:
LensException

dropPartitionFromStorageByValues

public void dropPartitionFromStorageByValues(LensSessionHandle sessionid,
                                             String cubeTableName,
                                             String storageName,
                                             String values)
                                      throws LensException
Description copied from interface: CubeMetastoreService
Drop partition from storage with spec specified as comma separated string

Specified by:
dropPartitionFromStorageByValues in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
cubeTableName - The cube table name - fact/dimension table name
storageName - The storage name
values - The comma separated values for all partition columns
Throws:
LensException

dropPartitionFromStorageByFilter

public void dropPartitionFromStorageByFilter(LensSessionHandle sessionid,
                                             String cubeTableName,
                                             String storageName,
                                             String filter)
                                      throws LensException
Description copied from interface: CubeMetastoreService
Drop partition from storage with spec specified by filter

Specified by:
dropPartitionFromStorageByFilter in interface CubeMetastoreService
Parameters:
sessionid - The sessionid
cubeTableName - The cube table name - fact/dimension table name
storageName - The storage name
filter - The partition filter - all partitions which obey the filter will be dropped
Throws:
LensException

createStorage

public void createStorage(LensSessionHandle sessionid,
                          XStorage storage)
                   throws LensException
Description copied from interface: CubeMetastoreService
Create a storage

Specified by:
createStorage in interface CubeMetastoreService
Throws:
LensException

dropStorage

public void dropStorage(LensSessionHandle sessionid,
                        String storageName)
                 throws LensException
Description copied from interface: CubeMetastoreService
Drop a storage specified by name

Specified by:
dropStorage in interface CubeMetastoreService
Throws:
LensException

alterStorage

public void alterStorage(LensSessionHandle sessionid,
                         String storageName,
                         XStorage storage)
                  throws LensException
Description copied from interface: CubeMetastoreService
Alter storage specified by name, with new definition

Specified by:
alterStorage in interface CubeMetastoreService
Throws:
LensException

getStorage

public XStorage getStorage(LensSessionHandle sessionid,
                           String storageName)
                    throws LensException
Description copied from interface: CubeMetastoreService
Get Storage specified by name

Specified by:
getStorage in interface CubeMetastoreService
Throws:
LensException

getAllStorageNames

public List<String> getAllStorageNames(LensSessionHandle sessionid)
                                throws LensException
Description copied from interface: CubeMetastoreService
Get all storage names in current database

Specified by:
getAllStorageNames in interface CubeMetastoreService
Returns:
returns list of the storage names
Throws:
LensException

getAllBaseCubeNames

public List<String> getAllBaseCubeNames(LensSessionHandle sessionid)
                                 throws LensException
Description copied from interface: CubeMetastoreService
Get names of all base cube names in the current database

Specified by:
getAllBaseCubeNames in interface CubeMetastoreService
Returns:
list of cube names
Throws:
LensException

getAllDerivedCubeNames

public List<String> getAllDerivedCubeNames(LensSessionHandle sessionid)
                                    throws LensException
Description copied from interface: CubeMetastoreService
Get names of all derived cubes in the current database

Specified by:
getAllDerivedCubeNames in interface CubeMetastoreService
Returns:
list of cube names
Throws:
LensException

getAllQueryableCubeNames

public List<String> getAllQueryableCubeNames(LensSessionHandle sessionid)
                                      throws LensException
Description copied from interface: CubeMetastoreService
Get names of all cubes, which can be queried in the current database

Specified by:
getAllQueryableCubeNames in interface CubeMetastoreService
Parameters:
sessionid - session id
Returns:
list of cube names
Throws:
LensException

createDimension

public void createDimension(LensSessionHandle sessionid,
                            XDimension dimension)
                     throws LensException
Description copied from interface: CubeMetastoreService
Create a dimension based on JAXB Dimension object

Specified by:
createDimension in interface CubeMetastoreService
Throws:
LensException

getDimension

public XDimension getDimension(LensSessionHandle sessionid,
                               String dimName)
                        throws LensException
Description copied from interface: CubeMetastoreService
Get a dimension from the metastore

Specified by:
getDimension in interface CubeMetastoreService
Returns:
JAXB Dimension object
Throws:
LensException

dropDimension

public void dropDimension(LensSessionHandle sessionid,
                          String dimName)
                   throws LensException
Description copied from interface: CubeMetastoreService
Drop a dimension from the metastore in the currently deleted database.

Specified by:
dropDimension in interface CubeMetastoreService
Throws:
LensException

updateDimension

public void updateDimension(LensSessionHandle sessionid,
                            String dimName,
                            XDimension dimension)
                     throws LensException
Description copied from interface: CubeMetastoreService
Update an existing dimension

Specified by:
updateDimension in interface CubeMetastoreService
Parameters:
sessionid - dimName JAXB Dimension object
Throws:
LensException

getAllDimensionNames

public List<String> getAllDimensionNames(LensSessionHandle sessionid)
                                  throws LensException
Description copied from interface: CubeMetastoreService
Get all dimension names in the current session

Specified by:
getAllDimensionNames in interface CubeMetastoreService
Returns:
List of dimension names as List of string objects
Throws:
LensException

getNativeTable

public XNativeTable getNativeTable(LensSessionHandle sessionid,
                                   String name)
                            throws LensException
Description copied from interface: CubeMetastoreService
Get native table for the given name

Specified by:
getNativeTable in interface CubeMetastoreService
Parameters:
sessionid - session id
name - The table name
Returns:
NativeTable object
Throws:
LensException

getAllNativeTableNames

public List<String> getAllNativeTableNames(LensSessionHandle sessionid,
                                           String dbOption,
                                           String dbName)
                                    throws LensException
Description copied from interface: CubeMetastoreService
Get names of all native tables

Specified by:
getAllNativeTableNames in interface CubeMetastoreService
Parameters:
sessionid - session id
dbOption - To get from current or all, the option is ignored if dbname is passed
dbName - The db name
Returns:
list of table names
Throws:
LensException

getFlattenedColumns

public XFlattenedColumns getFlattenedColumns(LensSessionHandle sessionHandle,
                                             String tableName)
                                      throws LensException
Description copied from interface: CubeMetastoreService
Get flattened columns - all columns of table + all reachable columns

Specified by:
getFlattenedColumns in interface CubeMetastoreService
tableName - The table name - cube name or dimension name
Returns:
FlattenedColumns
Throws:
LensException

getLatestDateOfCube

public Date getLatestDateOfCube(LensSessionHandle sessionid,
                                String cubeName,
                                String timeDimension)
                         throws LensException,
                                org.apache.hadoop.hive.ql.metadata.HiveException
Description copied from interface: CubeMetastoreService
Get the latest available date upto which data is available for the base cubes, for the time dimension

Specified by:
getLatestDateOfCube in interface CubeMetastoreService
Parameters:
sessionid - The session id
cubeName - The base cube name
timeDimension - time dimension name
Returns:
Date
Throws:
LensException
org.apache.hadoop.hive.ql.metadata.HiveException


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