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

org.apache.lens.server.api.metastore
Interface CubeMetastoreService

All Known Implementing Classes:
CubeMetastoreServiceImpl

public interface CubeMetastoreService

Server api for OLAP Cube Metastore.


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 a cube based on JAXB Cube object
 void createDatabase(LensSessionHandle sessionid, String database, boolean ignore)
          Create a database in the metastore
 void createDimension(LensSessionHandle sessionid, XDimension dimension)
          Create a dimension based on JAXB Dimension object
 void createDimensionTable(LensSessionHandle sessionid, XDimensionTable xDimTable)
          Create dimension table
 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 names of all cubes in the current database, includes both base cubes and derived cubes
 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 dimTblName, String storage, String filter)
          Get all partitions of a dimension table in a storage
 List<XPartition> getAllPartitionsOfFactStorage(LensSessionHandle sessionid, String fact, String storage, 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 dimTblName)
          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 an existing 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
 

Method Detail

getCurrentDatabase

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

Returns:
the current database name
Throws:
LensException

setCurrentDatabase

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

Parameters:
database -
Throws:
LensException

dropDatabase

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

Parameters:
database - database name
cascade - flag indicating if the tables in the database should be dropped as well
Throws:
LensException

createDatabase

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

Parameters:
database - database name
ignore - ignore if database already exists
Throws:
LensException

getAllDatabases

List<String> getAllDatabases(LensSessionHandle sessionid)
                             throws LensException
Get names of all databases in this metastore

Returns:
list of database names
Throws:
LensException

createStorage

void createStorage(LensSessionHandle sessionid,
                   XStorage storage)
                   throws LensException
Create a storage

Parameters:
sessionid -
storage -
Throws:
LensException

dropStorage

void dropStorage(LensSessionHandle sessionid,
                 String storageName)
                 throws LensException
Drop a storage specified by name

Parameters:
sessionid -
storageName -
Throws:
LensException

alterStorage

void alterStorage(LensSessionHandle sessionid,
                  String storageName,
                  XStorage storage)
                  throws LensException
Alter storage specified by name, with new definition

Parameters:
sessionid -
storageName -
storage -
Throws:
LensException

getStorage

XStorage getStorage(LensSessionHandle sessionid,
                    String storageName)
                    throws LensException
Get Storage specified by name

Parameters:
sessionid -
storageName -
Throws:
LensException

getAllStorageNames

List<String> getAllStorageNames(LensSessionHandle sessionid)
                                throws LensException
Get all storage names in current database

Parameters:
sessionid -
Returns:
returns list of the storage names
Throws:
LensException

getAllCubeNames

List<String> getAllCubeNames(LensSessionHandle sessionid)
                             throws LensException
Get names of all cubes in the current database, includes both base cubes and derived cubes

Returns:
list of cube names
Throws:
LensException

getAllBaseCubeNames

List<String> getAllBaseCubeNames(LensSessionHandle sessionid)
                                 throws LensException
Get names of all base cube names in the current database

Returns:
list of cube names
Throws:
LensException

getAllDerivedCubeNames

List<String> getAllDerivedCubeNames(LensSessionHandle sessionid)
                                    throws LensException
Get names of all derived cubes in the current database

Returns:
list of cube names
Throws:
LensException

getAllQueryableCubeNames

List<String> getAllQueryableCubeNames(LensSessionHandle sessionid)
                                      throws LensException
Get names of all cubes, which can be queried in the current database

Parameters:
sessionid - session id
Returns:
list of cube names
Throws:
LensException

getNativeTable

XNativeTable getNativeTable(LensSessionHandle sessionid,
                            String name)
                            throws LensException
Get native table for the given name

Parameters:
sessionid - session id
name - The table name
Returns:
NativeTable object
Throws:
LensException

getAllNativeTableNames

List<String> getAllNativeTableNames(LensSessionHandle sessionid,
                                    String dboption,
                                    String dbName)
                                    throws LensException
Get names of all native tables

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

createCube

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

Throws:
LensException

getCube

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

Parameters:
cubeName -
Returns:
JAXB Cube object
Throws:
LensException

dropCube

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

Parameters:
cubeName -
Throws:
LensException

updateCube

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

Parameters:
cube - JAXB Cube object
Throws:
LensException

createDimension

void createDimension(LensSessionHandle sessionid,
                     XDimension dimension)
                     throws LensException
Create a dimension based on JAXB Dimension object

Throws:
LensException

getDimension

XDimension getDimension(LensSessionHandle sessionid,
                        String dimName)
                        throws LensException
