Interface Algorithm
- All Superinterfaces:
Component
- All Known Implementing Classes:
AdaptiveMonteCarloAlgorithm
,AlgorithmImpl
,ExhaustiveLatticeAlgorithm
,MonteCarloAlgorithm
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Collection of metrics describing the cost and benefit of instantiating a particularAggregate
.static enum
Enumeration of parameters common to all algorithms. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancels a run.computeAggregateCosts
(Schema schema, Map<Parameter, Object> parameterValues, List<Aggregate> aggregateList) Computes cost/benefit metrics for a list of Aggregates.createAggregate
(Schema schema, List<Attribute> attributeList) Creates an Aggregate.Runs the optimization algorithm to produces a set of recommended aggregate tables.Methods inherited from interface org.pentaho.aggdes.model.Component
getName, getParameters
-
Method Details
-
run
Runs the optimization algorithm to produces a set of recommended aggregate tables.The allowable parameters are specified by the
Component.getParameters()
method.Returns
null
if another thread calledcancel()
and there is no useful result.- Parameters:
schema
- SchemaparameterValues
- Parameter valuesprogress
- Progress callback- Returns:
- Set of recommended aggregate tables, or null if another thread
called
cancel()
and there is no useful result
-
cancel
void cancel()Cancels a run.Call this method from another thread.
Some algorithms are able to return a result if they are canceled before they run to completion; if so, the
run(org.pentaho.aggdes.model.Schema, java.util.Map<org.pentaho.aggdes.model.Parameter, java.lang.Object>, org.pentaho.aggdes.algorithm.Progress)
method will return that result; otherwiserun(org.pentaho.aggdes.model.Schema, java.util.Map<org.pentaho.aggdes.model.Parameter, java.lang.Object>, org.pentaho.aggdes.algorithm.Progress)
returns null. -
createAggregate
Creates an Aggregate.- Parameters:
schema
- Schema objectattributeList
- List of attributes- Returns:
- Aggregate
-
computeAggregateCosts
List<Algorithm.CostBenefit> computeAggregateCosts(Schema schema, Map<Parameter, Object> parameterValues, List<Aggregate> aggregateList) Computes cost/benefit metrics for a list of Aggregates.The aggregates must have been created using the
createAggregate(Schema, List)
method.The order of the list is important: the benefit of the ith aggregate is its benefit over the previous aggregates 0, ... i - 1.
This method is not thread safe; you must not call it while calling another method on this Algorithm object. The Algorithm object may or may not have been previously used to generate a set of aggregates (see
run(org.pentaho.aggdes.model.Schema, java.util.Map<org.pentaho.aggdes.model.Parameter, java.lang.Object>, org.pentaho.aggdes.algorithm.Progress)
).- Parameters:
schema
- SchemaparameterValues
- Parameter valuesaggregateList
- List of aggregates- Returns:
- list of cost/benefit for each aggregate in the list
-