Package mondrian.rolap
Class RolapResult
- java.lang.Object
-
- mondrian.olap.ResultBase
-
- mondrian.rolap.RolapResult
-
- All Implemented Interfaces:
Result
public class RolapResult extends ResultBase
ARolapResultis the result of running a query.- Since:
- 10 August, 2001
- Author:
- jhyde
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classRolapResult.CellFormatterValueFormatterA CellFormatterValueFormatter uses a user-definedCellFormatterto format values.(package private) static classRolapResult.CellInfoA CellInfo contains all of the information that a Cell requires.(package private) static interfaceRolapResult.CellInfoContainerAPI for the creation and lookup ofRolapResult.CellInfoobjects.(package private) static classRolapResult.CellInfoMapImplementation ofRolapResult.CellInfoContainerwhich uses aMapto store CellInfo Objects.(package private) static classRolapResult.CellInfoPoolImplementation ofRolapResult.CellInfoContainerwhich uses anObjectPoolto storeRolapResult.CellInfoObjects.classRolapResult.CompoundSlicerRolapMemberMember which holds the AggregateCalc used when evaluating a compound slicer.(package private) static classRolapResult.FormatValueFormatterprotected static classRolapResult.RolapResultEvaluatorRootExtension toRolapEvaluatorRootwhich is capable of evaluating sets and named sets.(package private) static interfaceRolapResult.ValueFormatterFormatter to convert values into formatted strings.
-
Field Summary
Fields Modifier and Type Field Description protected static Map<Locale,RolapResult.ValueFormatter>formatValueFormattersSynchronized Map from Locale to ValueFormatter.(package private) static org.apache.log4j.LoggerLOGGER(package private) RolapEvaluatorslicerEvaluator-
Fields inherited from class mondrian.olap.ResultBase
axes, execution, query, slicerAxis, statement
-
-
Constructor Summary
Constructors Constructor Description RolapResult(Execution execution, boolean execute)Creates a RolapResult.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()(package private) TupleIterableevalExecute(List<List<Member>> nonAllMembers, int cnt, RolapEvaluator evaluator, QueryAxis queryAxis, Calc calc)(package private) voidevalLoad(List<List<Member>> nonAllMembers, int cnt, Evaluator evaluator, QueryAxis axis, Calc calc, mondrian.rolap.RolapResult.AxisMemberList axisMembers)(package private) ObjectevaluateExp(Calc calc, RolapEvaluator slicerEvaluator, Evaluator contextEvaluator)Evaluates an expression.Axis[]getAxes()Returns the non-slicer axes.CellgetCell(int[] pos)Get the Cell for the given Cell position.(package private) RolapMember[]getCellMembers(int[] pos)Called only by RolapCell.(package private) intgetCellOrdinal(int[] pos)Converts a set of cell coordinates to a cell ordinal.RolapCubegetCube()(package private) EvaluatorgetEvaluator(int[] pos)ExecutiongetExecution()protected org.apache.log4j.LoggergetLogger()(package private) EvaluatorgetRootEvaluator()(package private) booleanisDirty()protected voidloadMembers(List<List<Member>> nonAllMembers, RolapEvaluator evaluator, QueryAxis axis, Calc calc, mondrian.rolap.RolapResult.AxisMemberList axisMembers)protected voidloadSpecialMembers(List<Member> nonDefaultAllMembers, List<List<Member>> nonAllMembers, List<Member> measureMembers)Finds all root Members 1) whose Hierarchy does not have an ALL Member, 2) whose default Member is not the ALL Member and 3) all Measures.protected voidmakeModulos()Instantiates the calculator to convert cell coordinates to a cell ordinal and vice versa.(package private) static TupleListmergeAxes(TupleList axis1, TupleIterable axis2, boolean ordered)(package private) voidpopulateEvaluator(Evaluator evaluator, int[] pos)protected booleanremoveDimension(Dimension dimension, List<List<Member>> memberLists)protected booleanreplaceNonAllMembers(List<List<Member>> nonAllMembers, mondrian.rolap.RolapResult.AxisMemberList axisMembers)-
Methods inherited from class mondrian.olap.ResultBase
getMember, getQuery, getSlicerAxis, print
-
-
-
-
Field Detail
-
LOGGER
static final org.apache.log4j.Logger LOGGER
-
slicerEvaluator
RolapEvaluator slicerEvaluator
-
formatValueFormatters
protected static final Map<Locale,RolapResult.ValueFormatter> formatValueFormatters
Synchronized Map from Locale to ValueFormatter. It is expected that there will be only a small number of Locale's. Should these be a WeakHashMap?
-
-
Constructor Detail
-
RolapResult
RolapResult(Execution execution, boolean execute)
Creates a RolapResult.- Parameters:
execution- Execution of a statementexecute- Whether to execute the query
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceResult- Overrides:
closein classResultBase
-
removeDimension
protected boolean removeDimension(Dimension dimension, List<List<Member>> memberLists)
-
getExecution
public final Execution getExecution()
-
replaceNonAllMembers
protected boolean replaceNonAllMembers(List<List<Member>> nonAllMembers, mondrian.rolap.RolapResult.AxisMemberList axisMembers)
-
loadMembers
protected void loadMembers(List<List<Member>> nonAllMembers, RolapEvaluator evaluator, QueryAxis axis, Calc calc, mondrian.rolap.RolapResult.AxisMemberList axisMembers)
-
evalLoad
void evalLoad(List<List<Member>> nonAllMembers, int cnt, Evaluator evaluator, QueryAxis axis, Calc calc, mondrian.rolap.RolapResult.AxisMemberList axisMembers)
-
evalExecute
TupleIterable evalExecute(List<List<Member>> nonAllMembers, int cnt, RolapEvaluator evaluator, QueryAxis queryAxis, Calc calc)
-
loadSpecialMembers
protected void loadSpecialMembers(List<Member> nonDefaultAllMembers, List<List<Member>> nonAllMembers, List<Member> measureMembers)
Finds all root Members 1) whose Hierarchy does not have an ALL Member, 2) whose default Member is not the ALL Member and 3) all Measures.- Parameters:
nonDefaultAllMembers- List of all root Members for Hierarchies whose default Member is not the ALL Member.nonAllMembers- List of root Members for Hierarchies that have no ALL Member.measureMembers- List all Measures
-
getLogger
protected org.apache.log4j.Logger getLogger()
- Specified by:
getLoggerin classResultBase
-
getCube
public final RolapCube getCube()
-
getAxes
public Axis[] getAxes()
Description copied from interface:ResultReturns the non-slicer axes.- Specified by:
getAxesin interfaceResult- Overrides:
getAxesin classResultBase
-
getCell
public Cell getCell(int[] pos)
Get the Cell for the given Cell position.- Parameters:
pos- Cell position.- Returns:
- the Cell associated with the Cell position.
-
isDirty
boolean isDirty()
-
evaluateExp
Object evaluateExp(Calc calc, RolapEvaluator slicerEvaluator, Evaluator contextEvaluator)
Evaluates an expression. Intended for evaluating named sets.Does not modify the contents of the evaluator.
- Parameters:
calc- Compiled expressionslicerEvaluator- Evaluation context for slicerscontextEvaluator- Evaluation context (optional)- Returns:
- Result
-
getCellOrdinal
int getCellOrdinal(int[] pos)
Converts a set of cell coordinates to a cell ordinal.This method can be expensive, because the ordinal is computed from the length of the axes, and therefore the axes need to be instantiated.
-
makeModulos
protected void makeModulos()
Instantiates the calculator to convert cell coordinates to a cell ordinal and vice versa.To create the calculator, any axis that is based upon an Iterable is converted into a List - thus increasing memory usage.
-
getCellMembers
RolapMember[] getCellMembers(int[] pos)
Called only by RolapCell. Use this when creating an Evaluator is not required.- Parameters:
pos- Coordinates of cell- Returns:
- Members which form the context of the given cell
-
getRootEvaluator
Evaluator getRootEvaluator()
-
getEvaluator
Evaluator getEvaluator(int[] pos)
-
populateEvaluator
void populateEvaluator(Evaluator evaluator, int[] pos)
-
mergeAxes
static TupleList mergeAxes(TupleList axis1, TupleIterable axis2, boolean ordered)
-
-