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

org.apache.lens.server.metastore
Class MetastoreResource

java.lang.Object
  extended by org.apache.lens.server.metastore.MetastoreResource

@Path(value="metastore")
@Produces(value={"application/json","application/xml"})
public class MetastoreResource
extends Object

metastore resource api

This provides api for all things metastore.


Field Summary
static org.apache.log4j.Logger LOG
           
static APIResult SUCCESS
           
static ObjectFactory X_CUBE_OBJECT_FACTORY
           
 
Constructor Summary
MetastoreResource()
           
 
Method Summary
 APIResult addPartitionsToDimStorage(LensSessionHandle sessionid, String dimTableName, String storage, XPartitionList partitions)
          Add new partitions for a storage of dimension
 APIResult addPartitionsToFactStorage(LensSessionHandle sessionid, String factName, String storage, XPartitionList partitions)
          Batch Add partitions for a storage of fact
 APIResult addPartitionToDimStorage(LensSessionHandle sessionid, String dimTableName, String storage, XPartition partition)
          Add a new partition for a storage of dimension
 APIResult addPartitionToFactStorage(LensSessionHandle sessionid, String factName, String storage, XPartition partition)
          Add a new partition for a storage of fact
 APIResult addStorageToFact(LensSessionHandle sessionid, String factName, XStorageTableElement storageTable)
          Add storage to fact table
 APIResult createDatabase(LensSessionHandle sessionid, boolean ignoreIfExisting, String dbName)
          Create a new database
 APIResult createDimension(LensSessionHandle sessionid, XDimension dimension)
          Create new dimension
 APIResult createDimensionStorage(LensSessionHandle sessionid, String dimTableName, XStorageTableElement storageTbl)
          Add storage to dimension table
 APIResult createDimensionTable(LensSessionHandle sessionid, XDimensionTable dimensionTable)
          Create a new dimension table
 APIResult createFactTable(LensSessionHandle sessionid, XFactTable fact)
          Create a new fact tabble
 APIResult createNewCube(LensSessionHandle sessionid, XCube cube)
          Create a new cube
 APIResult createNewStorage(LensSessionHandle sessionid, XStorage storage)
          Create new storage
 APIResult deleteAllCubes(LensSessionHandle sessionid)
          Delete all cubes
 APIResult deleteAllDimensions(LensSessionHandle sessionid)
          Delete all dimensions in metastore
 APIResult deleteAllFacts(LensSessionHandle sessionid, boolean cascade)
          Delete all fact tables
 APIResult deleteAllStorages(LensSessionHandle sessionid)
          Delete all storages in metastore
 APIResult dropAllStoragesOfDim(LensSessionHandle sessionid, String dimTableName)
          Drop all the storage tables of a dimension table
 APIResult dropAllStoragesOfFact(LensSessionHandle sessionid, String factName)
          Drop all the storage tables of a fact table
 APIResult dropCube(LensSessionHandle sessionid, String cubeName)
          Drop the cube, specified by name
 APIResult dropDatabase(LensSessionHandle sessionid, String dbName, boolean cascade)
          Delete the db specified by name.
 APIResult dropDimension(LensSessionHandle sessionid, String dimName)
          Drop the dimension, specified by name
 APIResult dropDimensionTable(LensSessionHandle sessionid, String dimension, boolean cascade)
          Drop the dimension table, specified by name
 APIResult dropFactTable(LensSessionHandle sessionid, String factName, boolean cascade)
          Drop the fact table, specified by name
 APIResult dropPartitionOfFactStorageByValues(LensSessionHandle sessionid, String factName, String storage, String values)
          Drop the partitions in the storage of a fact table, specified by exact values
 APIResult dropPartitionsOfDimStorageByFilter(LensSessionHandle sessionid, String dimTableName, String storage, String filter)
          Drop the partitions in the storage of a dimension table; can specified filter as well
 APIResult dropPartitionsOfDimStorageByValue(LensSessionHandle sessionid, String dimTableName, String storage, String values)
          Drop the partitions in the storage of a dimension table, specified by exact values
 APIResult dropPartitionsOfFactStorageByFilter(LensSessionHandle sessionid, String factName, String storage, String filter)
          Drop the partitions in the storage of a fact; can specified filter as well
 APIResult dropStorage(LensSessionHandle sessionid, String storageName)
          Drop the storage, specified by name
 APIResult dropStorageFromFact(LensSessionHandle sessionid, String factName, String storage)
          Drop the storage of a fact, specified by name
 APIResult dropStorageOfDim(LensSessionHandle sessionid, String dimTableName, String storage)
          Drop the storage of a dimension table, specified by name
 StringList getAllCubes(LensSessionHandle sessionid, String cubeTypes)
          Get all cubes in the metastores, of the specified type
 StringList getAllDatabases(LensSessionHandle sessionid)
          Get all databases in the metastore
 StringList getAllDimensionNames(LensSessionHandle sessionid)
          Get all dimensions in the metastore
 StringList getAllDimensionTablesOfDimension(LensSessionHandle sessionid, String dimensionName)
          Get all dimtables that belong to a dimension in the metastore
 StringList getAllDims(LensSessionHandle sessionid)
          Get all dimension tables in the metastore
 StringList getAllFacts(LensSessionHandle sessionid)
          Get all fact tables in the metastore in the current database
 StringList getAllFactsOfCube(LensSessionHandle sessionid, String cubeName)
          Get all facts that belong to a cube in the metastore
 StringList getAllNativeTables(LensSessionHandle sessionid, String dbOption, String dbName)
          Get all native tables.
 JAXBElement<XPartitionList> getAllPartitionsOfDimStorage(LensSessionHandle sessionid, String dimension, String storage, String filter)
          Get all partition of the dimension table in the specified storage; can be filtered
 JAXBElement<XPartitionList> getAllPartitionsOfFactStorageByFilter(LensSessionHandle sessionid, String factName, String storage, String filter)
          Get all partitions of the fact table in the specified storage; can be filtered as well.
 StringList getAllStorages(LensSessionHandle sessionid)
          Get all storages in the metastore
 JAXBElement<XCube> getCube(LensSessionHandle sessionid, String cubeName)
          Get the cube specified by name
 String getDatabase(LensSessionHandle sessionid)
          Get the current database
 JAXBElement<XDimension> getDimension(LensSessionHandle sessionid, String dimName)
          Get the dimension specified by name
 StringList getDimensionStorages(LensSessionHandle sessionid, String dimension)
          Get all storages of the dimension table in the metastore
 JAXBElement<XDimensionTable> getDimensionTable(LensSessionHandle sessionid, String dimTableName)
          Get the dimension table specified by name
 JAXBElement<XFactTable> getFactTable(LensSessionHandle sessionid, String factName)
          Get the fact table specified by name
 JAXBElement<XFlattenedColumns> getFlattenedColumns(LensSessionHandle sessionid, String tableName)
          Get flattened list of columns reachable from a cube or a dimension
 DateTime 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.
 String getMessage()
          API to know if metastore service is up and running
 JAXBElement<XNativeTable> getNativeTable(LensSessionHandle sessionid, String tableName)
          Get the native table passed in name
 JAXBElement<XStorage> getStorage(LensSessionHandle sessionid, String storageName)
          Get the storage specified by name
 JAXBElement<XStorageTableElement> getStorageOfDim(LensSessionHandle sessionid, String dimTableName, String storage)
          Get the dim storage table
 JAXBElement<XStorageTableElement> getStorageOfFact(LensSessionHandle sessionid, String factName, String storage)
          Get the fact storage table
 StringList getStoragesOfFact(LensSessionHandle sessionid, String factName)
          Get all storages of the fact table in the metastore
 CubeMetastoreService getSvc()
           
 APIResult setDatabase(LensSessionHandle sessionid, String dbName)
          Set the current db
 APIResult updateCube(LensSessionHandle sessionid, String cubeName, XCube cube)
          Update cube definition
 APIResult updateCubeDimension(LensSessionHandle sessionid, String dimTableName, XDimensionTable dimensionTable)
          Update dimension table definition
 APIResult updateDimension(LensSessionHandle sessionid, String dimName, XDimension dimension)
          Update dimension definition
 APIResult updateFactTable(LensSessionHandle sessionid, String factName, XFactTable fact)
          Update fact table definition
 APIResult updateStorage(LensSessionHandle sessionid, String storageName, XStorage storage)
          Update storage definition
 
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