Get a dimension from the metastore

Parameters:
dimName -
Returns:
JAXB Dimension object
Throws:
LensException

dropDimension

void dropDimension(LensSessionHandle sessionid,
                   String dimName)
                   throws LensException
Drop a dimension from the metastore in the currently deleted database.

Parameters:
sessionid, - dimName
Throws:
LensException

updateDimension

void updateDimension(LensSessionHandle sessionid,
                     String dimName,
                     XDimension dimension)
                     throws LensException
Update an existing dimension

Parameters:
sessionid - dimName JAXB Dimension object
Throws:
LensException

getAllDimensionNames

List<String> getAllDimensionNames(LensSessionHandle sessionid)
                                  throws LensException
Get all dimension names in the current session

Parameters:
sessionid -
Returns:
List of dimension names as List of string objects
Throws:
LensException

createDimensionTable

void createDimensionTable(LensSessionHandle sessionid,
                          XDimensionTable xDimTable)
                          throws LensException
Create dimension table

Parameters:
sessionid - The sessionid
xDimTable - The dim table definition
Throws:
LensException

dropDimensionTable

void dropDimensionTable(LensSessionHandle sessionid,
                        String dimTblName,
                        boolean cascade)
                        throws LensException
Drop a dimension table from the cube metastore

Parameters:
sessionid -
dimTblName -
cascade -
Throws:
LensException

getDimensionTable

XDimensionTable getDimensionTable(LensSessionHandle sessionid,
                                  String dimTblName)
                                  throws LensException
Get the dimension table from metastore

Parameters:
dimTblName -
Returns:
The DimensionTable
Throws:
LensException

updateDimensionTable

void updateDimensionTable(LensSessionHandle sessionid,
                          XDimensionTable dimensionTable)
                          throws LensException
Update/Alter the dimension table

Parameters:
sessionid - The sessionid
dimensionTable - The new definition of dimension table
Throws:
LensException

getDimTableStorages

List<String> getDimTableStorages(LensSessionHandle sessionid,
                                 String dimTblName)
                                 throws LensException
Get all storages of dimension table

Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
Returns:
list of storage names
Throws:
LensException

addDimTableStorage

void addDimTableStorage(LensSessionHandle sessionid,
                        String dimTblName,
                        XStorageTableElement storageTable)
                        throws LensException
Add a storage to dimension table

Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
storageTable - XStorageTableElement with storage name, table desc and dump period, if any.
Throws:
LensException

dropAllStoragesOfDimTable

void dropAllStoragesOfDimTable(LensSessionHandle sessionid,
                               String dimTblName)
                               throws LensException
Drop all storages of dimension table. Will drop underlying tables as well.

Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
Throws:
LensException

getStorageOfDim

XStorageTableElement getStorageOfDim(LensSessionHandle sessionid,
                                     String dimTblName,
                                     String storageName)
                                     throws LensException
Get storage table element associated with dimension table for storage name specified

Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
storageName - The storage name
Returns:
XStorageTableElement
Throws:
LensException

dropStorageOfDimTable

void dropStorageOfDimTable(LensSessionHandle sessionid,
                           String dimTblName,
                           String storage)
                           throws LensException
Drop storage of dimension table specified by name.

Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
storageName - The storage name
Throws:
LensException

getAllDimTableNames

List<String> getAllDimTableNames(LensSessionHandle sessionid)
                                 throws LensException
Get all dimension tables

Parameters:
sessionid -
Returns:
Throws:
LensException

getAllPartitionsOfDimTableStorage

List<XPartition> getAllPartitionsOfDimTableStorage(LensSessionHandle sessionid,
                                                   String dimTblName,
                                                   String storage,
                                                   String filter)
                                                   throws LensException
Get all partitions of a dimension table in a storage

Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
storageName - The storage name
filter - The filter for the list of partitions
Returns:
list of XPartition
Throws:
LensException

addPartitionToDimStorage

void addPartitionToDimStorage(LensSessionHandle sessionid,
                              String dimTblName,
                              String storageName,
                              XPartition partition)
                              throws LensException
Add partition to dimension table on a storage.

Parameters:
sessionid - The sessionid
dimTblName - The dimension table name
storageName - The storage name
partition - XPartition
Throws:
LensException

getAllFactsOfCube

List<XFactTable> getAllFactsOfCube(LensSessionHandle sessionid,
                                   String cubeName)
                                   throws LensException
Get all facts of cube. Cube can also be a derived cube

