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

Field Detail

LOG

public static final org.apache.log4j.Logger LOG

SUCCESS

public static final org.apache.lens.api.APIResult SUCCESS

xCubeObjectFactory

public static final org.apache.lens.api.metastore.ObjectFactory xCubeObjectFactory
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 org.apache.lens.api.StringList getAllDatabases(@QueryParam(value="sessionid")
                                                               org.apache.lens.api.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:
org.apache.lens.api.LensException

getDatabase

@GET
@Path(value="databases/current")
public String getDatabase(@QueryParam(value="sessionid")
                                   org.apache.lens.api.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 org.apache.lens.api.APIResult setDatabase(@QueryParam(value="sessionid")
                                                                   org.apache.lens.api.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 org.apache.lens.api.APIResult dropDatabase(@QueryParam(value="sessionid")
                                                              org.apache.lens.api.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 org.apache.lens.api.APIResult createDatabase(@QueryParam(value="sessionid")
                                                              org.apache.lens.api.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 org.apache.lens.api.StringList getAllNativeTables(@QueryParam(value="sessionid")
                                                                  org.apache.lens.api.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:
org.apache.lens.api.LensException

getNativeTable

@GET
@Path(value="nativetables/{tableName}")
public JAXBElement<org.apache.lens.api.metastore.XNativeTable> getNativeTable(@QueryParam(value="sessionid")
                                                                                       org.apache.lens.api.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 NativeTable
Throws:
org.apache.lens.api.LensException

getAllCubes

@GET
@Path(value="cubes")
public org.apache.lens.api.StringList getAllCubes(@QueryParam(value="sessionid")
                                                           org.apache.lens.api.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 org.apache.lens.api.APIResult deleteAllCubes(@QueryParam(value="sessionid")
                                                                org.apache.lens.api.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 org.apache.lens.api.APIResult createNewCube(@QueryParam(value="sessionid")
                                                             org.apache.lens.api.LensSessionHandle sessionid,
                                                             org.apache.lens.api.metastore.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 org.apache.lens.api.APIResult updateCube(@QueryParam(value="sessionid")
                                                         org.apache.lens.api.LensSessionHandle sessionid,
                                                         @PathParam(value="cubeName")
                                                         String cubeName,
                                                         org.apache.lens.api.metastore.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<org.apache.lens.api.metastore.XCube> getCube(@QueryParam(value="sessionid")
                                                                         org.apache.lens.api.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 org.apache.lens.api.APIResult dropCube(@QueryParam(value="sessionid")
                                                          org.apache.lens.api.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 org.apache.lens.api.StringList getAllStorages(@QueryParam(value="sessionid")
                                                              org.apache.lens.api.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:
org.apache.lens.api.LensException

createNewStorage

@POST
@Path(value="storages")
public org.apache.lens.api.APIResult createNewStorage(@QueryParam(value="sessionid")
                                                                org.apache.lens.api.LensSessionHandle sessionid,
                                                                org.apache.lens.api.metastore.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 org.apache.lens.api.APIResult deleteAllStorages(@QueryParam(value="sessionid")
                                                                   org.apache.lens.api.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 org.apache.lens.api.APIResult updateStorage(@QueryParam(value="sessionid")
                                                            org.apache.lens.api.LensSessionHandle sessionid,
                                                            @PathParam(value="storageName")
                                                            String storageName,
                                                            org.apache.lens.api.metastore.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<org.apache.lens.api.metastore.XStorage> getStorage(@QueryParam(value="sessionid")
                                                                               org.apache.lens.api.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 org.apache.lens.api.APIResult dropStorage(@QueryParam(value="sessionid")
                                                             org.apache.lens.api.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 org.apache.lens.api.StringList getAllDimensionNames(@QueryParam(value="sessionid")
                                                                    org.apache.lens.api.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:
org.apache.lens.api.LensException

createDimension

@POST
@Path(value="dimensions")
public org.apache.lens.api.APIResult createDimension(@QueryParam(value="sessionid")
                                                               org.apache.lens.api.LensSessionHandle sessionid,
                                                               org.apache.lens.api.metastore.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 org.apache.lens.api.APIResult deleteAllDimensions(@QueryParam(value="sessionid")
                                                                     org.apache.lens.api.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 org.apache.lens.api.APIResult updateDimension(@QueryParam(value="sessionid")
                                                              org.apache.lens.api.LensSessionHandle sessionid,
                                                              @PathParam(value="dimName")
                                                              String dimName,
                                                              org.apache.lens.api.metastore.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<org.apache.lens.api.metastore.XDimension> getDimension(@QueryParam(value="sessionid")
                                                                                   org.apache.lens.api.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 org.apache.lens.api.APIResult dropDimension(@QueryParam(value="sessionid")
                                                               org.apache.lens.api.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

getAllFactsOfCube

@GET
@Path(value="/cubes/{cubeName}/facts")
public List<org.apache.lens.api.metastore.XFactTable> getAllFactsOfCube(@QueryParam(value="sessionid")
                                                                                 org.apache.lens.api.LensSessionHandle sessionid,
                                                                                 @PathParam(value="cubeName")
                                                                                 String cubeName)
                                                                 throws org.apache.lens.api.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 FactTable objects
Throws:
org.apache.lens.api.LensException

getAllFacts

@GET
@Path(value="/facts")
public org.apache.lens.api.StringList getAllFacts(@QueryParam(value="sessionid")
                                                           org.apache.lens.api.LensSessionHandle sessionid)
                                           throws org.apache.lens.api.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:
org.apache.lens.api.LensException

deleteAllFacts

@DELETE
@Path(value="facts")
public org.apache.lens.api.APIResult deleteAllFacts(@QueryParam(value="sessionid")
                                                                org.apache.lens.api.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<org.apache.lens.api.metastore.XFactTable> getFactTable(@QueryParam(value="sessionid")
                                                                                   org.apache.lens.api.LensSessionHandle sessionid,
                                                                                   @PathParam(value="factName")
                                                                                   String factName)
                                                                   throws org.apache.lens.api.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 FactTable
Throws:
org.apache.lens.api.LensException

createFactTable

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

Parameters:
sessionid - The sessionid in which user is working
fact - The FactTable 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:
org.apache.lens.api.LensException

updateFactTable

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

Parameters:
sessionid - The sessionid in which user is working
factName - name of the fact table
fact - The FactTable 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:
org.apache.lens.api.LensException

dropFactTable

@DELETE
@Path(value="/facts/{factName}")
public org.apache.lens.api.APIResult dropFactTable(@QueryParam(value="sessionid")
                                                               org.apache.lens.api.LensSessionHandle sessionid,
                                                               @PathParam(value="factName")
                                                               String factName,
                                                               @DefaultValue(value="false")@QueryParam(value="cascade")
                                                               boolean cascade)
                                            throws org.apache.lens.api.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:
org.apache.lens.api.LensException

getStoragesOfFact

@GET
@Path(value="/facts/{factName}/storages")
public org.apache.lens.api.StringList getStoragesOfFact(@QueryParam(value="sessionid")
                                                                 org.apache.lens.api.LensSessionHandle sessionid,
                                                                 @PathParam(value="factName")
                                                                 String factName)
                                                 throws org.apache.lens.api.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:
org.apache.lens.api.LensException

dropAllStoragesOfFact

@DELETE
@Path(value="/facts/{factName}/storages")
public org.apache.lens.api.APIResult dropAllStoragesOfFact(@QueryParam(value="sessionid")
                                                                       org.apache.lens.api.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 org.apache.lens.api.APIResult addStorageToFact(@QueryParam(value="sessionid")
                                                                org.apache.lens.api.LensSessionHandle sessionid,
                                                                @PathParam(value="factName")
                                                                String factName,
                                                                org.apache.lens.api.metastore.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 org.apache.lens.api.APIResult dropStorageFromFact(@QueryParam(value="sessionid")
                                                                     org.apache.lens.api.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<org.apache.lens.api.metastore.XStorageTableElement> getStorageOfFact(@QueryParam(value="sessionid")
                                                                                                 org.apache.lens.api.LensSessionHandle sessionid,
                                                                                                 @PathParam(value="factName")
                                                                                                 String factName,
                                                                                                 @PathParam(value="storage")
                                                                                                 String storage)
                                                                                 throws org.apache.lens.api.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:
org.apache.lens.api.LensException

getAllPartitionsOfFactStorageByFilter

@GET
@Path(value="/facts/{factName}/storages/{storage}/partitions")
public JAXBElement<org.apache.lens.api.metastore.XPartitionList> getAllPartitionsOfFactStorageByFilter(@QueryParam(value="sessionid")
                                                                                                                org.apache.lens.api.LensSessionHandle sessionid,
                                                                                                                @PathParam(value="factName")
                                                                                                                String factName,
                                                                                                                @PathParam(value="storage")
                                                                                                                String storage,
                                                                                                                @QueryParam(value="filter")
                                                                                                                String filter)
                                                                                                throws org.apache.lens.api.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 PartitionList containing XPartition objects
Throws:
org.apache.lens.api.LensException

dropPartitionsOfFactStorageByFilter

@DELETE
@Path(value="/facts/{factName}/storages/{storage}/partitions")
public org.apache.lens.api.APIResult dropPartitionsOfFactStorageByFilter(@QueryParam(value="sessionid")
                                                                                     org.apache.lens.api.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}/partitions")
public org.apache.lens.api.APIResult addPartitionToFactStorage(@QueryParam(value="sessionid")
                                                                         org.apache.lens.api.LensSessionHandle sessionid,
                                                                         @PathParam(value="factName")
                                                                         String factName,
                                                                         @PathParam(value="storage")
                                                                         String storage,
                                                                         org.apache.lens.api.metastore.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

dropPartitionOfFactStorageByValues

@DELETE
@Path(value="/facts/{factName}/storages/{storage}/partition")
public org.apache.lens.api.APIResult dropPartitionOfFactStorageByValues(@QueryParam(value="sessionid")
                                                                                    org.apache.lens.api.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 org.apache.lens.api.StringList getAllDims(@QueryParam(value="sessionid")
                                                          org.apache.lens.api.LensSessionHandle sessionid)
                                          throws org.apache.lens.api.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:
org.apache.lens.api.LensException

createDimensionTable

@POST
@Path(value="/dimtables")
public org.apache.lens.api.APIResult createDimensionTable(org.apache.lens.api.LensSessionHandle sessionid,
                                                                    org.apache.lens.api.metastore.XDimensionTable dimensionTable)
Create a new dimension table

Parameters:
sessionid - The sessionid in which user is working
dimensionTable - The DimensionTable 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 org.apache.lens.api.APIResult updateCubeDimension(@QueryParam(value="sessionid")
                                                                  org.apache.lens.api.LensSessionHandle sessionid,
                                                                  @PathParam(value="dimTableName")
                                                                  String dimTableName,
                                                                  org.apache.lens.api.metastore.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 org.apache.lens.api.APIResult dropDimensionTable(@QueryParam(value="sessionid")
                                                                    org.apache.lens.api.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<org.apache.lens.api.metastore.XDimensionTable> getDimensionTable(@QueryParam(value="sessionid")
                                                                                             org.apache.lens.api.LensSessionHandle sessionid,
                                                                                             @PathParam(value="dimTableName")
                                                                                             String dimTableName)
                                                                             throws org.apache.lens.api.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 DimensionTable
Throws:
org.apache.lens.api.LensException

getDimensionStorages

@GET
@Path(value="/dimtables/{dimTableName}/storages")
public org.apache.lens.api.StringList getDimensionStorages(@QueryParam(value="sessionid")
                                                                    org.apache.lens.api.LensSessionHandle sessionid,
                                                                    @PathParam(value="dimTableName")
                                                                    String dimension)
                                                    throws org.apache.lens.api.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:
org.apache.lens.api.LensException

createDimensionStorage

@POST
@Path(value="/dimtables/{dimTableName}/storages")
public org.apache.lens.api.APIResult createDimensionStorage(@QueryParam(value="sessionid")
                                                                      org.apache.lens.api.LensSessionHandle sessionid,
                                                                      @PathParam(value="dimTableName")
                                                                      String dimTableName,
                                                                      org.apache.lens.api.metastore.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<org.apache.lens.api.metastore.XStorageTableElement> getStorageOfDim(@QueryParam(value="sessionid")
                                                                                                org.apache.lens.api.LensSessionHandle sessionid,
                                                                                                @PathParam(value="dimTableName")
                                                                                                String dimTableName,
                                                                                                @PathParam(value="storage")
                                                                                                String storage)
                                                                                throws org.apache.lens.api.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:
org.apache.lens.api.LensException

dropAllStoragesOfDim

@DELETE
@Path(value="/dimtables/{dimTableName}/storages")
public org.apache.lens.api.APIResult dropAllStoragesOfDim(@QueryParam(value="sessionid")
                                                                      org.apache.lens.api.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 org.apache.lens.api.APIResult dropStorageOfDim(@QueryParam(value="sessionid")
                                                                  org.apache.lens.api.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<org.apache.lens.api.metastore.XPartitionList> getAllPartitionsOfDimStorage(@QueryParam(value="sessionid")
                                                                                                       org.apache.lens.api.LensSessionHandle sessionid,
                                                                                                       @PathParam(value="dimTableName")
                                                                                                       String dimension,
                                                                                                       @PathParam(value="storage")
                                                                                                       String storage,
                                                                                                       @QueryParam(value="filter")
                                                                                                       String filter)
                                                                                       throws org.apache.lens.api.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 PartitionList containing XPartition objects
Throws:
org.apache.lens.api.LensException

dropPartitionsOfDimStorageByFilter

@DELETE
@Path(value="/dimtables/{dimTableName}/storages/{storage}/partitions")
public org.apache.lens.api.APIResult dropPartitionsOfDimStorageByFilter(@QueryParam(value="sessionid")
                                                                                    org.apache.lens.api.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 org.apache.lens.api.APIResult dropPartitionsOfDimStorageByValue(@QueryParam(value="sessionid")
                                                                                   org.apache.lens.api.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}/partitions")
public org.apache.lens.api.APIResult addPartitionToDimStorage(@QueryParam(value="sessionid")
                                                                        org.apache.lens.api.LensSessionHandle sessionid,
                                                                        @PathParam(value="dimTableName")
                                                                        String dimTableName,
                                                                        @PathParam(value="storage")
                                                                        String storage,
                                                                        org.apache.lens.api.metastore.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

getFlattenedColumns

@GET
@Path(value="flattened/{tableName}")
public JAXBElement<org.apache.lens.api.metastore.XFlattenedColumns> getFlattenedColumns(@QueryParam(value="sessionid")
                                                                                                 org.apache.lens.api.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 org.apache.lens.api.DateTime getLatestDateOfCube(@QueryParam(value="sessionid")
                                                                 org.apache.lens.api.LensSessionHandle sessionid,
                                                                 @PathParam(value="cubeName")
                                                                 String cubeName,
                                                                 @QueryParam(value="timeDimension")
                                                                 String timeDimension)
                                                 throws org.apache.lens.api.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:
org.apache.lens.api.LensException
org.apache.hadoop.hive.ql.metadata.HiveException


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