use of com.cubrid.common.core.queryplan.model.PlanCost in project cubrid-manager by CUBRID.
the class QueryPlanTest method testModelPlanNode.
public void testModelPlanNode() {
PlanNode bean = new PlanNode();
bean.setDepth(5);
assertEquals(bean.getDepth(), 5);
bean.setMethod("method");
assertEquals(bean.getMethod(), "method");
bean.setPosition("position");
assertEquals(bean.getPosition(), "position");
bean.setCost(new PlanCost());
assertEquals(bean.getCost().getClass(), PlanCost.class);
bean.setTable(new PlanTable());
assertEquals(bean.getTable().getClass(), PlanTable.class);
bean.setIndex(new PlanTerm());
assertEquals(bean.getIndex().getClass(), PlanTerm.class);
bean.setEdge(new PlanTerm());
assertEquals(bean.getEdge().getClass(), PlanTerm.class);
bean.setSargs(new PlanTerm());
assertEquals(bean.getSargs().getClass(), PlanTerm.class);
bean.setFilter(new PlanTerm());
assertEquals(bean.getFilter().getClass(), PlanTerm.class);
bean.setSort("sort");
assertEquals(bean.getSort(), "sort");
bean.setOrder("order");
assertEquals(bean.getOrder(), "order");
assertEquals(bean.toString() == null, false);
bean.getChildren();
bean.newChild();
bean.addChild(new PlanNode());
assertNotNull(bean.toString());
assertNotNull(bean.getDebugString());
}
use of com.cubrid.common.core.queryplan.model.PlanCost in project cubrid-manager by CUBRID.
the class QueryPlanTest method testModelPlanCost.
public void testModelPlanCost() {
PlanCost bean = new PlanCost();
bean.setFixedTotal(10);
assertEquals(bean.getFixedTotal(), 10.0f);
bean.setFixedCpu(8);
assertEquals(bean.getFixedCpu(), 8.0f);
bean.setFixedDisk(9);
assertEquals(bean.getFixedDisk(), 9.0f);
bean.setVarTotal(8);
assertEquals(bean.getVarTotal(), 8.0f);
bean.setVarCpu(6);
assertEquals(bean.getVarCpu(), 6.0f);
bean.setVarDisk(7);
assertEquals(bean.getVarDisk(), 7.0f);
bean.setCard(4);
assertEquals(bean.getCard(), 4);
assertEquals(bean.toString() == null, false);
}
use of com.cubrid.common.core.queryplan.model.PlanCost in project cubrid-manager by CUBRID.
the class QueryPlanTest method testModelPlanNode.
public void testModelPlanNode() {
PlanNode bean = new PlanNode();
bean.setDepth(5);
assertEquals(bean.getDepth(), 5);
bean.setMethod("method");
assertEquals(bean.getMethod(), "method");
bean.setPosition("position");
assertEquals(bean.getPosition(), "position");
bean.setCost(new PlanCost());
assertEquals(bean.getCost().getClass(), PlanCost.class);
bean.setTable(new PlanTable());
assertEquals(bean.getTable().getClass(), PlanTable.class);
bean.setIndex(new PlanTerm());
assertEquals(bean.getIndex().getClass(), PlanTerm.class);
bean.setEdge(new PlanTerm());
assertEquals(bean.getEdge().getClass(), PlanTerm.class);
bean.setSargs(new PlanTerm());
assertEquals(bean.getSargs().getClass(), PlanTerm.class);
bean.setFilter(new PlanTerm());
assertEquals(bean.getFilter().getClass(), PlanTerm.class);
bean.setSort("sort");
assertEquals(bean.getSort(), "sort");
bean.setOrder("order");
assertEquals(bean.getOrder(), "order");
assertEquals(bean.toString() == null, false);
bean.getChildren();
bean.newChild();
}
use of com.cubrid.common.core.queryplan.model.PlanCost in project cubrid-manager by CUBRID.
the class QueryPlanTest method testModelPlanCost.
public void testModelPlanCost() {
PlanCost bean = new PlanCost();
bean.setFixedTotal(10);
assertEquals(bean.getFixedTotal(), 10.0f);
bean.setFixedCpu(8);
assertEquals(bean.getFixedCpu(), 8.0f);
bean.setFixedDisk(9);
assertEquals(bean.getFixedDisk(), 9.0f);
bean.setVarTotal(8);
assertEquals(bean.getVarTotal(), 8.0f);
bean.setVarCpu(6);
assertEquals(bean.getVarCpu(), 6.0f);
bean.setVarDisk(7);
assertEquals(bean.getVarDisk(), 7.0f);
bean.setCard(4);
assertEquals(bean.getCard(), 4);
assertEquals(bean.toString() == null, false);
}
use of com.cubrid.common.core.queryplan.model.PlanCost in project cubrid-manager by CUBRID.
the class PlanParserTest method testExam01.
/**
* simple plan
*
* @throws Exception
*/
public void testExam01() throws Exception {
String planString = loadPlanExmaple("plan01.txt");
PlanParser parser = new PlanParser();
boolean bool = parser.doParse(planString);
assertTrue(bool);
parser.getPlanTree(1);
PlanResult planRoot = parser.getPlanTree(0);
assertNotNull(planRoot);
PlanNode planNode = planRoot.getPlanNode();
assertEquals(planNode.getMethod(), "idx-join (inner join)");
assertEquals(planNode.getDepth(), 1);
PlanCost planCost = planNode.getCost();
assertNotNull(planCost);
assertEquals(planCost.getCard(), 40);
assertEquals(String.valueOf(planCost.getFixedCpu()), "0.0");
assertEquals(String.valueOf(planCost.getFixedDisk()), "2.0");
assertEquals(String.valueOf(planCost.getFixedTotal()), "2.0");
assertEquals(String.valueOf(planCost.getVarCpu()), "100.3");
assertEquals(String.valueOf(planCost.getVarDisk()), "275.0");
assertEquals(String.valueOf(planCost.getVarTotal()), "375.0");
assertNull(planNode.getTable());
assertNull(planNode.getIndex());
assertNull(planNode.getEdge());
assertNull(planNode.getFilter());
assertNull(planNode.getSort());
assertNull(planNode.getOrder());
PlanTerm sargs = planNode.getSargs();
assertNotNull(sargs);
assertNotNull(planNode.getChildren());
assertEquals(planNode.getChildren().size(), 2);
PlanParser parser2 = new PlanParser();
parser2.getPlanTree(0);
parser2.countPlanTree();
parser2.doParse(null);
parser2.doParse("aaa");
}
Aggregations