Parameters:
sessionid - The session id
cubeName - The cube name
Returns:
List of FactTable objects
Throws:
LensException

getFactTable

XFactTable getFactTable(LensSessionHandle sessionid,
                        String fact)
                        throws LensException
Get fact table given by name

Parameters:
sessionid - The sessionid
fact - The fact table name
Returns:
FactTable
Throws:
LensException

createFactTable

void createFactTable(LensSessionHandle sessionid,
                     XFactTable fact)
                     throws LensException
Create fact table

Parameters:
sessionid - The sessionid
fact - The fact table definition
Throws:
LensException

updateFactTable

void updateFactTable(LensSessionHandle sessionid,
                     XFactTable fact)
                     throws LensException
Update/Alter fact table

Parameters:
sessionid - The sessionid
fact - The fact table's new definition
Throws:
LensException

dropFactTable

void dropFactTable(LensSessionHandle sessionid,
                   String fact,
                   boolean cascade)
                   throws LensException
Drop fact table.

Parameters:
sessionid - The sessionid
fact - The fact table name
cascade - If true, underlying storage tables will also be dropped.
Throws:
LensException

getAllFactNames

List<String> getAllFactNames(LensSessionHandle sessionid)
                             throws LensException
Get all fact names

Parameters:
sessionid - The sessionid
Returns:
List of fact table names
Throws:
LensException

getStoragesOfFact

List<String> getStoragesOfFact(LensSessionHandle sessionid,
                               String fact)
                               throws LensException
Get all storages of fact

Parameters:
sessionid - The sessionid
fact - The fact table name
Returns:
List of all storage names on which fact is present
Throws:
LensException

dropAllStoragesOfFact

void dropAllStoragesOfFact(LensSessionHandle sessionid,
                           String factName)
                           throws LensException
Drop all storages of fact

Parameters:
sessionid - The sessionid
fact - The fact table name
Throws:
LensException

getStorageOfFact

XStorageTableElement getStorageOfFact(LensSessionHandle sessionid,
                                      String fact,
                                      String storageName)
                                      throws LensException
Get storage table of fact specifed by fact name, storage name

Parameters:
sessionid - The sessionid
fact - The fact table name
storageName - The storage name
Returns:
Throws:
LensException

addStorageToFact

void addStorageToFact(LensSessionHandle sessionid,
                      String fact,
                      XStorageTableElement storageTable)
                      throws LensException
Add storage to fact table

Parameters:
sessionid - The sessionid
fact - The fact table name
storageTable - XStorageTableElement containing storage name, update periods and table description
Throws:
LensException

dropStorageOfFact

void dropStorageOfFact(LensSessionHandle sessionid,
                       String fact,
                       String storage)
                       throws LensException
Drop storage of fact specified by fact name, storage name

Parameters:
sessionid - The sessionid
fact - The fact table name
storageName - The storage name
Throws:
LensException

getAllPartitionsOfFactStorage

List<XPartition> getAllPartitionsOfFactStorage(LensSessionHandle sessionid,
                                               String fact,
                                               String storage,
                                               String filter)
                                               throws LensException
Get all partitions of fact on a storage

Parameters:
sessionid - The sessionid
fact - The fact table name
storageName - The storage name
filter - The filter for partition listing
Returns:
List of XPartition
Throws:
LensException

addPartitionToFactStorage

void addPartitionToFactStorage(LensSessionHandle sessionid,
                               String fact,
                               String storageName,
                               XPartition partition)
                               throws LensException
Add partition to fact on a storage

Parameters:
sessionid - The sessionid
fact - The fact table name
storageName - The storage name
partition - XPartition
Throws:
LensException

dropPartitionFromStorageByValues

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

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

void dropPartitionFromStorageByFilter(LensSessionHandle sessionid,
                                      String cubeTableName,
                                      String storageName,
                                      String filter)
                                      throws LensException
Drop partition from storage with spec specified by filter

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

getFlattenedColumns

XFlattenedColumns getFlattenedColumns(LensSessionHandle sessionHandle,
                                      String tableName)
                                      throws LensException
Get flattened columns - all columns of table + all reachable columns

Parameters:
sessionid - The sessionid
tableName - The table name - cube name or dimension name
Returns:
FlattenedColumns
Throws:
LensException

getLatestDateOfCube

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

Parameters:
sessionid - The session id
timeDimension - time dimension name
cubeName - The base cube name
Returns:
Date
Throws:
LensException,HiveException
LensException
org.apache.hadoop.hive.ql.metadata.HiveException


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