Class MergeRequests
java.lang.Object
se.liu.ida.hefquin.engine.queryproc.impl.loptimizer.heuristics.MergeRequests
- All Implemented Interfaces:
HeuristicForLogicalOptimization
Merges subplans that consists of multiple requests to the same federation
member if such a merge is possible.
In particular, a join over two requests is merged into a single request
operator if i) the two requests are triple pattern requests (which can be
merged into a BGP request and the federation member supports BGP requests,
or ii) one of the two requests is a BGP request and the other one also a
BGP request or a triple pattern request.
Another possibility for merging is a join over two arbitrary SPARQL pattern
requests for a SPARQL endpoint. For SPARQL endpoints, this heuristic even
tries to push other operators into requests (filters, unions, optional).
The aforementioned join-related merge is performed not only for binary join
operators but also for tpAdd/bgpAdd operators over request operators, as well
as for pairs of requests under a multi-join. In the latter case, the multi-join
operator is replaced by the merged request operator only if there are no other
subplans under that multi-join operator.
The merging is applied recursively in a bottom-up fashion, which means that,
after performing one merge step, another one may become available and will be
done.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(LogicalPlan inputPlan) Applies this heuristics to the given plan and returns the resulting, potentially rewritten plan.protected LogicalPlancreatePlanWithSingleRequestOp(org.apache.jena.sparql.syntax.Element elmt, SPARQLEndpoint fm) protected LogicalPlanstatic LogicalPlanmergeBindIntoSPARQLEndpointRequest(LogicalOpBind bindOp, SPARQLEndpoint ep, SPARQLRequest req) static LogicalPlanmergeFilterIntoSPARQLEndpointRequest(LogicalOpFilter filterOp, SPARQLEndpoint ep, SPARQLRequest req) protected LogicalPlanprotected LogicalPlanmergeOptionalPatternsIntoSPARQLRequest(List<SPARQLGraphPattern> optPatterns, SPARQLEndpoint fm, SPARQLRequest req) protected LogicalPlanmergeSPARQLRequestsViaJoin(FederationMember fm, List<LogicalPlan> reqPlans) Assumes that the given list contains at list two plans and that all plans in the list consist only of a request operator.protected LogicalPlanmergeSPARQLRequestsViaJoin(FederationMember fm, SPARQLRequest req1, SPARQLRequest req2) protected LogicalPlanmergeSPARQLRequestsViaUnion(SPARQLEndpoint fm, List<LogicalPlan> reqPlans) protected LogicalPlanmergeSPARQLRequestsViaUnion(SPARQLEndpoint fm, SPARQLRequest req1, SPARQLRequest req2) protected voidseparateSubPlansOfMultiwayOps(List<LogicalPlan> subPlans, Map<FederationMember, List<LogicalPlan>> reqOnlyPlansPerFedMember, List<LogicalPlan> nonReqSubPlans)
-
Constructor Details
-
MergeRequests
public MergeRequests()
-
-
Method Details
-
apply
Description copied from interface:HeuristicForLogicalOptimizationApplies this heuristics to the given plan and returns the resulting, potentially rewritten plan.- Specified by:
applyin interfaceHeuristicForLogicalOptimization
-
mergeFilterIntoSPARQLEndpointRequest
public static LogicalPlan mergeFilterIntoSPARQLEndpointRequest(LogicalOpFilter filterOp, SPARQLEndpoint ep, SPARQLRequest req) -
mergeBindIntoSPARQLEndpointRequest
public static LogicalPlan mergeBindIntoSPARQLEndpointRequest(LogicalOpBind bindOp, SPARQLEndpoint ep, SPARQLRequest req) -
mergeGraphPatternIntoSPARQLRequest
protected LogicalPlan mergeGraphPatternIntoSPARQLRequest(SPARQLGraphPattern p, FederationMember fm, SPARQLRequest req) -
mergeSPARQLRequestsViaUnion
protected LogicalPlan mergeSPARQLRequestsViaUnion(SPARQLEndpoint fm, SPARQLRequest req1, SPARQLRequest req2) -
mergeSPARQLRequestsViaUnion
-
mergeSPARQLRequestsViaJoin
protected LogicalPlan mergeSPARQLRequestsViaJoin(FederationMember fm, SPARQLRequest req1, SPARQLRequest req2) -
mergeSPARQLRequestsViaJoin
Assumes that the given list contains at list two plans and that all plans in the list consist only of a request operator. -
mergeOptionalPatternsIntoSPARQLRequest
protected LogicalPlan mergeOptionalPatternsIntoSPARQLRequest(List<SPARQLGraphPattern> optPatterns, SPARQLEndpoint fm, SPARQLRequest req) -
createPlanWithSingleRequestOp
protected LogicalPlan createPlanWithSingleRequestOp(org.apache.jena.sparql.syntax.Element elmt, SPARQLEndpoint fm) -
createPlanWithSingleRequestOp
-
separateSubPlansOfMultiwayOps
protected void separateSubPlansOfMultiwayOps(List<LogicalPlan> subPlans, Map<FederationMember, List<LogicalPlan>> reqOnlyPlansPerFedMember, List<LogicalPlan> nonReqSubPlans)
-