}
@Override
public void generate(final PartitionTree ptree) throws Exception {
for (Table catalog_tbl : pplan.getRoots()) {
DesignerVertex root = info.dgraph.getVertex(catalog_tbl);
LOG.debug("ROOT: " + root);
// Walk down the paths in the plans and create the partition tree
// that represents the PartitionPlan
new VertexTreeWalker<DesignerVertex, DesignerEdge>(info.dgraph) {
protected void populate_children(VertexTreeWalker.Children<DesignerVertex> children, DesignerVertex element) {
Set<Table> element_children = pplan.getChildren((Table) element.getCatalogItem());
if (element_children != null) {
for (Table child_tbl : element_children) {
DesignerVertex child = info.dgraph.getVertex(child_tbl);
children.addAfter(child);
} // FOR
}
return;
}
@Override
protected void callback(DesignerVertex element) {
TableEntry entry = PartitionPlanTreeGenerator.this.pplan.getTableEntries().get((Table) element.getCatalogItem());
// Bad Mojo!
if (entry == null) {
LOG.warn("ERROR: No PartitionPlan entry for '" + element + "'");
// Non-Root
} else if (entry.getParent() != null) {
LOG.debug("Trying to create: " + entry.getParent() + "->" + element);
DesignerVertex parent = info.dgraph.getVertex(entry.getParent());
element.setAttribute(ptree, PartitionTree.VertexAttributes.ATTRIBUTE.name(), entry.getAttribute());
element.setAttribute(ptree, PartitionTree.VertexAttributes.METHOD.name(), entry.getMethod());
if (parent != null && !ptree.containsVertex(element)) {