Author: shawkins
Date: 2012-09-10 14:40:32 -0400 (Mon, 10 Sep 2012)
New Revision: 4420
Modified:
trunk/client/src/main/java/org/teiid/client/plan/Annotation.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java
Log:
TEIID-2193 fix for annotation
Modified: trunk/client/src/main/java/org/teiid/client/plan/Annotation.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/plan/Annotation.java 2012-09-10 17:29:49
UTC (rev 4419)
+++ trunk/client/src/main/java/org/teiid/client/plan/Annotation.java 2012-09-10 18:40:32
UTC (rev 4420)
@@ -76,7 +76,7 @@
}
public String toString() {
- return "QueryAnnotation<" + getCategory() + ", " +
getAnnotation() + ">"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ return "QueryAnnotation<" + getCategory() + ", " +
getPriority() + "," + getAnnotation() + "," + getResolution() +
">"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
@Override
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java 2012-09-10
17:29:49 UTC (rev 4419)
+++
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java 2012-09-10
18:40:32 UTC (rev 4420)
@@ -426,7 +426,7 @@
if (record != null && record.recordAnnotations()) {
boolean current = this.modified;
this.modified = true;
- record.addAnnotation(Annotation.RELATIONAL_PLANNER, annotation + (modelID !=
null?" " + metadata.getModelID(modelID):""), resolution + "
" + this.nodeToString(), Priority.LOW); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ record.addAnnotation(Annotation.RELATIONAL_PLANNER, annotation + (modelID !=
null?" " + metadata.getName(modelID):""), resolution + " " +
this.nodeToString(), Priority.LOW); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
this.modified = current;
}
}
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java 2012-09-10
17:29:49 UTC (rev 4419)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java 2012-09-10
18:40:32 UTC (rev 4420)
@@ -53,6 +53,7 @@
import org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
import org.teiid.query.optimizer.relational.AliasGenerator;
+import org.teiid.query.optimizer.relational.plantree.PlanNode;
import org.teiid.query.optimizer.relational.rules.CapabilitiesUtil;
import org.teiid.query.optimizer.relational.rules.RuleChooseDependent;
import org.teiid.query.parser.QueryParser;
@@ -6680,6 +6681,15 @@
checkNodeTypes(plan, FULL_PUSHDOWN);
}
+ @Test public void testPlanNodeAnnotation() throws Exception {
+ PlanNode pn = new PlanNode();
+ TransformationMetadata metadata = RealMetadataFactory.example1Cached();
+ Object modelID = metadata.getMetadataStore().getSchema("pm1");
+ AnalysisRecord record = new AnalysisRecord(true, true);
+ pn.recordDebugAnnotation("hello", modelID, "world", record,
metadata);
+ assertEquals("[QueryAnnotation<Relational Planner, LOW,hello pm1,world
Unknown: 0(groups=[]>]", record.getAnnotations().toString());
+ }
+
public static final boolean DEBUG = false;
}
Show replies by date