@Test public void test01() { String query = "Environment{*}.applications[@label = \"srp-app\"]{*}.services[@name = \"srp-app:Raptor-00004\"]{*}.runsOn{*}"; QueryExecPlan plan = getTranslator(raptorContext).translate(raptorParser.parse(query)); QueryOptimizer optimizer = new QueryOptimizer(raptorContext); optimizer.optimize(plan); QueryExecutor executor = new QueryExecutor(raptorContext); executor.execute(plan); QueryServiceImpl.populateResult(plan, raptorContext); IQueryResult result = plan.getQueryResult(); Assert.assertEquals(1, result.getEntities().size()); }
public void execute(QueryExecPlan plan) { final int executeLimit = 2 * plan.getActionCount(); int executeCounter = 0; AbstractAction rootAction = plan.getRootAction(); ExecuteContext context = new ExecuteContext(plan); if (plan.getAggAction() != null) { AggregateAction aggAction = (AggregateAction) plan.getAggAction(); if (aggAction.isOneTableAggregation()) { execute(executeLimit, executeCounter, aggAction, context); } else { executeCounter = execute(executeLimit, executeCounter, rootAction, context); execute(executeLimit, executeCounter, aggAction, context); } } else { execute(executeLimit, executeCounter, rootAction, context); } plan.addExplanations(context.explanations); }
QueryExecutor { public void execute(QueryExecPlan plan) { final int executeLimit = 2 * plan.getActionCount(); int executeCounter = 0; AbstractAction rootAction = plan.getRootAction(); ExecuteContext context = new ExecuteContext(plan); if (plan.getAggAction() != null) { AggregateAction aggAction = (AggregateAction) plan.getAggAction(); if (aggAction.isOneTableAggregation()) { execute(executeLimit, executeCounter, aggAction, context); } else { executeCounter = execute(executeLimit, executeCounter, rootAction, context); execute(executeLimit, executeCounter, aggAction, context); } } else { execute(executeLimit, executeCounter, rootAction, context); } plan.addExplanations(context.explanations); } }
QueryExecutor { public void execute(QueryExecPlan plan) { final int executeLimit = 2 * plan.getActionCount(); int executeCounter = 0; AbstractAction rootAction = plan.getRootAction(); ExecuteContext context = new ExecuteContext(plan); if (plan.getAggAction() != null) { AggregateAction aggAction = (AggregateAction) plan.getAggAction(); if (aggAction.isOneTableAggregation()) { execute(executeLimit, executeCounter, aggAction, context); } else { executeCounter = execute(executeLimit, executeCounter, rootAction, context); execute(executeLimit, executeCounter, aggAction, context); } } else { execute(executeLimit, executeCounter, rootAction, context); } plan.addExplanations(context.explanations); } QueryExecutor(QueryContext context); }
QueryExecutor { public void execute(QueryExecPlan plan) { final int executeLimit = 2 * plan.getActionCount(); int executeCounter = 0; AbstractAction rootAction = plan.getRootAction(); ExecuteContext context = new ExecuteContext(plan); if (plan.getAggAction() != null) { AggregateAction aggAction = (AggregateAction) plan.getAggAction(); if (aggAction.isOneTableAggregation()) { execute(executeLimit, executeCounter, aggAction, context); } else { executeCounter = execute(executeLimit, executeCounter, rootAction, context); execute(executeLimit, executeCounter, aggAction, context); } } else { execute(executeLimit, executeCounter, rootAction, context); } plan.addExplanations(context.explanations); } QueryExecutor(QueryContext context); void execute(QueryExecPlan plan); }
QueryExecutor { public void execute(QueryExecPlan plan) { final int executeLimit = 2 * plan.getActionCount(); int executeCounter = 0; AbstractAction rootAction = plan.getRootAction(); ExecuteContext context = new ExecuteContext(plan); if (plan.getAggAction() != null) { AggregateAction aggAction = (AggregateAction) plan.getAggAction(); if (aggAction.isOneTableAggregation()) { execute(executeLimit, executeCounter, aggAction, context); } else { executeCounter = execute(executeLimit, executeCounter, rootAction, context); execute(executeLimit, executeCounter, aggAction, context); } } else { execute(executeLimit, executeCounter, rootAction, context); } plan.addExplanations(context.explanations); } QueryExecutor(QueryContext context); void execute(QueryExecPlan plan);  }