org.apache.lens.cube.metadata
Class DerivedCube

java.lang.Object
  extended by org.apache.lens.cube.metadata.AbstractCubeTable
      extended by org.apache.lens.cube.metadata.DerivedCube
All Implemented Interfaces:
CubeInterface, Named

public class DerivedCube
extends AbstractCubeTable
implements CubeInterface


Field Summary
 
Fields inherited from class org.apache.lens.cube.metadata.AbstractCubeTable
LOG
 
Constructor Summary
DerivedCube(String name, Set<String> measures, Set<String> dimensions, Cube parent)
           
DerivedCube(String name, Set<String> measures, Set<String> dimensions, Map<String,String> properties, double weight, Cube parent)
           
DerivedCube(org.apache.hadoop.hive.ql.metadata.Table tbl, Cube parent)
           
 
Method Summary
 void addDimension(String dimension)
          Add a new dimension
 void addMeasure(String measure)
          Add a new measure
 void addProperties()
           
 boolean allFieldsQueriable()
          Whether all the fields of cube can be queried.
 boolean equals(Object obj)
           
 Set<String> getAllFieldNames()
          Get all field names reachable from cube
 JoinChain getChainByName(String chainName)
          Get joinchain by given by name
 CubeColumn getColumnByName(String column)
          Get cube column given by column name.
 CubeDimAttribute getDimAttributeByName(String dimension)
          Get dimension attribute given by name
 Set<String> getDimAttributeNames()
          Get all dimension attribute names
 Set<CubeDimAttribute> getDimAttributes()
          Get all dimension attributes of the cube
static Set<String> getDimensions(String name, Map<String,String> props)
           
 ExprColumn getExpressionByName(String exprName)
          Get expression by given by name
 Set<String> getExpressionNames()
          Get all expression names
 Set<ExprColumn> getExpressions()
          Get all expressions defined on the cube
 Set<String> getJoinChainNames()
          Get all join chain names
 Set<JoinChain> getJoinChains()
          Get all joinchains defined on the cube
 CubeMeasure getMeasureByName(String measure)
          Get measure by given by name
 Set<String> getMeasureNames()
          Get all measure names
 Set<CubeMeasure> getMeasures()
          Get all measures of the cube
static Set<String> getMeasures(String name, Map<String,String> props)
           
 Cube getParent()
           
 Set<String> getStorages()
           
 CubeTableType getTableType()
           
 Set<String> getTimedDimensions()
          Get all timed dimensions of cube
 int hashCode()
           
 boolean isDerivedCube()
          Is the cube a derived cube or base cube
 void removeDimension(String dimName)
          Remove the dimension with name specified
 void removeMeasure(String msrName)
          Remove the measure with name specified
 
Methods inherited from class org.apache.lens.cube.metadata.AbstractCubeTable
addProperties, alterWeight, getColumns, getName, getProperties, getWeight, removeProperty, toString, weight
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.lens.cube.metadata.Named
getName
 

Constructor Detail

DerivedCube

public DerivedCube(String name,
                   Set<String> measures,
                   Set<String> dimensions,
                   Cube parent)

DerivedCube

public DerivedCube(String name,
                   Set<String> measures,
                   Set<String> dimensions,
                   Map<String,String> properties,
                   double weight,
                   Cube parent)

DerivedCube

public DerivedCube(org.apache.hadoop.hive.ql.metadata.Table tbl,
                   Cube parent)
Method Detail

getMeasures

public Set<CubeMeasure> getMeasures()
Description copied from interface: CubeInterface
Get all measures of the cube

Specified by:
getMeasures in interface CubeInterface
Returns:
set of CubeMeasure

getDimAttributes

public Set<CubeDimAttribute> getDimAttributes()
Description copied from interface: CubeInterface
Get all dimension attributes of the cube

Specified by:
getDimAttributes in interface CubeInterface
Returns:
set CubeDimAttribute

getTableType

public CubeTableType getTableType()
Specified by:
getTableType in class AbstractCubeTable

getStorages

public Set<String> getStorages()
Specified by:
getStorages in class AbstractCubeTable

addProperties

public void addProperties()

getMeasures

public static Set<String> getMeasures(String name,
                                      Map<String,String> props)

getTimedDimensions

public Set<String> getTimedDimensions()
Description copied from interface: CubeInterface
Get all timed dimensions of cube

