for (ProcParameter param_cat : CatalogUtil.getSortedCatalogItems(catalog_proc.getParameters(), "index")) {
DefaultMutableTreeNode param_node = new DefaultMutableTreeNode(new WrapperNode(param_cat) {
@Override
public String toString() {
ProcParameter param_cat = (ProcParameter)this.getCatalogType();
VoltType type = VoltType.get((byte)param_cat.getType());
return (super.toString() + " :: " + type.name());
}
});
parameters_node.add(param_node);
buildSearchIndex(param_cat, param_node);
} // FOR (parameters)
// Statements
if (catalog_proc.getSystemproc() == false) {
DefaultMutableTreeNode statementRootNode = new CatalogMapTreeNode(Statement.class, "Statements", catalog_proc.getStatements());
procNode.add(statementRootNode);
for (Statement statement_cat : catalog_proc.getStatements()) {
DefaultMutableTreeNode statement_node = new DefaultMutableTreeNode(new WrapperNode(statement_cat));
statementRootNode.add(statement_node);
buildSearchIndex(statement_cat, statement_node);
// Plan Trees
for (boolean is_singlepartition : new boolean[] { true, false }) {
if (is_singlepartition && !statement_cat.getHas_singlesited()) continue;
if (!is_singlepartition && !statement_cat.getHas_multisited()) continue;
String label = (is_singlepartition ? "Single-Partition" : "Distributed") + " Plan Fragments";
// String attributes = "";
AbstractPlanNode node = null;
try {
node = PlanNodeUtil.getRootPlanNodeForStatement(statement_cat, is_singlepartition);
} catch (Exception e) {
String msg = e.getMessage();
if (msg == null || msg.length() == 0) {
e.printStackTrace();
} else {
LOG.warn(msg);
}
}
CatalogMap<PlanFragment> fragments = (is_singlepartition ? statement_cat.getFragments() : statement_cat.getMs_fragments());
PlanTreeCatalogNode planTreeNode = new PlanTreeCatalogNode(label, fragments, node);
DefaultMutableTreeNode planNode = new DefaultMutableTreeNode(planTreeNode);
statement_node.add(planNode);
// Plan Fragments
for (PlanFragment fragment_cat : CatalogUtil.getSortedCatalogItems(fragments, "id")) {
DefaultMutableTreeNode fragment_node = new DefaultMutableTreeNode(new WrapperNode(fragment_cat));
planNode.add(fragment_node);
buildSearchIndex(fragment_cat, fragment_node);
} // FOR (fragments)
}
// Statement Parameter
DefaultMutableTreeNode paramRootNode = new CatalogMapTreeNode(StmtParameter.class, "Parameters", statement_cat.getParameters());
statement_node.add(paramRootNode);
for (StmtParameter param_cat : CatalogUtil.getSortedCatalogItems(statement_cat.getParameters(), "index")) {
DefaultMutableTreeNode param_node = new DefaultMutableTreeNode(new WrapperNode(param_cat) {
@Override
public String toString() {
StmtParameter param_cat = (StmtParameter)this.getCatalogType();
VoltType type = VoltType.get((byte)param_cat.getJavatype());
return (super.toString() + " :: " + type.name());
}
});
paramRootNode.add(param_node);
buildSearchIndex(param_cat, param_node);
} // FOR (parameters)