SUCCESS

public static final APIResult SUCCESS

X_CUBE_OBJECT_FACTORY

public static final ObjectFactory X_CUBE_OBJECT_FACTORY
Constructor Detail

MetastoreResource

public MetastoreResource()
Method Detail

getSvc

public CubeMetastoreService getSvc()

getMessage

@GET
@Produces(value="text/plain")
public String getMessage()
API to know if metastore service is up and running

Returns:
Simple text saying it up

getAllDatabases

@GET
@Path(value="databases")
public StringList getAllDatabases(@QueryParam(value="sessionid")
                                           LensSessionHandle sessionid)
Get all databases in the metastore

Parameters:
sessionid - The sessionid in which user is working
Returns:
StringList consisting of all database names.
Throws:
LensException

getDatabase

@GET
@Path(value="databases/current")
public String getDatabase(@QueryParam(value="sessionid")
                                   LensSessionHandle sessionid)
Get the current database

Parameters:
sessionid - The sessionid in which user is working
Returns:
The current db name

setDatabase

@PUT
@Path(value="databases/current")
@Consumes(value={"application/xml","application/json"})
public APIResult setDatabase(@QueryParam(value="sessionid")
                                               LensSessionHandle sessionid,
                                               String dbName)
Set the current db

Parameters:
sessionid - The sessionid in which user is working
dbName - The db name
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if set was successful. APIResult with state APIResult.Status.FAILED, if set has failed

dropDatabase

