mondrian.rolap
Class FastBatchingCellReader

java.lang.Object
  extended by mondrian.rolap.FastBatchingCellReader
All Implemented Interfaces:
CellReader

public class FastBatchingCellReader
extends Object
implements CellReader

A FastBatchingCellReader doesn't really Read cells: when asked to look up the values of stored measures, it lies, and records the fact that the value was asked for. Later, we can look over the values which are required, fetch them in an efficient way, and re-run the evaluation with a real evaluator.

NOTE: When it doesn't know the answer, it lies by returning an error object. The calling code must be able to deal with that.

This class tries to minimize the amount of storage needed to record the fact that a cell was requested.

 

Nested Class Summary
(package private)  class FastBatchingCellReader.Batch
           
(package private)  class FastBatchingCellReader.CompositeBatch
          Set of Batches which can grouped together.
(package private) static interface FastBatchingCellReader.Loadable
          Encapsulates a common property of FastBatchingCellReader.CompositeBatch and FastBatchingCellReader.CompositeBatch, namely, that they can be asked to load their aggregations into the cache.
 
Field Summary
(package private)  AggregationManager aggMgr
           
 
Constructor Summary
FastBatchingCellReader(RolapCube cube)
           
 
Method Summary
(package private)  void addToCompositeBatch(Map<AggregationKey,FastBatchingCellReader.CompositeBatch> batchGroups, FastBatchingCellReader.Batch detailedBatch, FastBatchingCellReader.Batch summaryBatch)
           
(package private)  boolean doesDBSupportGroupingSets()
          Uses Dialect to identify if grouping sets is supported by the database.
 Object get(RolapEvaluator evaluator)
          Returns the value of the cell which has the context described by the evaluator.
(package private)  SqlQuery.Dialect getDialect()
          Returns the SQL dialect.
 int getMissCount()
          Returns the number of times this cell reader has told a lie (since creation), because the required cell value is not in the cache.
(package private)  List<FastBatchingCellReader.CompositeBatch> groupBatches(List<FastBatchingCellReader.Batch> batchList)
           
 boolean isDirty()
          Returns whether this reader has told a lie.
(package private)  boolean loadAggregations()
           
(package private)  boolean loadAggregations(Query query)
          Loads pending aggregations, if any.
 void recordCellRequest(CellRequest request)
           
(package private)  void setDirty(boolean dirty)
          Sets the flag indicating that the reader has told a lie.
(package private)  boolean shouldUseGroupingFunction()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aggMgr

final AggregationManager aggMgr
Constructor Detail

FastBatchingCellReader

public FastBatchingCellReader(RolapCube cube)
Method Detail

get

public Object get(RolapEvaluator evaluator)
Description copied from interface: CellReader
Returns the value of the cell which has the context described by the evaluator. A cell could have optional compound member coordinates usually specified using the Aggregate function. These compound members are contained in the evaluator.

If no aggregation contains the required cell, returns null.

If the value is null, returns Util.nullValue.

Specified by:
get in interface CellReader
Returns:
Cell value, or null if not found, or Util.nullValue if the value is null

getMissCount

public int getMissCount()
Description copied from interface: CellReader
Returns the number of times this cell reader has told a lie (since creation), because the required cell value is not in the cache.

Specified by:
getMissCount in interface CellReader

recordCellRequest

public final void recordCellRequest(CellRequest request)

isDirty

public boolean isDirty()
Returns whether this reader has told a lie. This is the case if there are pending batches to load or if setDirty(boolean) has been called.

Specified by:
isDirty in interface CellReader
Returns:
whether thus cell reader has any pending cell requests that are not loaded yet.

loadAggregations

boolean loadAggregations()

loadAggregations

boolean loadAggregations(Query query)
Loads pending aggregations, if any.

Parameters:
query - the parent query object that initiated this call
Returns:
Whether any aggregations were loaded.

groupBatches

List<FastBatchingCellReader.CompositeBatch> groupBatches(List<FastBatchingCellReader.Batch> batchList)

addToCompositeBatch

void addToCompositeBatch(Map<AggregationKey,FastBatchingCellReader.CompositeBatch> batchGroups,
                         FastBatchingCellReader.Batch detailedBatch,
                         FastBatchingCellReader.Batch summaryBatch)

shouldUseGroupingFunction

boolean shouldUseGroupingFunction()

doesDBSupportGroupingSets

boolean doesDBSupportGroupingSets()
Uses Dialect to identify if grouping sets is supported by the database.


getDialect

SqlQuery.Dialect getDialect()
Returns the SQL dialect. Overridden in some unit tests.

Returns:
Dialect

setDirty

void setDirty(boolean dirty)
Sets the flag indicating that the reader has told a lie.


SourceForge.net_Logo