@Test public void test02() { String query = "Manifest{*}.versions[@name=\"Dummy ManifestVersion Bundle-0-0001\"]{*}.packages{*}.versions{*}"; QueryExecPlan plan = getTranslator(deployContext).translate(deployParser.parse(query)); QueryOptimizer optimizer = new QueryOptimizer(deployContext); optimizer.optimize(plan); QueryExecutor executor = new QueryExecutor(deployContext); executor.execute(plan); QueryServiceImpl.populateResult(plan, deployContext); 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);  }