@DELETE
@Path(value="databases/{dbName}")
public APIResult dropDatabase(@QueryParam(value="sessionid")
                                          LensSessionHandle sessionid,
                                          @PathParam(value="dbName")
                                          String dbName,
                                          @QueryParam(value="cascade")
                                          boolean cascade)
Delete the db specified by name. Deleting underlying tables is optional. If db does not exist, delete is ignored.

Parameters:
sessionid - The sessionid in which user is working
dbName - The db name
cascade - if true, all the tables inside the db will also be dropped.
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if delete was successful. APIResult with state APIResult.Status.FAILED, if delete has failed

createDatabase

@POST
@Path(value="databases")
public APIResult createDatabase(@QueryParam(value="sessionid")
                                          LensSessionHandle sessionid,
                                          @QueryParam(value="ignoreIfExisting")@DefaultValue(value="true")
                                          boolean ignoreIfExisting,
                                          String dbName)
Create a new database

Parameters:
sessionid - The sessionid in which user is working
ignoreIfExisting - If true, create will be ignored if db already exists, otherwise it fails.
dbName - The db name
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if create was successful. APIResult with state APIResult.Status.FAILED, if create has failed

getAllNativeTables

@GET
@Path(value="nativetables")
public StringList getAllNativeTables(@QueryParam(value="sessionid")
                                              LensSessionHandle sessionid,
                                              @QueryParam(value="dbOption")
                                              String dbOption,
                                              @QueryParam(value="dbName")
                                              String dbName)
Get all native tables.

Parameters:
sessionid - The sessionid in which user is working
dbOption - The options available are 'current' and 'all'. If option is current, gives all tables from current db. If option is all, gives all tables from all databases. If dbname is passed, dbOption is ignored. If no dbOption or dbname are passed, then default is to get tables from current db.
dbName - The db name. If not empty, the tables in the db will be returned
Returns:
StringList consisting of all table names.
Throws:
LensException

getNativeTable

@GET
@Path(value="nativetables/{tableName}")
public JAXBElement<XNativeTable> getNativeTable(@QueryParam(value="sessionid")
                                                         LensSessionHandle sessionid,
                                                         @PathParam(value="tableName")
                                                         String tableName)
Get the native table passed in name

Parameters:
sessionid - The sessionid in which user is working
tableName - The native table name
Returns:
JAXB representation of XNativeTable
Throws:
LensException

getAllCubes

@GET
@Path(value="cubes")
public StringList getAllCubes(@QueryParam(value="sessionid")
                                       LensSessionHandle sessionid,
                                       @QueryParam(value="type")@DefaultValue(value="all")
                                       String cubeTypes)
Get all cubes in the metastores, of the specified type

Parameters:
sessionid - The sessionid in which user is working
cubeTypes - The type of cubes. Accepted values are 'all' or 'base' or 'derived' or 'queryable'
Returns:
StringList consisting of all cubes names

deleteAllCubes

@DELETE
@Path(value="cubes")
public APIResult deleteAllCubes(@QueryParam(value="sessionid")
                                            LensSessionHandle sessionid)
Delete all cubes

Parameters:
sessionid - The sessionid in which user is working
Returns:
APIResult with state APIResult.Status.SUCCEEDED in case of successful delete. APIResult with state APIResult.Status.FAILED in case of delete failure. APIResult with state APIResult.Status.PARTIAL in case of partial delete.

createNewCube

@POST
@Path(value="cubes")
public APIResult createNewCube(@QueryParam(value="sessionid")
                                         LensSessionHandle sessionid,
                                         XCube cube)
Create a new cube

Parameters:
sessionid - The sessionid in which user is working
cube - The XCube representation of the cube definition
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if create was successful. APIResult with state APIResult.Status.FAILED, if create has failed

updateCube

@PUT
@Path(value="/cubes/{cubeName}")
public APIResult updateCube(@QueryParam(value="sessionid")
                                     LensSessionHandle sessionid,
                                     @PathParam(value="cubeName")
                                     String cubeName,
                                     XCube cube)
Update cube definition

Parameters:
sessionid - The sessionid in which user is working
cubeName - The cube name
cube - The XCube representation of the updated cube definition
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if update was successful. APIResult with state APIResult.Status.FAILED, if udpate has failed

getCube

@GET
@Path(value="/cubes/{cubeName}")
public JAXBElement<XCube> getCube(@QueryParam(value="sessionid")
                                           LensSessionHandle sessionid,
                                           @PathParam(value="cubeName")
                                           String cubeName)
Get the cube specified by name

Parameters:
sessionid - The sessionid in which user is working
cubeName - The cube name
Returns:
JAXB representation of XCube

dropCube

@DELETE
@Path(value="/cubes/{cubeName}")
public APIResult dropCube(@QueryParam(value="sessionid")
                                      LensSessionHandle sessionid,
                                      @PathParam(value="cubeName")
                                      String cubeName)
Drop the cube, specified by name

Parameters:
sessionid - The sessionid in which user is working
cubeName - The cube name
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

getAllStorages

