Class HeliosPlanner

  • All Implemented Interfaces:
    IPlanner

    public class HeliosPlanner
    extends Planner
    Implements the Helios planner class. It receives a link specification as input and generates an immutable NestedPlan.
    Version:
    1.0
    Author:
    Kleanthi Georgala (georgala@informatik.uni-leipzig.de)
    • Field Detail

      • source

        public ACache source
        Source cache.
      • target

        public ACache target
        Target cache.
    • Constructor Detail

      • HeliosPlanner

        public HeliosPlanner​(ACache source,
                             ACache target)
        Constructor of the Helios planner class.
        Parameters:
        source - Source cache
        target - Target get
    • Method Detail

      • getAtomicRuntimeCosts

        public double getAtomicRuntimeCosts​(String measure,
                                            double threshold)
        Computes atomic costs for a metric expression. If the metric expression of is not supported by the framework, it throws an InvalidMeasureException exception.
        Parameters:
        measure - Measure of metric expression
        threshold - Threshold of metric expression
        Returns:
        estimated runtime cost of the metric expression
      • getAtomicMappingSizes

        public double getAtomicMappingSizes​(String measure,
                                            double threshold)
        Computes atomic mapping sizes for a measure. If the metric expression of is not supported by the framework, it throws an InvalidMeasureException exception.
        Parameters:
        measure - Measure of metric expression
        threshold - Threshold of metric expression
        Returns:
        estimated size of returned mapping
      • getFilterCosts

        public double getFilterCosts​(List<String> measures,
                                     int mappingSize)
        Computes costs for a filtering instruction. If the metric expression of the filtering instruction is not supported by the framework, it throws an InvalidMeasureException exception.
        Parameters:
        measures - The set of expressions used to filter
        mappingSize - Size of mapping
        Returns:
        estimated runtime cost of filteringInstruction(s)
      • plan

        public NestedPlan plan​(LinkSpecification spec)
        Generates a NestedPlan for a link specification.
        Parameters:
        spec - Input link specification
        Returns:
        the corresponding NestedPlan of the input link specification
      • getBestConjunctivePlan

        public NestedPlan getBestConjunctivePlan​(LinkSpecification spec,
                                                 List<NestedPlan> plans,
                                                 double selectivity)
        Computes the left-order best instructionList for a list of plans. Only needed when AND has more than 2 children. Simply splits the task in computing the best instructionList for (leftmost, all others).
        Parameters:
        spec - Input link specification
        plans - List of plans
        selectivity - Selectivity of the instructionList (known beforehand)
        Returns:
        a NestedPlan of the input link specification
      • getBestConjunctivePlan

        public NestedPlan getBestConjunctivePlan​(LinkSpecification spec,
                                                 NestedPlan left,
                                                 List<NestedPlan> plans,
                                                 double selectivity)
        Computes the best conjunctive instructionList for a instructionList against a list of plans by calling back the method.
        Parameters:
        spec - Input link specification
        left - Left instructionList
        plans - List of other plans
        selectivity - Overall selectivity
        Returns:
        a NestedPlan of the input link specification
      • getBestConjunctivePlan

        public NestedPlan getBestConjunctivePlan​(LinkSpecification spec,
                                                 NestedPlan left,
                                                 NestedPlan right,
                                                 double selectivity)
        Find the least costly plan for a link specification with AND operator. Computes all possible nested plans given the children plans: (1) Execute both children plans, perform intersection and filter the resulting mapping using the threshold of the link specification. (2) Execute the plan of the left child, use the right child measure expression as a filer and then filter the resulting mapping using the threshold of the link specification. (3) Execute the plan of the right child, use the left child measure expression as a filer and then filter the resulting mapping using the threshold of the link specification. The selection of the best alternative is based upon runtime estimations obtained for each of the atomic measure expressions included in the children specifications.
        Parameters:
        spec - The link specification
        left - Left child nested plan
        right - Right child nested plan
        selectivity - , The overall selectivity
        Returns:
        the resulting nested plan for the input spec, that is least costly
      • isStatic

        public boolean isStatic()
        Returns the status of the planner.
        Returns:
        true
      • normalize

        public LinkSpecification normalize​(LinkSpecification spec)
        Normalization of input link specification. In case of XOR operator, the output specification uses the extended form of XOR (i.e. XOR(cosine(x.name,y.name)|0.5, overlap(x.label,y.label)|0.6)> =0.8 will transformed into MINUS(OR(cosine(x.name,y.name)|0.5, overlap(x.label,y.label)|0.6)|0.8, AND(cosine(x.name,y.name)|0.5, overlap(x.label,y.label)|0.6)|0.8) )>=0.8
        Parameters:
        spec - The normalized link specification
        Returns:
        the normalized link specification