Author: shawkins
Date: 2010-03-31 18:15:05 -0400 (Wed, 31 Mar 2010)
New Revision: 2014
Modified:
trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/RelationalPlanner.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java
Log:
TEIID-1026 logging annotation information if we're at the detail level
Modified: trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-03-31
21:44:15 UTC (rev 2013)
+++
trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-03-31
22:15:05 UTC (rev 2014)
@@ -57,7 +57,7 @@
private PrintWriter debugWriter; // public
public AnalysisRecord(boolean recordQueryPlan, boolean recordDebug) {
- this.recordQueryPlan = recordQueryPlan;
+ this.recordQueryPlan = recordQueryPlan |
LogManager.isMessageToBeRecorded(LogConstants.CTX_QUERY_PLANNER, MessageLevel.DETAIL);
this.logDebug = recordDebug;
this.recordDebug = recordDebug |
LogManager.isMessageToBeRecorded(LogConstants.CTX_QUERY_PLANNER, MessageLevel.TRACE);
Modified:
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/RelationalPlanner.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/RelationalPlanner.java 2010-03-31
21:44:15 UTC (rev 2013)
+++
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/RelationalPlanner.java 2010-03-31
22:15:05 UTC (rev 2014)
@@ -262,8 +262,9 @@
if(! appliedHint) {
String msg =
QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0010, groupName);
- LogManager.logInfo(LogConstants.CTX_QUERY_PLANNER, msg);
- this.analysisRecord.addAnnotation(new
QueryAnnotation(QueryAnnotation.HINTS, msg, "ignoring hint",
QueryAnnotation.MEDIUM)); //$NON-NLS-1$
+ if (this.analysisRecord.recordAnnotations()) {
+ this.analysisRecord.addAnnotation(new
QueryAnnotation(QueryAnnotation.HINTS, msg, "ignoring hint",
QueryAnnotation.MEDIUM)); //$NON-NLS-1$
+ }
}
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2010-03-31
21:44:15 UTC (rev 2013)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2010-03-31
22:15:05 UTC (rev 2014)
@@ -453,6 +453,9 @@
if(debugLog != null && debugLog.length() > 0) {
LogManager.log(analysisRecord.logDebug()?MessageLevel.INFO:MessageLevel.TRACE,
LogConstants.CTX_QUERY_PLANNER, debugLog);
}
+ if (analysisRecord.recordAnnotations() &&
analysisRecord.getAnnotations() != null &&
!analysisRecord.getAnnotations().isEmpty()) {
+ LogManager.logDetail(LogConstants.CTX_QUERY_PLANNER,
analysisRecord.getAnnotations());
+ }
}
LogManager.logDetail(LogConstants.CTX_DQP, new Object[] {
DQPPlugin.Util.getString("BasicInterceptor.ProcessTree_for__4"), requestId,
processPlan }); //$NON-NLS-1$
} catch (QueryMetadataException e) {
Modified:
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java
===================================================================
---
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java 2010-03-31
21:44:15 UTC (rev 2013)
+++
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java 2010-03-31
22:15:05 UTC (rev 2014)
@@ -31,16 +31,16 @@
import org.mockito.Mockito;
import org.teiid.adminapi.impl.VDBMetaData;
-import org.teiid.connector.jdbc.oracle.OracleCapabilities;
-import org.teiid.dqp.internal.datamgr.impl.CapabilitiesConverter;
-import org.teiid.metadata.CompositeMetadataStore;
+import org.teiid.connector.api.SourceSystemFunctions;
import org.teiid.metadata.TransformationMetadata;
import com.metamatrix.core.util.ObjectConverterUtil;
import com.metamatrix.core.util.UnitTestUtil;
import com.metamatrix.dqp.message.RequestID;
import com.metamatrix.query.metadata.QueryMetadataInterface;
+import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
import com.metamatrix.query.optimizer.capabilities.FakeCapabilitiesFinder;
+import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
import com.metamatrix.query.processor.HardcodedDataManager;
import com.metamatrix.query.unittest.TimestampUtil;
@@ -55,7 +55,11 @@
//NOTE that the gMonth and gDay values are invalid (but properly formatted)
public void testXSDTranslations() throws Exception {
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
- finder.addCapabilities("sample",
CapabilitiesConverter.convertCapabilities(new OracleCapabilities())); //$NON-NLS-1$
+ BasicSourceCapabilities bsc = new BasicSourceCapabilities();
+ bsc.setFunctionSupport(SourceSystemFunctions.CONVERT, true);
+ bsc.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
+ bsc.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
+ finder.addCapabilities("sample", bsc); //$NON-NLS-1$
QueryMetadataInterface metadata =
createMetadata(UnitTestUtil.getTestDataPath()+"/test.vdb"); //$NON-NLS-1$
@@ -63,7 +67,7 @@
HardcodedDataManager dataMgr = new HardcodedDataManager();
- Set models = new HashSet();
+ Set<String> models = new HashSet<String>();
models.add("sample"); //$NON-NLS-1$
dataMgr.setValidModels(models);
@@ -91,7 +95,7 @@
public void testGetXmlSchemas() throws Exception {
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
- finder.addCapabilities("sample",
CapabilitiesConverter.convertCapabilities(new OracleCapabilities())); //$NON-NLS-1$
+ finder.addCapabilities("sample", new BasicSourceCapabilities());
//$NON-NLS-1$
TransformationMetadata metadata =
createMetadata(UnitTestUtil.getTestDataPath()+"/test.vdb"); //$NON-NLS-1$
Show replies by date