@GET
@Path(value="storages")
public StringList getAllStorages(@QueryParam(value="sessionid")
                                          LensSessionHandle sessionid)
Get all storages in the metastore

Parameters:
sessionid - The sessionid in which user is working
Returns:
StringList consisting of all the storage names
Throws:
LensException

createNewStorage

@POST
@Path(value="storages")
public APIResult createNewStorage(@QueryParam(value="sessionid")
                                            LensSessionHandle sessionid,
                                            XStorage storage)
Create new storage

Parameters:
sessionid - The sessionid in which user is working
storage - The XStorage representation of storage
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if create was successful. APIResult with state APIResult.Status.FAILED, if create has failed

deleteAllStorages

@DELETE
@Path(value="storages")
public APIResult deleteAllStorages(@QueryParam(value="sessionid")
                                               LensSessionHandle sessionid)
Delete all storages in metastore

Parameters:
sessionid - The sessionid in which user is working
Returns:
APIResult with state APIResult.Status.SUCCEEDED in case of successful delete. APIResult with state APIResult.Status.FAILED in case of delete failure. APIResult with state APIResult.Status.PARTIAL in case of partial delete.

updateStorage

@PUT
@Path(value="/storages/{storageName}")
public APIResult updateStorage(@QueryParam(value="sessionid")
                                        LensSessionHandle sessionid,
                                        @PathParam(value="storageName")
                                        String storageName,
                                        XStorage storage)
Update storage definition

Parameters:
sessionid - The sessionid in which user is working
storageName - The storage name
storage - The XStorage representation of the updated storage definition
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if update was successful. APIResult with state APIResult.Status.FAILED, if update has failed

getStorage

@GET
@Path(value="/storages/{storage}")
public JAXBElement<XStorage> getStorage(@QueryParam(value="sessionid")
                                                 LensSessionHandle sessionid,
                                                 @PathParam(value="storage")
                                                 String storageName)
                                 throws Exception
Get the storage specified by name

Parameters:
sessionid - The sessionid in which user is working
storageName - The storage name
Returns:
JAXB representation of XStorage
Throws:
Exception

dropStorage

@DELETE
@Path(value="/storages/{storage}")
public APIResult dropStorage(@QueryParam(value="sessionid")
                                         LensSessionHandle sessionid,
                                         @PathParam(value="storage")
                                         String storageName)
Drop the storage, specified by name

Parameters:
sessionid - The sessionid in which user is working
storageName - The storage name
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

getAllDimensionNames

@GET
@Path(value="dimensions")
public StringList getAllDimensionNames(@QueryParam(value="sessionid")
                                                LensSessionHandle sessionid)
Get all dimensions in the metastore

Parameters:
sessionid - The sessionid in which user is working
Returns:
StringList consisting of all the dimension names
Throws:
LensException

createDimension

@POST
@Path(value="dimensions")
public APIResult createDimension(@QueryParam(value="sessionid")
                                           LensSessionHandle sessionid,
                                           XDimension dimension)
Create new dimension

Parameters:
sessionid - The sessionid in which user is working
dimension - The XDimension representation of dimension
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if create was successful. APIResult with state APIResult.Status.FAILED, if create has failed

deleteAllDimensions

@DELETE
@Path(value="dimensions")
public APIResult deleteAllDimensions(@QueryParam(value="sessionid")
                                                 LensSessionHandle sessionid)
Delete all dimensions in metastore

Parameters:
sessionid - The sessionid in which user is working
Returns:
APIResult with state APIResult.Status.SUCCEEDED in case of successful delete. APIResult with state APIResult.Status.FAILED in case of delete failure. APIResult with state APIResult.Status.PARTIAL in case of partial delete.

updateDimension

@PUT
@Path(value="/dimensions/{dimName}")
public APIResult updateDimension(@QueryParam(value="sessionid")
                                          LensSessionHandle sessionid,
                                          @PathParam(value="dimName")
                                          String dimName,
                                          XDimension dimension)
Update dimension definition

Parameters:
sessionid - The sessionid in which user is working
dimName - The dimension name
dimension - The XDimension representation of the updated dimension definition
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if update was successful. APIResult with state APIResult.Status.FAILED, if update has failed

getDimension

@GET
@Path(value="/dimensions/{dimName}")
public JAXBElement<XDimension> getDimension(@QueryParam(value="sessionid")
                                                     LensSessionHandle sessionid,
                                                     @PathParam(value="dimName")
                                                     String dimName)
                                     throws Exception
Get the dimension specified by name

Parameters:
sessionid - The sessionid in which user is working
dimName - The dimension name
Returns:
JAXB representation of XDimension
Throws:
Exception

dropDimension

@DELETE
@Path(value="/dimensions/{dimName}")
public APIResult dropDimension(@QueryParam(value="sessionid")
                                           LensSessionHandle sessionid,
                                           @PathParam(value="dimName")
                                           String dimName)
Drop the dimension, specified by name

Parameters:
sessionid - The sessionid in which user is working
dimName - The dimension name
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

getAllDimensionTablesOfDimension

