|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hive.service.AbstractService org.apache.hive.service.CompositeService org.apache.lens.server.LensService org.apache.lens.server.metastore.CubeMetastoreServiceImpl
public class CubeMetastoreServiceImpl
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 |
---|
public static final org.apache.log4j.Logger LOG
Constructor Detail |
---|
public CubeMetastoreServiceImpl(org.apache.hive.service.cli.CLIService cliService)
Method Detail |
---|
public String getCurrentDatabase(LensSessionHandle sessionid) throws LensException
getCurrentDatabase
in interface CubeMetastoreService
LensException
public void setCurrentDatabase(LensSessionHandle sessionid, String database) throws LensException
setCurrentDatabase
in interface CubeMetastoreService
database
-
LensException
public void dropDatabase(LensSessionHandle sessionid, String database, boolean cascade) throws LensException
dropDatabase
in interface CubeMetastoreService
database
- database namecascade
- flag indicating if the tables in the database should be dropped as well
LensException
public void createDatabase(LensSessionHandle sessionid, String database, boolean ignore) throws LensException
createDatabase
in interface CubeMetastoreService
database
- database nameignore
- ignore if database already exists
LensException
public List<String> getAllDatabases(LensSessionHandle sessionid) throws LensException
CubeMetastoreService
getAllDatabases
in interface CubeMetastoreService
LensException
public List<String> getAllCubeNames(LensSessionHandle sessionid) throws LensException
getAllCubeNames
in interface CubeMetastoreService
LensException
public void createCube(LensSessionHandle sessionid, XCube cube) throws LensException
createCube
in interface CubeMetastoreService
cube
-
LensException
public XCube getCube(LensSessionHandle sessionid, String cubeName) throws LensException
getCube
in interface CubeMetastoreService
cubeName
-
XCube
LensException
public void dropCube(LensSessionHandle sessionid, String cubeName) throws LensException
dropCube
in interface CubeMetastoreService
cubeName
-
LensException
public void updateCube(LensSessionHandle sessionid, XCube cube) throws LensException
updateCube
in interface CubeMetastoreService
cube
- JAXB Cube object
LensException
public void createDimensionTable(LensSessionHandle sessionid, XDimensionTable xDimTable) throws LensException
createDimensionTable
in interface CubeMetastoreService
xDimTable
- sessionid
- The sessionid
LensException
public void dropDimensionTable(LensSessionHandle sessionid, String dimTblName, boolean cascade) throws LensException
CubeMetastoreService
dropDimensionTable
in interface CubeMetastoreService
LensException
public XDimensionTable getDimensionTable(LensSessionHandle sessionid, String dimTblName) throws LensException
CubeMetastoreService
getDimensionTable
in interface CubeMetastoreService
DimensionTable
LensException
public void updateDimensionTable(LensSessionHandle sessionid, XDimensionTable dimensionTable) throws LensException
CubeMetastoreService
updateDimensionTable
in interface CubeMetastoreService
sessionid
- The sessioniddimensionTable
- The new definition of dimension table
LensException
public List<String> getDimTableStorages(LensSessionHandle sessionid, String dimension) throws LensException
CubeMetastoreService
getDimTableStorages
in interface CubeMetastoreService
sessionid
- The sessioniddimension
- The dimension table name
LensException
public void addDimTableStorage(LensSessionHandle sessionid, String dimTblName, XStorageTableElement storageTable) throws LensException
CubeMetastoreService
addDimTableStorage
in interface CubeMetastoreService
sessionid
- The sessioniddimTblName
- The dimension table namestorageTable
- XStorageTableElement with storage name, table desc and dump period, if any.
LensException
public void dropAllStoragesOfDimTable(LensSessionHandle sessionid, String dimTblName) throws LensException
CubeMetastoreService
dropAllStoragesOfDimTable
in interface CubeMetastoreService
sessionid
- The sessioniddimTblName
- The dimension table name
LensException
public void dropAllStoragesOfFact(LensSessionHandle sessionid, String factName) throws LensException
CubeMetastoreService
dropAllStoragesOfFact
in interface CubeMetastoreService
sessionid
- The sessionid
LensException
public void dropStorageOfDimTable(LensSessionHandle sessionid, String dimTblName, String storage) throws LensException
CubeMetastoreService
dropStorageOfDimTable
in interface CubeMetastoreService
sessionid
- The sessioniddimTblName
- The dimension table name
LensException
public List<XFactTable> getAllFactsOfCube(LensSessionHandle sessionid, String cubeName) throws LensException
CubeMetastoreService
getAllFactsOfCube
in interface CubeMetastoreService
sessionid
- The session idcubeName
- The cube name
LensException
public XFactTable getFactTable(LensSessionHandle sessionid, String fact) throws LensException
CubeMetastoreService
getFactTable
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table name
FactTable
LensException
public void createFactTable(LensSessionHandle sessionid, XFactTable fact) throws LensException
CubeMetastoreService
createFactTable
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table definition
LensException
public void updateFactTable(LensSessionHandle sessionid, XFactTable fact) throws LensException
CubeMetastoreService
updateFactTable
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table's new definition
LensException
public void dropFactTable(LensSessionHandle sessionid, String fact, boolean cascade) throws LensException
CubeMetastoreService
dropFactTable
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table namecascade
- If true, underlying storage tables will also be dropped.
LensException
public List<String> getAllFactNames(LensSessionHandle sessionid) throws LensException
CubeMetastoreService
getAllFactNames
in interface CubeMetastoreService
sessionid
- The sessionid
LensException
public List<String> getAllDimTableNames(LensSessionHandle sessionid) throws LensException
CubeMetastoreService
getAllDimTableNames
in interface CubeMetastoreService
LensException
public List<String> getStoragesOfFact(LensSessionHandle sessionid, String fact) throws LensException
CubeMetastoreService
getStoragesOfFact
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table name
LensException
public XStorageTableElement getStorageOfFact(LensSessionHandle sessionid, String fact, String storageName) throws LensException
CubeMetastoreService
getStorageOfFact
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table namestorageName
- The storage name
LensException
public XStorageTableElement getStorageOfDim(LensSessionHandle sessionid, String dimTblName, String storageName) throws LensException
CubeMetastoreService
getStorageOfDim
in interface CubeMetastoreService
sessionid
- The sessioniddimTblName
- The dimension table namestorageName
- The storage name
XStorageTableElement
LensException
public void addStorageToFact(LensSessionHandle sessionid, String fact, XStorageTableElement storageTable) throws LensException
CubeMetastoreService
addStorageToFact
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table namestorageTable
- XStorageTableElement containing storage name, update periods and table description
LensException
public void dropStorageOfFact(LensSessionHandle sessionid, String fact, String storage) throws LensException
CubeMetastoreService
dropStorageOfFact
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table name
LensException
public List<XPartition> getAllPartitionsOfFactStorage(LensSessionHandle sessionid, String fact, String storageName, String filter) throws LensException
CubeMetastoreService
getAllPartitionsOfFactStorage
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table namefilter
- The filter for partition listing
XPartition
LensException
public void addPartitionToFactStorage(LensSessionHandle sessionid, String fact, String storageName, XPartition partition) throws LensException
CubeMetastoreService
addPartitionToFactStorage
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table namestorageName
- The storage namepartition
- XPartition
LensException
public List<XPartition> getAllPartitionsOfDimTableStorage(LensSessionHandle sessionid, String dimension, String storageName, String filter) throws LensException
CubeMetastoreService
getAllPartitionsOfDimTableStorage
in interface CubeMetastoreService
sessionid
- The sessioniddimension
- The dimension table namefilter
- The filter for the list of partitions
XPartition
LensException
public void addPartitionToDimStorage(LensSessionHandle sessionid, String dimTblName, String storageName, XPartition partition) throws LensException
CubeMetastoreService
addPartitionToDimStorage
in interface CubeMetastoreService
sessionid
- The sessioniddimTblName
- The dimension table namestorageName
- The storage namepartition
- XPartition
LensException
public void dropPartitionFromStorageByValues(LensSessionHandle sessionid, String cubeTableName, String storageName, String values) throws LensException
CubeMetastoreService
dropPartitionFromStorageByValues
in interface CubeMetastoreService
sessionid
- The sessionidcubeTableName
- The cube table name - fact/dimension table namestorageName
- The storage namevalues
- The comma separated values for all partition columns
LensException
public void dropPartitionFromStorageByFilter(LensSessionHandle sessionid, String cubeTableName, String storageName, String filter) throws LensException
CubeMetastoreService
dropPartitionFromStorageByFilter
in interface CubeMetastoreService
sessionid
- The sessionidcubeTableName
- The cube table name - fact/dimension table namestorageName
- The storage namefilter
- The partition filter - all partitions which obey the filter will be dropped
LensException
public void createStorage(LensSessionHandle sessionid, XStorage storage) throws LensException
CubeMetastoreService
createStorage
in interface CubeMetastoreService
LensException
public void dropStorage(LensSessionHandle sessionid, String storageName) throws LensException
CubeMetastoreService
dropStorage
in interface CubeMetastoreService
LensException
public void alterStorage(LensSessionHandle sessionid, String storageName, XStorage storage) throws LensException
CubeMetastoreService
alterStorage
in interface CubeMetastoreService
LensException
public XStorage getStorage(LensSessionHandle sessionid, String storageName) throws LensException
CubeMetastoreService
getStorage
in interface CubeMetastoreService
LensException
public List<String> getAllStorageNames(LensSessionHandle sessionid) throws LensException
CubeMetastoreService
getAllStorageNames
in interface CubeMetastoreService
LensException
public List<String> getAllBaseCubeNames(LensSessionHandle sessionid) throws LensException
CubeMetastoreService
getAllBaseCubeNames
in interface CubeMetastoreService
LensException
public List<String> getAllDerivedCubeNames(LensSessionHandle sessionid) throws LensException
CubeMetastoreService
getAllDerivedCubeNames
in interface CubeMetastoreService
LensException
public List<String> getAllQueryableCubeNames(LensSessionHandle sessionid) throws LensException
CubeMetastoreService
getAllQueryableCubeNames
in interface CubeMetastoreService
sessionid
- session id
LensException
public void createDimension(LensSessionHandle sessionid, XDimension dimension) throws LensException
CubeMetastoreService
createDimension
in interface CubeMetastoreService
LensException
public XDimension getDimension(LensSessionHandle sessionid, String dimName) throws LensException
CubeMetastoreService
getDimension
in interface CubeMetastoreService
LensException
public void dropDimension(LensSessionHandle sessionid, String dimName) throws LensException
CubeMetastoreService
dropDimension
in interface CubeMetastoreService
LensException
public void updateDimension(LensSessionHandle sessionid, String dimName, XDimension dimension) throws LensException
CubeMetastoreService
updateDimension
in interface CubeMetastoreService
sessionid
- dimName JAXB Dimension object
LensException
public List<String> getAllDimensionNames(LensSessionHandle sessionid) throws LensException
CubeMetastoreService
getAllDimensionNames
in interface CubeMetastoreService
LensException
public XNativeTable getNativeTable(LensSessionHandle sessionid, String name) throws LensException
CubeMetastoreService
getNativeTable
in interface CubeMetastoreService
sessionid
- session idname
- The table name
NativeTable
object
LensException
public List<String> getAllNativeTableNames(LensSessionHandle sessionid, String dbOption, String dbName) throws LensException
CubeMetastoreService
getAllNativeTableNames
in interface CubeMetastoreService
sessionid
- session iddbOption
- To get from current or all, the option is ignored if dbname is passeddbName
- The db name
LensException
public XFlattenedColumns getFlattenedColumns(LensSessionHandle sessionHandle, String tableName) throws LensException
CubeMetastoreService
getFlattenedColumns
in interface CubeMetastoreService
tableName
- The table name - cube name or dimension name
FlattenedColumns
LensException
public Date getLatestDateOfCube(LensSessionHandle sessionid, String cubeName, String timeDimension) throws LensException, org.apache.hadoop.hive.ql.metadata.HiveException
CubeMetastoreService
getLatestDateOfCube
in interface CubeMetastoreService
sessionid
- The session idcubeName
- The base cube nametimeDimension
- time dimension name
LensException
org.apache.hadoop.hive.ql.metadata.HiveException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |