@Test public void testReference() throws Exception { String query = "Environment.applications[@label = \"srp-app\"].services.runsOn"; QueryExecPlan plan = parseAndPlan(query); QueryOptimizer optimizer = new QueryOptimizer(raptorContext); optimizer.optimize(plan); Assert.assertNotNull(plan); AbstractAction action = plan.getRootAction(); Assert.assertEquals(7, plan.getActionCount()); Assert.assertTrue(action instanceof SearchAction); action = action.getChildrenActions().get(0); Assert.assertTrue(action instanceof InnerJoinAction); action = action.getChildrenActions().get(0); Assert.assertTrue(action instanceof SearchAction); action = action.getChildrenActions().get(0); Assert.assertTrue(action instanceof InnerJoinAction); action = action.getChildrenActions().get(0); Assert.assertTrue(action instanceof SearchAction); action = action.getChildrenActions().get(0); Assert.assertTrue(action instanceof InnerJoinAction); action = action.getChildrenActions().get(0); Assert.assertTrue(action instanceof SearchAction); }
public void optimize(QueryExecPlan plan) { AbstractAction rootAction = plan.getRootAction(); optimizeAction(rootAction); checkFullTableScan(rootAction); }
QueryOptimizer { public void optimize(QueryExecPlan plan) { AbstractAction rootAction = plan.getRootAction(); optimizeAction(rootAction); checkFullTableScan(rootAction); } }
QueryOptimizer { public void optimize(QueryExecPlan plan) { AbstractAction rootAction = plan.getRootAction(); optimizeAction(rootAction); checkFullTableScan(rootAction); } QueryOptimizer(QueryContext context); }
QueryOptimizer { public void optimize(QueryExecPlan plan) { AbstractAction rootAction = plan.getRootAction(); optimizeAction(rootAction); checkFullTableScan(rootAction); } QueryOptimizer(QueryContext context); void optimize(QueryExecPlan plan); }
QueryOptimizer { public void optimize(QueryExecPlan plan) { AbstractAction rootAction = plan.getRootAction(); optimizeAction(rootAction); checkFullTableScan(rootAction); } QueryOptimizer(QueryContext context); void optimize(QueryExecPlan plan);  }