@GET
@Path(value="/dimensions/{dimName}/dimtables")
public StringList getAllDimensionTablesOfDimension(@QueryParam(value="sessionid")
                                                            LensSessionHandle sessionid,
                                                            @PathParam(value="dimName")
                                                            String dimensionName)
                                            throws LensException
Get all dimtables that belong to a dimension in the metastore

Parameters:
sessionid - The sessionid in which user is working
dimensionName - name of the dimension
Returns:
List of XDimensionTable objects
Throws:
LensException

getAllFactsOfCube

@GET
@Path(value="/cubes/{cubeName}/facts")
public StringList getAllFactsOfCube(@QueryParam(value="sessionid")
                                             LensSessionHandle sessionid,
                                             @PathParam(value="cubeName")
                                             String cubeName)
                             throws LensException
Get all facts that belong to a cube in the metastore

Parameters:
sessionid - The sessionid in which user is working
cubeName - name of the base cube or derived cube
Returns:
List of XFactTable objects
Throws:
LensException

getAllFacts

@GET
@Path(value="/facts")
public StringList getAllFacts(@QueryParam(value="sessionid")
                                       LensSessionHandle sessionid)
                       throws LensException
Get all fact tables in the metastore in the current database

Parameters:
sessionid - The sessionid in which user is working
Returns:
StringList consisting of all fact table names
Throws:
LensException

deleteAllFacts

@DELETE
@Path(value="facts")
public APIResult deleteAllFacts(@QueryParam(value="sessionid")
                                            LensSessionHandle sessionid,
                                            @DefaultValue(value="false")@QueryParam(value="cascade")
                                            boolean cascade)
Delete all fact tables

Parameters:
sessionid - The sessionid in which user is working
cascade - if set to true, all the underlying tables will be dropped, if set to false, only the fact table will be dropped
Returns:
APIResult with state APIResult.Status.SUCCEEDED in case of successful delete. APIResult with state APIResult.Status.FAILED in case of delete failure. APIResult with state APIResult.Status.PARTIAL in case of partial delete.

getFactTable

@GET
@Path(value="/facts/{factName}")
public JAXBElement<XFactTable> getFactTable(@QueryParam(value="sessionid")
                                                     LensSessionHandle sessionid,
                                                     @PathParam(value="factName")
                                                     String factName)
                                     throws LensException
Get the fact table specified by name

Parameters:
sessionid - The sessionid in which user is working
factName - The fact table name
Returns:
JAXB representation of XFactTable
Throws:
LensException

createFactTable

@Consumes(value="multipart/form-data")
@POST
@Path(value="/facts")
public APIResult createFactTable(LensSessionHandle sessionid,
                                                    XFactTable fact)
                          throws LensException
Create a new fact tabble

Parameters:
sessionid - The sessionid in which user is working
fact - The XFactTable representation of the fact table definition
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if create was successful. APIResult with state APIResult.Status.FAILED, if create has failed
Throws:
LensException

updateFactTable

@PUT
@Path(value="/facts/{factName}")
public APIResult updateFactTable(@QueryParam(value="sessionid")
                                          LensSessionHandle sessionid,
                                          @PathParam(value="factName")
                                          String factName,
                                          XFactTable fact)
                          throws LensException
Update fact table definition

Parameters:
sessionid - The sessionid in which user is working
factName - name of the fact table
fact - The XFactTable representation of the updated fact table definition
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if update was successful. APIResult with state APIResult.Status.FAILED, if udpate has failed
Throws:
LensException

dropFactTable

@DELETE
@Path(value="/facts/{factName}")
public APIResult dropFactTable(@QueryParam(value="sessionid")
                                           LensSessionHandle sessionid,
                                           @PathParam(value="factName")
                                           String factName,
                                           @DefaultValue(value="false")@QueryParam(value="cascade")
                                           boolean cascade)
                        throws LensException
Drop the fact table, specified by name

Parameters:
sessionid - The sessionid in which user is working
factName - The fact table name
cascade - If true, all the storage tables of the fact will also be dropped
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed
Throws:
LensException

getStoragesOfFact

@GET
@Path(value="/facts/{factName}/storages")
public StringList getStoragesOfFact(@QueryParam(value="sessionid")
                                             LensSessionHandle sessionid,
                                             @PathParam(value="factName")
                                             String factName)
                             throws LensException
Get all storages of the fact table in the metastore

Parameters:
sessionid - The sessionid in which user is working
factName - The fact table name
Returns:
StringList consisting of all the storage names
Throws:
LensException

dropAllStoragesOfFact

@DELETE
@Path(value="/facts/{factName}/storages")
public APIResult dropAllStoragesOfFact(@QueryParam(value="sessionid")
                                                   LensSessionHandle sessionid,
                                                   @PathParam(value="factName")
                                                   String factName)
Drop all the storage tables of a fact table

Parameters:
sessionid - The sessionid in which user is working
factName - The fact table name
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

addStorageToFact