Specified by:
getTimedDimensions in interface CubeInterface
Returns:
Set of strings

getDimensions

public static Set<String> getDimensions(String name,
                                        Map<String,String> props)

getParent

public Cube getParent()

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractCubeTable

equals

public boolean equals(Object obj)
Overrides:
equals in class AbstractCubeTable

getDimAttributeByName

public CubeDimAttribute getDimAttributeByName(String dimension)
Description copied from interface: CubeInterface
Get dimension attribute given by name

Specified by:
getDimAttributeByName in interface CubeInterface
Parameters:
dimension - dimension attribute name
Returns:
A CubeDimAttribute object

getMeasureByName

public CubeMeasure getMeasureByName(String measure)
Description copied from interface: CubeInterface
Get measure by given by name

Specified by:
getMeasureByName in interface CubeInterface
Parameters:
measure - Measure name
Returns:
A CubeMeasure object

getColumnByName

public CubeColumn getColumnByName(String column)
Description copied from interface: CubeInterface
Get cube column given by column name.

It can be a measure, dimension attribute or an expression.

Specified by:
getColumnByName in interface CubeInterface
Parameters:
column - Column name
Returns:
A CubeColumn object

addMeasure

public void addMeasure(String measure)
                throws org.apache.hadoop.hive.ql.metadata.HiveException
Add a new measure

Parameters:
measure -
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

addDimension

public void addDimension(String dimension)
                  throws org.apache.hadoop.hive.ql.metadata.HiveException
Add a new dimension

Parameters:
dimension -
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

removeDimension

public void removeDimension(String dimName)
Remove the dimension with name specified

Parameters:
dimName -

removeMeasure

public void removeMeasure(String msrName)
Remove the measure with name specified

Parameters:
msrName -

isDerivedCube

public boolean isDerivedCube()
Description copied from interface: CubeInterface
Is the cube a derived cube or base cube

Specified by:
isDerivedCube in interface CubeInterface
Returns:
true if cube is derived, false if it is base

getMeasureNames

public Set<String> getMeasureNames()
Description copied from interface: CubeInterface
Get all measure names

Specified by:
getMeasureNames in interface CubeInterface
Returns:
Set of strings

getDimAttributeNames

public Set<String> getDimAttributeNames()
Description copied from interface: CubeInterface
Get all dimension attribute names

Specified by:
getDimAttributeNames in interface CubeInterface
Returns:
Set of strings

allFieldsQueriable

public boolean allFieldsQueriable()
Description copied from interface: CubeInterface
Whether all the fields of cube can be queried.

If false, the fields can queried through derived cubes. Users can look at derived cube fields to know which all fields can be queried together.

If true, all the fields can be directly queried.

Specified by:
allFieldsQueriable in interface CubeInterface
Returns:
true or false

getExpressions

public Set<ExprColumn> getExpressions()
Description copied from interface: CubeInterface
Get all expressions defined on the cube

Specified by:
getExpressions in interface CubeInterface
Returns:
set ExprColumn

getExpressionByName

public ExprColumn getExpressionByName(String exprName)
Description copied from interface: CubeInterface
Get expression by given by name

Specified by:
getExpressionByName in interface CubeInterface
Parameters:
exprName - Expression name
Returns:
A ExprColumn object

getAllFieldNames

public Set<String> getAllFieldNames()
Description copied from interface: CubeInterface
Get all field names reachable from cube

Specified by:
getAllFieldNames in interface CubeInterface
Overrides:
getAllFieldNames in class AbstractCubeTable
Returns:
Set of strings

getExpressionNames

public Set<String> getExpressionNames()
Description copied from interface: CubeInterface
Get all expression names

Specified by:
getExpressionNames in interface CubeInterface
Returns:
Set of strings

getJoinChains

public Set<JoinChain> getJoinChains()
Description copied from interface: CubeInterface
Get all joinchains defined on the cube

Specified by:
getJoinChains in interface CubeInterface
Returns:
set JoinChain

getChainByName

public JoinChain getChainByName(String chainName)
Description copied from interface: CubeInterface
Get joinchain by given by name

Specified by:
getChainByName in interface CubeInterface
Parameters:
chainName - Chain name
Returns:
A JoinChain object

getJoinChainNames

public Set<String> getJoinChainNames()
Description copied from interface: CubeInterface
Get all join chain names

Specified by:
getJoinChainNames in interface CubeInterface
Returns:
Set of strings


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