public class CubeMetastoreServiceImpl extends BaseLensService implements CubeMetastoreService
NAME
Constructor and Description |
---|
CubeMetastoreServiceImpl(org.apache.hive.service.cli.CLIService cliService) |
Modifier and Type | Method and Description |
---|---|
void |
addDimTableStorage(LensSessionHandle sessionid,
String dimTblName,
XStorageTableElement storageTable)
Add a storage to dimension table
|
int |
addPartitionsToDimStorage(LensSessionHandle sessionid,
String dimTblName,
String storageName,
XPartitionList partitions)
Add partitions to dimension table on a storage.
|
int |
addPartitionsToFactStorage(LensSessionHandle sessionid,
String fact,
String storageName,
XPartitionList partitions)
Add partitions to fact on a storage
|
int |
addPartitionToDimStorage(LensSessionHandle sessionid,
String dimTblName,
String storageName,
XPartition partition)
Add partition to dimension table on a storage.
|
int |
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,
String dimensionName)
Get all dimension tables.
|
List<String> |
getAllFactNames(LensSessionHandle sessionid,
String cubeName)
Get all fact names
|
XJoinChains |
getAllJoinChains(LensSessionHandle sessionHandle,
String tableName) |
List<String> |
getAllNativeTableNames(LensSessionHandle sessionid,
String dbOption,
String dbName)
Get names of all native tables
|
XPartitionList |
getAllPartitionsOfDimTableStorage(LensSessionHandle sessionid,
String dimension,
String storageName,
String filter)
Get all partitions of a dimension table in a storage
|
XPartitionList |
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,
boolean addChains)
Get flattened columns - all columns of table + all reachable columns
|
HealthStatus |
getHealthStatus()
Returns the health status of the service.
|
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
|
List<String> |
getPartitionTimelines(LensSessionHandle sessionid,
String factName,
String storage,
String updatePeriod,
String timeDimension) |
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
|
void |
updatePartition(LensSessionHandle sessionid,
String tblName,
String storageName,
XPartition xPartition) |
void |
updatePartitions(LensSessionHandle sessionid,
String tblName,
String storageName,
XPartitionList xPartitions) |
acquire, acquire, addResource, closeSession, deleteResource, getCliService, getHiveSessionHandle, getLensConf, getLensConf, getNumberOfSessions, getServerDomain, getSession, getSessionManager, getValidPath, openSession, prepareStopping, readExternal, release, release, removePrefixBeforeURI, restoreSession, writeExternal
getServices, init, start, stop
public CubeMetastoreServiceImpl(org.apache.hive.service.cli.CLIService cliService)
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 wellLensException
public void createDatabase(LensSessionHandle sessionid, String database, boolean ignore) throws LensException
createDatabase
in interface CubeMetastoreService
database
- database nameignore
- ignore if database already existsLensException
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 objectLensException
public void createDimensionTable(LensSessionHandle sessionid, XDimensionTable xDimTable) throws LensException
createDimensionTable
in interface CubeMetastoreService
xDimTable
- sessionid
- The sessionidLensException
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
XDimensionTable
LensException
public void updateDimensionTable(LensSessionHandle sessionid, XDimensionTable dimensionTable) throws LensException
CubeMetastoreService
updateDimensionTable
in interface CubeMetastoreService
sessionid
- The sessioniddimensionTable
- The new definition of dimension tableLensException
public List<String> getDimTableStorages(LensSessionHandle sessionid, String dimension) throws LensException
CubeMetastoreService
getDimTableStorages
in interface CubeMetastoreService
sessionid
- The sessioniddimension
- The dimension table nameLensException
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 nameLensException
public List<String> getAllDimTableNames(LensSessionHandle sessionid, String dimensionName) throws LensException
CubeMetastoreService
getAllDimTableNames
in interface CubeMetastoreService
dimensionName
- dimension name to be filtered with. OptionalLensException
public void dropAllStoragesOfFact(LensSessionHandle sessionid, String factName) throws LensException
CubeMetastoreService
dropAllStoragesOfFact
in interface CubeMetastoreService
sessionid
- The sessionidfactName
- The fact table nameLensException
public void dropStorageOfDimTable(LensSessionHandle sessionid, String dimTblName, String storage) throws LensException
CubeMetastoreService
dropStorageOfDimTable
in interface CubeMetastoreService
sessionid
- The sessioniddimTblName
- The dimension table namestorage
- The storage nameLensException
public XFactTable getFactTable(LensSessionHandle sessionid, String fact) throws LensException
CubeMetastoreService
getFactTable
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table nameXFactTable
LensException
public void createFactTable(LensSessionHandle sessionid, XFactTable fact) throws LensException
CubeMetastoreService
createFactTable
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table definitionLensException
public void updateFactTable(LensSessionHandle sessionid, XFactTable fact) throws LensException
CubeMetastoreService
updateFactTable
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table's new definitionLensException
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, String cubeName) throws LensException
CubeMetastoreService
getAllFactNames
in interface CubeMetastoreService
sessionid
- The sessionidcubeName
- optional filter filter facts by cube name.LensException
public List<String> getStoragesOfFact(LensSessionHandle sessionid, String fact) throws LensException
CubeMetastoreService
getStoragesOfFact
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table nameLensException
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 nameLensException
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 nameXStorageTableElement
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 descriptionLensException
public void dropStorageOfFact(LensSessionHandle sessionid, String fact, String storage) throws LensException
CubeMetastoreService
dropStorageOfFact
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table namestorage
- The storage nameLensException
public XPartitionList getAllPartitionsOfFactStorage(LensSessionHandle sessionid, String fact, String storageName, String filter) throws LensException
CubeMetastoreService
getAllPartitionsOfFactStorage
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table namestorageName
- The storage namefilter
- The filter for partition listingXPartition
LensException
public int 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 int addPartitionsToFactStorage(LensSessionHandle sessionid, String fact, String storageName, XPartitionList partitions) throws LensException
CubeMetastoreService
addPartitionsToFactStorage
in interface CubeMetastoreService
sessionid
- The sessionidfact
- The fact table namestorageName
- The storage namepartitions
- XPartitionList
LensException
public XPartitionList getAllPartitionsOfDimTableStorage(LensSessionHandle sessionid, String dimension, String storageName, String filter) throws LensException
CubeMetastoreService
getAllPartitionsOfDimTableStorage
in interface CubeMetastoreService
sessionid
- The sessioniddimension
- The dimension table namestorageName
- The storage namefilter
- The filter for the list of partitionsXPartition
LensException
public int 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 updatePartition(LensSessionHandle sessionid, String tblName, String storageName, XPartition xPartition) throws LensException
updatePartition
in interface CubeMetastoreService
LensException
public void updatePartitions(LensSessionHandle sessionid, String tblName, String storageName, XPartitionList xPartitions) throws LensException
updatePartitions
in interface CubeMetastoreService
LensException
public int addPartitionsToDimStorage(LensSessionHandle sessionid, String dimTblName, String storageName, XPartitionList partitions) throws LensException
CubeMetastoreService
addPartitionsToDimStorage
in interface CubeMetastoreService
sessionid
- The sessioniddimTblName
- The dimension table namestorageName
- The storage namepartitions
- XPartitionList
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 columnsLensException
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 droppedLensException
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 idLensException
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 objectLensException
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 nameXNativeTable
objectLensException
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 nameLensException
public XFlattenedColumns getFlattenedColumns(LensSessionHandle sessionHandle, String tableName, boolean addChains) throws LensException
CubeMetastoreService
getFlattenedColumns
in interface CubeMetastoreService
sessionHandle
- The session handletableName
- The table name - cube name or dimension nameXFlattenedColumns
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 nameLensException
org.apache.hadoop.hive.ql.metadata.HiveException
public List<String> getPartitionTimelines(LensSessionHandle sessionid, String factName, String storage, String updatePeriod, String timeDimension) throws LensException, org.apache.hadoop.hive.ql.metadata.HiveException
getPartitionTimelines
in interface CubeMetastoreService
LensException
org.apache.hadoop.hive.ql.metadata.HiveException
public XJoinChains getAllJoinChains(LensSessionHandle sessionHandle, String tableName) throws LensException
getAllJoinChains
in interface CubeMetastoreService
LensException
public HealthStatus getHealthStatus()
BaseLensService
getHealthStatus
in interface HealthCheckable
getHealthStatus
in class BaseLensService
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.