@POST
@Path(value="/facts/{factName}/storages")
public APIResult addStorageToFact(@QueryParam(value="sessionid")
                                            LensSessionHandle sessionid,
                                            @PathParam(value="factName")
                                            String factName,
                                            XStorageTableElement storageTable)
Add storage to fact table

Parameters:
sessionid - The sessionid in which user is working
factName - The fact table name
storageTable - The storage table description
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if add was successful. APIResult with state APIResult.Status.FAILED, if add has failed

dropStorageFromFact

@DELETE
@Path(value="/facts/{factName}/storages/{storage}")
public APIResult dropStorageFromFact(@QueryParam(value="sessionid")
                                                 LensSessionHandle sessionid,
                                                 @PathParam(value="factName")
                                                 String factName,
                                                 @PathParam(value="storage")
                                                 String storage)
Drop the storage of a fact, specified by name

Parameters:
sessionid - The sessionid in which user is working
factName - The fact table name
storage - The storage name
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

getStorageOfFact

@GET
@Path(value="/facts/{factName}/storages/{storage}")
public JAXBElement<XStorageTableElement> getStorageOfFact(@QueryParam(value="sessionid")
                                                                   LensSessionHandle sessionid,
                                                                   @PathParam(value="factName")
                                                                   String factName,
                                                                   @PathParam(value="storage")
                                                                   String storage)
                                                   throws LensException
Get the fact storage table

Parameters:
sessionid - The sessionid in which user is working
factName - The fact table name
storage - The storage name
Returns:
JAXB representation of XStorageTableElement
Throws:
LensException

getAllPartitionsOfFactStorageByFilter

@GET
@Path(value="/facts/{factName}/storages/{storage}/partitions")
public JAXBElement<XPartitionList> getAllPartitionsOfFactStorageByFilter(@QueryParam(value="sessionid")
                                                                                  LensSessionHandle sessionid,
                                                                                  @PathParam(value="factName")
                                                                                  String factName,
                                                                                  @PathParam(value="storage")
                                                                                  String storage,
                                                                                  @QueryParam(value="filter")
                                                                                  String filter)
                                                                  throws LensException
Get all partitions of the fact table in the specified storage; can be filtered as well.

Parameters:
sessionid - The sessionid in which user is working
factName - The fact table name
storage - The storage name
filter - The filter for partitions, string representation of the filter for ex: x < "xxx" and y > "yyy"
Returns:
JAXB representation of XPartitionList containing XPartition objects
Throws:
LensException

dropPartitionsOfFactStorageByFilter

@DELETE
@Path(value="/facts/{factName}/storages/{storage}/partitions")
public APIResult dropPartitionsOfFactStorageByFilter(@QueryParam(value="sessionid")
                                                                 LensSessionHandle sessionid,
                                                                 @PathParam(value="factName")
                                                                 String factName,
                                                                 @PathParam(value="storage")
                                                                 String storage,
                                                                 @QueryParam(value="filter")
                                                                 String filter)
Drop the partitions in the storage of a fact; can specified filter as well

Parameters:
sessionid - The sessionid in which user is working
factName - The fact table name
storage - The storage name
filter - The filter for partitions, string representation of the filter for ex: x < "xxx" and y > "yyy"
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

addPartitionToFactStorage

@POST
@Path(value="/facts/{factName}/storages/{storage}/partition")
public APIResult addPartitionToFactStorage(@QueryParam(value="sessionid")
                                                     LensSessionHandle sessionid,
                                                     @PathParam(value="factName")
                                                     String factName,
                                                     @PathParam(value="storage")
                                                     String storage,
                                                     XPartition partition)
Add a new partition for a storage of fact

Parameters:
sessionid - The sessionid in which user is working
factName - fact table name
storage - storage name
partition - XPartition representation of partition
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if add was successful. APIResult with state APIResult.Status.FAILED, if add has failed

addPartitionsToFactStorage

@POST
@Path(value="/facts/{factName}/storages/{storage}/partitions")
public APIResult addPartitionsToFactStorage(@QueryParam(value="sessionid")
                                                      LensSessionHandle sessionid,
                                                      @PathParam(value="factName")
                                                      String factName,
                                                      @PathParam(value="storage")
                                                      String storage,
                                                      XPartitionList partitions)
Batch Add partitions for a storage of fact

Parameters:
sessionid - The sessionid in which user is working
factName - fact table name
storage - storage name
partitions - XPartitionList representation of partitions
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if add was successful. APIResult with state APIResult.Status.FAILED, if add has failed

dropPartitionOfFactStorageByValues

@DELETE
@Path(value="/facts/{factName}/storages/{storage}/partition")
public APIResult dropPartitionOfFactStorageByValues(@QueryParam(value="sessionid")
                                                                LensSessionHandle sessionid,
                                                                @PathParam(value="factName")
                                                                String factName,
                                                                @PathParam(value="storage")
                                                                String storage,
                                                                @QueryParam(value="values")
                                                                String values)
Drop the partitions in the storage of a fact table, specified by exact values

Parameters:
sessionid - The sessionid in which user is working
factName - The fact table name
storage - The storage name
values - Comma separated values
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

getAllDims

@GET
@Path(value="/dimtables")
public StringList getAllDims(@QueryParam(value="sessionid")
                                      LensSessionHandle sessionid)
                      throws LensException
Get all dimension tables in the metastore

Parameters:
sessionid - The sessionid in which user is working
Returns:
StringList consisting of all dimension table names
Throws:
LensException

createDimensionTable

@POST
@Path(value="/dimtables")
public APIResult createDimensionTable(LensSessionHandle sessionid,
                                                XDimensionTable dimensionTable)
Create a new dimension table

Parameters:
sessionid - The sessionid in which user is working
dimensionTable - The XDimensionTable representation of the dimension table definition
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if create was successful. APIResult with state APIResult.Status.FAILED, if create has failed

updateCubeDimension

@PUT
@Path(value="/dimtables/{dimTableName}")
public APIResult updateCubeDimension(@QueryParam(value="sessionid")
                                              LensSessionHandle sessionid,
                                              @PathParam(value="dimTableName")
                                              String dimTableName,
                                              XDimensionTable dimensionTable)
Update dimension table definition

Parameters:
sessionid - The sessionid in which user is working
dimensionTable - The XDimensionTable representation of the updated dim table definition
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if update was successful. APIResult with state APIResult.Status.FAILED, if udpate has failed

dropDimensionTable

@DELETE
@Path(value="/dimtables/{dimTableName}")
public APIResult dropDimensionTable(@QueryParam(value="sessionid")
                                                LensSessionHandle sessionid,
                                                @PathParam(value="dimTableName")
                                                String dimension,
                                                @QueryParam(value="cascade")
                                                boolean cascade)
Drop the dimension table, specified by name

Parameters:
sessionid - The sessionid in which user is working
dimension - The dimension table name
cascade - if true, all the storage tables of dimension table will also be dropped
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

getDimensionTable

@GET
@Path(value="/dimtables/{dimTableName}")
public JAXBElement<XDimensionTable> getDimensionTable(@QueryParam(value="sessionid")
                                                               LensSessionHandle sessionid,
                                                               @PathParam(value="dimTableName")
                                                               String dimTableName)
                                               throws LensException
Get the dimension table specified by name

Parameters:
sessionid - The sessionid in which user is working
dimTableName - The cube name
Returns:
JAXB representation of XDimensionTable
Throws:
LensException

getDimensionStorages

@GET
@Path(value="/dimtables/{dimTableName}/storages")
public StringList getDimensionStorages(@QueryParam(value="sessionid")
                                                LensSessionHandle sessionid,
                                                @PathParam(value="dimTableName")
                                                String dimension)
                                throws LensException
Get all storages of the dimension table in the metastore

Parameters:
sessionid - The sessionid in which user is working
dimension - The dimension table name
Returns:
StringList consisting of all the storage names
Throws:
LensException

createDimensionStorage

@POST
@Path(value="/dimtables/{dimTableName}/storages")
public APIResult createDimensionStorage(@QueryParam(value="sessionid")
                                                  LensSessionHandle sessionid,
                                                  @PathParam(value="dimTableName")
                                                  String dimTableName,
                                                  XStorageTableElement storageTbl)
Add storage to dimension table

Parameters:
sessionid - The sessionid in which user is working
dimTableName - The dimension table name
storageTbl - The Storage table description
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if add was successful. APIResult with state APIResult.Status.FAILED, if add has failed

getStorageOfDim

@GET
@Path(value="/dimtables/{dimTableName}/storages/{storage}")
public JAXBElement<XStorageTableElement> getStorageOfDim(@QueryParam(value="sessionid")
                                                                  LensSessionHandle sessionid,
                                                                  @PathParam(value="dimTableName")
                                                                  String dimTableName,
                                                                  @PathParam(value="storage")
                                                                  String storage)
                                                  throws LensException
Get the dim storage table

Parameters:
sessionid - The sessionid in which user is working
dimTableName - The fact table name
storage - The storage name
Returns:
JAXB representation of XStorageTableElement
Throws:
LensException

dropAllStoragesOfDim

@DELETE
@Path(value="/dimtables/{dimTableName}/storages")
public APIResult dropAllStoragesOfDim(@QueryParam(value="sessionid")
                                                  LensSessionHandle sessionid,
                                                  @PathParam(value="dimTableName")
                                                  String dimTableName)
Drop all the storage tables of a dimension table

Parameters:
sessionid - The sessionid in which user is working
dimTableName - The dimension table name
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

dropStorageOfDim

@DELETE
@Path(value="/dimtables/{dimTableName}/storages/{storage}")
public APIResult dropStorageOfDim(@QueryParam(value="sessionid")
                                              LensSessionHandle sessionid,
                                              @PathParam(value="dimTableName")
                                              String dimTableName,
                                              @PathParam(value="storage")
                                              String storage)
Drop the storage of a dimension table, specified by name

Parameters:
sessionid - The sessionid in which user is working
dimTableName - The dimension table name
storage - The storage name
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

getAllPartitionsOfDimStorage

@GET
@Path(value="/dimtables/{dimTableName}/storages/{storage}/partitions")
public JAXBElement<XPartitionList> getAllPartitionsOfDimStorage(@QueryParam(value="sessionid")
                                                                         LensSessionHandle sessionid,
                                                                         @PathParam(value="dimTableName")
                                                                         String dimension,
                                                                         @PathParam(value="storage")
                                                                         String storage,
                                                                         @QueryParam(value="filter")
                                                                         String filter)
                                                         throws LensException
Get all partition of the dimension table in the specified storage; can be filtered

Parameters:
sessionid - The sessionid in which user is working
dimension - The dimension table name
storage - The storage name
filter - The filter for partitions, string representation of the filter for ex: x < "xxx" and y > "yyy"
Returns:
JAXB representation of XPartitionList containing XPartition objects
Throws:
LensException

dropPartitionsOfDimStorageByFilter

@DELETE
@Path(value="/dimtables/{dimTableName}/storages/{storage}/partitions")
public APIResult dropPartitionsOfDimStorageByFilter(@QueryParam(value="sessionid")
                                                                LensSessionHandle sessionid,
                                                                @PathParam(value="dimTableName")
                                                                String dimTableName,
                                                                @PathParam(value="storage")
                                                                String storage,
                                                                @QueryParam(value="filter")
                                                                String filter)
Drop the partitions in the storage of a dimension table; can specified filter as well

Parameters:
sessionid - The sessionid in which user is working
dimTableName - The dimension table name
storage - The storage name
filter - The filter for partitions, string representation of the filter for ex: x < 'xxx' and y > 'yyy'
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

dropPartitionsOfDimStorageByValue

@DELETE
@Path(value="/dimtables/{dimTableName}/storages/{storage}/partition")
public APIResult dropPartitionsOfDimStorageByValue(@QueryParam(value="sessionid")
                                                               LensSessionHandle sessionid,
                                                               @PathParam(value="dimTableName")
                                                               String dimTableName,
                                                               @PathParam(value="storage")
                                                               String storage,
                                                               @QueryParam(value="values")
                                                               String values)
Drop the partitions in the storage of a dimension table, specified by exact values

Parameters:
sessionid - The sessionid in which user is working
dimTableName - The dimension table name
storage - The storage name
values - Comma separated values
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if drop was successful. APIResult with state APIResult.Status.FAILED, if drop has failed

addPartitionToDimStorage

@POST
@Path(value="/dimtables/{dimTableName}/storages/{storage}/partition")
public APIResult addPartitionToDimStorage(@QueryParam(value="sessionid")
                                                    LensSessionHandle sessionid,
                                                    @PathParam(value="dimTableName")
                                                    String dimTableName,
                                                    @PathParam(value="storage")
                                                    String storage,
                                                    XPartition partition)
Add a new partition for a storage of dimension

Parameters:
sessionid - The sessionid in which user is working
dimTableName - dimension table name
storage - storage name
partition - XPartition representation of partition
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if add was successful. APIResult with state APIResult.Status.FAILED, if add has failed

addPartitionsToDimStorage

@POST
@Path(value="/dimtables/{dimTableName}/storages/{storage}/partitions")
public APIResult addPartitionsToDimStorage(@QueryParam(value="sessionid")
                                                     LensSessionHandle sessionid,
                                                     @PathParam(value="dimTableName")
                                                     String dimTableName,
                                                     @PathParam(value="storage")
                                                     String storage,
                                                     XPartitionList partitions)
Add new partitions for a storage of dimension

Parameters:
sessionid - The sessionid in which user is working
dimTableName - dimension table name
storage - storage name
partitions - XPartitionList representation of list of partitions
Returns:
APIResult with state APIResult.Status.SUCCEEDED, if add was successful. APIResult with state APIResult.Status.FAILED, if add has failed

getFlattenedColumns

@GET
@Path(value="flattened/{tableName}")
public JAXBElement<XFlattenedColumns> getFlattenedColumns(@QueryParam(value="sessionid")
                                                                   LensSessionHandle sessionid,
                                                                   @PathParam(value="tableName")
                                                                   String tableName)
Get flattened list of columns reachable from a cube or a dimension

Parameters:
sessionid - session id
tableName - name of the table
Returns:
list of measures, expressions or dimension attributes

getLatestDateOfCube

@GET
@Path(value="/cubes/{cubeName}/latestdate")
public DateTime getLatestDateOfCube(@QueryParam(value="sessionid")
                                             LensSessionHandle sessionid,
                                             @PathParam(value="cubeName")
                                             String cubeName,
                                             @QueryParam(value="timeDimension")
                                             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 sessionid in which user is working
timeDimension - time dimension name
cubeName - name of the base cube
Returns:
DateTime object which has Date in it.
Throws:
LensException
org.apache.hadoop.hive.ql.metadata.HiveException


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