teiid SVN: r982 - trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-19 16:46:31 -0400 (Tue, 19 May 2009)
New Revision: 982
Added:
trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/Util.java
Log:
TEIID-473 fix for extract function modifier - changing name to util, rather than testutil
Copied: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/Util.java (from rev 981, trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestUtil.java)
===================================================================
--- trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/Util.java (rev 0)
+++ trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/Util.java 2009-05-19 20:46:31 UTC (rev 982)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.jdbc;
+
+import static org.junit.Assert.*;
+
+import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.jdbc.translator.TranslatedCommand;
+import org.teiid.connector.jdbc.translator.Translator;
+import org.teiid.connector.language.ICommand;
+
+import com.metamatrix.cdk.api.EnvironmentUtility;
+
+public class Util {
+
+ public static void helpTestVisitor(String vdb, String input, String expectedOutput, Translator translator) throws ConnectorException {
+ // Convert from sql to objects
+ ICommand obj = MetadataFactory.helpTranslate(vdb, input);
+
+ TranslatedCommand tc = new TranslatedCommand(EnvironmentUtility.createSecurityContext("user"), translator); //$NON-NLS-1$
+ tc.translateCommand(obj);
+
+ // Check stuff
+ assertEquals("Did not get correct sql", expectedOutput, tc.getSql()); //$NON-NLS-1$
+ }
+
+}
Property changes on: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/Util.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:mergeinfo
+
15 years, 7 months
teiid SVN: r981 - in trunk/connectors/connector-jdbc/src: test/java/org/teiid/connector/jdbc and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-19 16:37:31 -0400 (Tue, 19 May 2009)
New Revision: 981
Added:
trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestUtil.java
Modified:
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/ExtractFunctionModifier.java
trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/mysql/TestMySQLTranslator.java
trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/oracle/TestExtractFunctionModifier.java
trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/oracle/TestOracleTranslator.java
Log:
TEIID-473 fix for extract function modifier
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/ExtractFunctionModifier.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/ExtractFunctionModifier.java 2009-05-19 18:17:30 UTC (rev 980)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/ExtractFunctionModifier.java 2009-05-19 20:37:31 UTC (rev 981)
@@ -26,7 +26,6 @@
import java.util.List;
import org.teiid.connector.jdbc.translator.BasicFunctionModifier;
-import org.teiid.connector.jdbc.translator.FunctionModifier;
import org.teiid.connector.language.IExpression;
import org.teiid.connector.language.IFunction;
@@ -35,7 +34,7 @@
* Convert the YEAR/MONTH/DAY etc. function into an equivalent Oracle function.
* Format: EXTRACT(YEAR from Element) or EXTRACT(YEAR from DATE '2004-03-03')
*/
-public class ExtractFunctionModifier extends BasicFunctionModifier implements FunctionModifier {
+public class ExtractFunctionModifier extends BasicFunctionModifier {
public static final String SPACE = " "; //$NON-NLS-1$
private String target;
@@ -44,20 +43,17 @@
this.target = target;
}
- public List translate(IFunction function) {
- StringBuffer buffer = new StringBuffer();
+ public List<?> translate(IFunction function) {
List<IExpression> args = function.getParameters();
- List objs = new ArrayList();
- buffer.append("EXTRACT("); //$NON-NLS-1$
- buffer.append(target);
- buffer.append(SPACE);
- buffer.append("FROM"); //$NON-NLS-1$
-
- buffer.append(SPACE);
- buffer.append(args.get(0));
- buffer.append(")"); //$NON-NLS-1$
- objs.add(buffer.toString());
+ List<Object> objs = new ArrayList<Object>();
+ objs.add("EXTRACT("); //$NON-NLS-1$
+ objs.add(target);
+ objs.add(SPACE);
+ objs.add("FROM"); //$NON-NLS-1$
+ objs.add(SPACE);
+ objs.add(args.get(0));
+ objs.add(")"); //$NON-NLS-1$
return objs;
}
}
Added: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestUtil.java
===================================================================
--- trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestUtil.java (rev 0)
+++ trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestUtil.java 2009-05-19 20:37:31 UTC (rev 981)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.jdbc;
+
+import static org.junit.Assert.*;
+
+import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.jdbc.translator.TranslatedCommand;
+import org.teiid.connector.jdbc.translator.Translator;
+import org.teiid.connector.language.ICommand;
+
+import com.metamatrix.cdk.api.EnvironmentUtility;
+
+public class TestUtil {
+
+ public static void helpTestVisitor(String vdb, String input, String expectedOutput, Translator translator) throws ConnectorException {
+ // Convert from sql to objects
+ ICommand obj = MetadataFactory.helpTranslate(vdb, input);
+
+ TranslatedCommand tc = new TranslatedCommand(EnvironmentUtility.createSecurityContext("user"), translator); //$NON-NLS-1$
+ tc.translateCommand(obj);
+
+ // Check stuff
+ assertEquals("Did not get correct sql", expectedOutput, tc.getSql()); //$NON-NLS-1$
+ }
+
+}
Property changes on: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestUtil.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/mysql/TestMySQLTranslator.java
===================================================================
--- trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/mysql/TestMySQLTranslator.java 2009-05-19 18:17:30 UTC (rev 980)
+++ trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/mysql/TestMySQLTranslator.java 2009-05-19 20:37:31 UTC (rev 981)
@@ -22,17 +22,13 @@
package org.teiid.connector.jdbc.mysql;
-import static org.junit.Assert.*;
-
import java.util.Properties;
import org.junit.BeforeClass;
import org.junit.Test;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.jdbc.MetadataFactory;
-import org.teiid.connector.jdbc.translator.TranslatedCommand;
-import org.teiid.connector.jdbc.translator.Translator;
-import org.teiid.connector.language.ICommand;
+import org.teiid.connector.jdbc.TestUtil;
import com.metamatrix.cdk.api.EnvironmentUtility;
@@ -55,22 +51,11 @@
return MetadataFactory.BQT_VDB;
}
- public static void helpTestVisitor(String vdb, String input, String expectedOutput, Translator translator) throws ConnectorException {
- // Convert from sql to objects
- ICommand obj = MetadataFactory.helpTranslate(vdb, input);
-
- TranslatedCommand tc = new TranslatedCommand(EnvironmentUtility.createSecurityContext("user"), translator); //$NON-NLS-1$
- tc.translateCommand(obj);
-
- // Check stuff
- assertEquals("Did not get correct sql", expectedOutput, tc.getSql()); //$NON-NLS-1$
- }
-
@Test public void testRewriteConversion1() throws Exception {
String input = "SELECT char(convert(PART_WEIGHT, integer) + 100) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT char((convert(PARTS.PART_WEIGHT, SIGNED INTEGER) + 100)) FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -79,7 +64,7 @@
String input = "SELECT convert(PART_WEIGHT, long) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT convert(PARTS.PART_WEIGHT, SIGNED) FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -88,7 +73,7 @@
String input = "SELECT convert(convert(PART_WEIGHT, long), string) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT convert(convert(PARTS.PART_WEIGHT, SIGNED), CHAR) FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -97,7 +82,7 @@
String input = "SELECT convert(convert(PART_WEIGHT, date), string) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT date_format(DATE(PARTS.PART_WEIGHT), '%Y-%m-%d') FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -105,7 +90,7 @@
String input = "SELECT convert(convert(PART_WEIGHT, time), string) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT date_format(TIME(PARTS.PART_WEIGHT), '%H:%i:%S') FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -113,7 +98,7 @@
String input = "SELECT convert(convert(PART_WEIGHT, timestamp), string) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT date_format(TIMESTAMP(PARTS.PART_WEIGHT), '%Y-%m-%d %H:%i:%S.%f') FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -121,7 +106,7 @@
String input = "SELECT ifnull(PART_WEIGHT, 'otherString') FROM PARTS"; //$NON-NLS-1$
String output = "SELECT ifnull(PARTS.PART_WEIGHT, 'otherString') FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -129,7 +114,7 @@
String input = "SELECT convert(convert(PART_WEIGHT, integer), string) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT convert(convert(PARTS.PART_WEIGHT, SIGNED INTEGER), CHAR) FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -137,7 +122,7 @@
String input = "SELECT insert(PART_WEIGHT, 1, 5, 'chimp') FROM PARTS"; //$NON-NLS-1$
String output = "SELECT insert(PARTS.PART_WEIGHT, 1, 5, 'chimp') FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -145,7 +130,7 @@
String input = "SELECT locate(PART_WEIGHT, 'chimp', 1) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT locate(PARTS.PART_WEIGHT, 'chimp', 1) FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -153,7 +138,7 @@
String input = "SELECT substring(PART_WEIGHT, 1) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT substring(PARTS.PART_WEIGHT, 1) FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -161,7 +146,7 @@
String input = "SELECT substring(PART_WEIGHT, 1, 5) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT substring(PARTS.PART_WEIGHT, 1, 5) FROM PARTS"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -169,7 +154,7 @@
String input = "SELECT PART_ID FROM PARTS UNION SELECT PART_ID FROM PARTS ORDER BY PART_ID"; //$NON-NLS-1$
String output = "(SELECT PARTS.PART_ID FROM PARTS) UNION (SELECT PARTS.PART_ID FROM PARTS) ORDER BY PART_ID"; //$NON-NLS-1$
- helpTestVisitor(getTestVDB(),
+ TestUtil.helpTestVisitor(getTestVDB(),
input,
output, TRANSLATOR);
}
@@ -178,7 +163,7 @@
String input = "select intkey from bqt1.smalla limit 100"; //$NON-NLS-1$
String output = "SELECT SmallA.IntKey FROM SmallA LIMIT 100"; //$NON-NLS-1$
- helpTestVisitor(getTestBQTVDB(),
+ TestUtil.helpTestVisitor(getTestBQTVDB(),
input,
output, TRANSLATOR);
}
@@ -187,7 +172,7 @@
String input = "select intkey from bqt1.smalla limit 50, 100"; //$NON-NLS-1$
String output = "SELECT SmallA.IntKey FROM SmallA LIMIT 50, 100"; //$NON-NLS-1$
- helpTestVisitor(getTestBQTVDB(),
+ TestUtil.helpTestVisitor(getTestBQTVDB(),
input,
output, TRANSLATOR);
}
@@ -196,7 +181,7 @@
String input = "select bitand(intkey, intnum) from bqt1.smalla"; //$NON-NLS-1$
String output = "SELECT convert((SmallA.IntKey & SmallA.IntNum), SIGNED INTEGER) FROM SmallA"; //$NON-NLS-1$
- TestMySQLTranslator.helpTestVisitor(MetadataFactory.BQT_VDB,
+ TestUtil.helpTestVisitor(MetadataFactory.BQT_VDB,
input,
output, TRANSLATOR);
}
@@ -205,7 +190,7 @@
String input = "select smalla.intkey from bqt1.smalla inner join bqt1.smallb on smalla.stringkey=smallb.stringkey cross join bqt1.mediuma"; //$NON-NLS-1$
String output = "SELECT SmallA.IntKey FROM (SmallA INNER JOIN SmallB ON SmallA.StringKey = SmallB.StringKey) CROSS JOIN MediumA"; //$NON-NLS-1$
- TestMySQLTranslator.helpTestVisitor(MetadataFactory.BQT_VDB,
+ TestUtil.helpTestVisitor(MetadataFactory.BQT_VDB,
input,
output, TRANSLATOR);
}
Modified: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/oracle/TestExtractFunctionModifier.java
===================================================================
--- trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/oracle/TestExtractFunctionModifier.java 2009-05-19 18:17:30 UTC (rev 980)
+++ trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/oracle/TestExtractFunctionModifier.java 2009-05-19 20:37:31 UTC (rev 981)
@@ -24,6 +24,7 @@
import java.sql.Timestamp;
import java.util.Arrays;
+import java.util.List;
import java.util.Properties;
import org.teiid.connector.api.TypeFacility;
@@ -64,18 +65,17 @@
ExtractFunctionModifier mod = new ExtractFunctionModifier (target);
IExpression expr = mod.modify(func);
-
+ List<?> parts = mod.translate(func);
+ assertEquals(7, parts.size());
+ assertFalse(parts.get(5) instanceof String);
OracleSQLTranslator trans = new OracleSQLTranslator();
trans.registerFunctionModifier("extract", mod);
trans.initialize(EnvironmentUtility.createEnvironment(new Properties(), false));
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
- //sqlVisitor.setFunctionModifiers(trans.getFunctionModifiers());
sqlVisitor.append(expr);
- //System.out.println(" expected: " + expectedStr + " \t actual: " + sqlVisitor.toString());
assertEquals(expectedStr, sqlVisitor.toString());
-
return expr;
}
public void test1() throws Exception {
Modified: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/oracle/TestOracleTranslator.java
===================================================================
--- trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/oracle/TestOracleTranslator.java 2009-05-19 18:17:30 UTC (rev 980)
+++ trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/oracle/TestOracleTranslator.java 2009-05-19 20:37:31 UTC (rev 981)
@@ -28,7 +28,7 @@
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.jdbc.MetadataFactory;
-import org.teiid.connector.jdbc.mysql.TestMySQLTranslator;
+import org.teiid.connector.jdbc.TestUtil;
import org.teiid.connector.jdbc.translator.TranslatedCommand;
import org.teiid.connector.jdbc.translator.Translator;
import org.teiid.connector.language.ICommand;
@@ -72,7 +72,7 @@
String input = "select smalla.intkey from bqt1.smalla inner join bqt1.smallb on smalla.stringkey=smallb.stringkey cross join bqt1.mediuma"; //$NON-NLS-1$
String output = "SELECT SmallA.IntKey FROM SmallA INNER JOIN SmallB ON SmallA.StringKey = SmallB.StringKey CROSS JOIN MediumA"; //$NON-NLS-1$
- TestMySQLTranslator.helpTestVisitor(MetadataFactory.BQT_VDB,
+ TestUtil.helpTestVisitor(MetadataFactory.BQT_VDB,
input,
output, TRANSLATOR);
}
@@ -81,7 +81,7 @@
String input = "select smalla.intkey from bqt1.smalla cross join (bqt1.smallb cross join bqt1.mediuma)"; //$NON-NLS-1$
String output = "SELECT SmallA.IntKey FROM SmallA CROSS JOIN (SmallB CROSS JOIN MediumA)"; //$NON-NLS-1$
- TestMySQLTranslator.helpTestVisitor(MetadataFactory.BQT_VDB,
+ TestUtil.helpTestVisitor(MetadataFactory.BQT_VDB,
input,
output, TRANSLATOR);
}
15 years, 7 months
teiid SVN: r980 - trunk/build/assembly/cdk.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-19 14:17:30 -0400 (Tue, 19 May 2009)
New Revision: 980
Modified:
trunk/build/assembly/cdk/cdk-dependencies.xml
Log:
TEIID-613 fixing cdk, by adding all dependencies
Modified: trunk/build/assembly/cdk/cdk-dependencies.xml
===================================================================
--- trunk/build/assembly/cdk/cdk-dependencies.xml 2009-05-19 16:19:52 UTC (rev 979)
+++ trunk/build/assembly/cdk/cdk-dependencies.xml 2009-05-19 18:17:30 UTC (rev 980)
@@ -27,14 +27,8 @@
<dependencySet>
<useProjectArtifact>true</useProjectArtifact>
<unpack>false</unpack>
- <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useTransitiveDependencies>true</useTransitiveDependencies>
<useDefaultExcludes>true</useDefaultExcludes>
- <!--
- <excludes>
- <exclude>teiid*</exclude>
- <exclude>jta*</exclude>
- </excludes>
- -->
</dependencySet>
</dependencySets>
15 years, 7 months
teiid SVN: r979 - trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/jdbc.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-19 12:19:52 -0400 (Tue, 19 May 2009)
New Revision: 979
Modified:
trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/jdbc/JDBCRuntimeMetadataReader.java
Log:
TEIID-538 there are only two parameters left in the active vdb query
Modified: trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/jdbc/JDBCRuntimeMetadataReader.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/jdbc/JDBCRuntimeMetadataReader.java 2009-05-18 18:43:16 UTC (rev 978)
+++ trunk/server/src/main/java/com/metamatrix/metadata/runtime/spi/jdbc/JDBCRuntimeMetadataReader.java 2009-05-19 16:19:52 UTC (rev 979)
@@ -339,13 +339,10 @@
String sql = null;
VirtualDatabaseID result = null;
- int nParms = 2;
-
try{
if(isActive){
if(version == null){
sql = JDBCTranslator.SELECT_ACTIVE_VIRTUAL_DATABASE_ID_LV;
- nParms = 3;
}else{
sql = JDBCTranslator.SELECT_ACTIVE_VIRTUAL_DATABASE_ID;
}
@@ -362,9 +359,6 @@
}
else{
statement.setString(2, fullName.toUpperCase());
- if(nParms==3) {
- statement.setString(3, fullName.toUpperCase());
- }
}
if (! statement.execute()){
throw new VirtualDatabaseException(ErrorMessageKeys.GEN_0007, RuntimeMetadataPlugin.Util.getString(ErrorMessageKeys.GEN_0007, sql) );
15 years, 7 months
teiid SVN: r978 - trunk/engine/src/test/java/com/metamatrix/dqp/service.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-18 14:43:16 -0400 (Mon, 18 May 2009)
New Revision: 978
Modified:
trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - exposing the stats in embedded
Modified: trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java 2009-05-18 18:43:05 UTC (rev 977)
+++ trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java 2009-05-18 18:43:16 UTC (rev 978)
@@ -29,17 +29,14 @@
import java.util.Iterator;
import java.util.List;
-import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
import org.teiid.dqp.internal.datamgr.impl.ConnectorWorkItem;
import org.teiid.dqp.internal.process.DQPWorkContext;
-import com.metamatrix.api.exception.ComponentNotFoundException;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.application.exception.ApplicationLifecycleException;
import com.metamatrix.common.comm.api.ResultsReceiver;
import com.metamatrix.common.config.api.ConnectorBinding;
import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.dqp.embedded.DQPEmbeddedPlugin;
import com.metamatrix.dqp.internal.datamgr.ConnectorID;
import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.AtomicRequestMessage;
15 years, 7 months
teiid SVN: r977 - trunk/engine/src/test/java/org/teiid/dqp/internal/process.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-18 14:43:05 -0400 (Mon, 18 May 2009)
New Revision: 977
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - exposing the stats in embedded
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2009-05-18 18:41:34 UTC (rev 976)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2009-05-18 18:43:05 UTC (rev 977)
@@ -29,8 +29,6 @@
import java.util.Map;
import java.util.Properties;
-import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
-
import junit.framework.TestCase;
import com.metamatrix.api.exception.ComponentNotFoundException;
@@ -44,7 +42,6 @@
import com.metamatrix.common.buffer.TupleBatch;
import com.metamatrix.common.comm.api.ResultsReceiver;
import com.metamatrix.common.config.api.ConnectorBinding;
-import com.metamatrix.dqp.embedded.DQPEmbeddedPlugin;
import com.metamatrix.dqp.internal.datamgr.ConnectorID;
import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.AtomicRequestMessage;
15 years, 7 months
teiid SVN: r976 - in trunk: server/src/main/java/com/metamatrix/common/comm/platform/socket/server and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-18 14:41:34 -0400 (Mon, 18 May 2009)
New Revision: 976
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java
Log:
TEIID-602 checks to prevent child exceptions from reporting their cause as themselves (which shouldn't be happening, but may be coming from an inappropriate override by a third-party). this doesn't prevent more exotic recursive scenarios, but those typically don't happen.
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2009-05-18 18:34:21 UTC (rev 975)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2009-05-18 18:41:34 UTC (rev 976)
@@ -232,7 +232,7 @@
if(e instanceof MetaMatrixProcessingException) {
Throwable cause = e;
while (cause.getCause() != null && cause.getCause() != cause) {
- cause = e.getCause();
+ cause = cause.getCause();
}
StackTraceElement elem = cause.getStackTrace()[0];
LogManager.logWarning(LogConstants.CTX_DQP, DQPPlugin.Util.getString("ProcessWorker.processing_error", e.getMessage(), requestID, e.getClass().getName(), elem)); //$NON-NLS-1$
Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java 2009-05-18 18:34:21 UTC (rev 975)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java 2009-05-18 18:41:34 UTC (rev 976)
@@ -170,7 +170,7 @@
private void logProcessingException(Throwable e, String context) {
Throwable cause = e;
while (cause.getCause() != null && cause != cause.getCause()) {
- cause = e.getCause();
+ cause = cause.getCause();
}
StackTraceElement elem = cause.getStackTrace()[0];
LogManager.logDetail(context, e, "Processing exception for session", this.socketClientInstance.getWorkContext().getConnectionID()); //$NON-NLS-1$
15 years, 7 months
teiid SVN: r975 - trunk/engine/src/main/java/org/teiid/dqp/internal/process.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-18 14:34:21 -0400 (Mon, 18 May 2009)
New Revision: 975
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - exposing the stats in embedded
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-05-18 18:33:01 UTC (rev 974)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-05-18 18:34:21 UTC (rev 975)
@@ -397,15 +397,7 @@
return getQueueStatistics();
}
- /**
- * Returns a QueueStats object that represent the queue in
- * this service.
- * If there is no queue with the given name, an empty Collection is returned.
- */
- public Collection getConnectionPoolsStatistics(String connectorBindingName) {
-
- }
/**
* Cancel and close all requests associated with the clientConnection/session. Also runs a final cleanup any caches within
15 years, 7 months
teiid SVN: r974 - trunk/server/src/main/java/com/metamatrix/server/dqp/service.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-18 14:33:01 -0400 (Mon, 18 May 2009)
New Revision: 974
Modified:
trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformDataService.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - exposing the stats in embedded
Modified: trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformDataService.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformDataService.java 2009-05-18 18:32:05 UTC (rev 973)
+++ trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformDataService.java 2009-05-18 18:33:01 UTC (rev 974)
@@ -213,6 +213,14 @@
throws MetaMatrixComponentException{
throw new UnsupportedOperationException();
}
+
+ /**
+ * @see com.metamatrix.dqp.service.DataService#getConnectionPoolStatistics(java.lang.String)
+ * @since 6.1
+ */
+ public Collection getConnectionPoolStatistics(String connectorBindingName) throws MetaMatrixComponentException {
+ throw new UnsupportedOperationException();
+ }
/**
* @see com.metamatrix.dqp.service.DataService#clearConnectorBindingCache(java.lang.String)
15 years, 7 months
teiid SVN: r973 - in trunk/engine/src: main/java/org/teiid/dqp/internal/datamgr/impl and 4 other directories.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-18 14:32:05 -0400 (Mon, 18 May 2009)
New Revision: 973
Modified:
trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWrapper.java
trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - exposing the stats in embedded
Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java 2009-05-18 18:31:12 UTC (rev 972)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java 2009-05-18 18:32:05 UTC (rev 973)
@@ -144,4 +144,14 @@
*/
void clearConnectorBindingCache(String connectorBindingName)
throws MetaMatrixComponentException;
+
+ /**
+ * Get connection pool statistics for connector binding
+ * @param connectorBindingName - Name of the connector binding
+ * @return a list of {@link com.metamatrix.common.stats.ConnectionPoolStats}
+ * @throws MetaMatrixComponentException
+ * @since 6.1
+ */
+ Collection getConnectionPoolStatistics(String connectorBindingName)
+ throws MetaMatrixComponentException;
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWrapper.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWrapper.java 2009-05-18 18:31:12 UTC (rev 972)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWrapper.java 2009-05-18 18:32:05 UTC (rev 973)
@@ -39,12 +39,15 @@
public class ConnectorWrapper implements XAConnector {
private Connector actualConnector;
+ private String name;
+
public ConnectorWrapper(Connector actualConnector){
this.actualConnector = actualConnector;
}
public void start(ConnectorEnvironment environment) throws ConnectorException {
+ name = environment.getConnectorName();
actualConnector.start(environment);
}
@@ -123,4 +126,8 @@
return false;
}
}
+
+ public String getConnectorBindingName() {
+ return this.name;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java 2009-05-18 18:31:12 UTC (rev 972)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java 2009-05-18 18:32:05 UTC (rev 973)
@@ -100,10 +100,12 @@
super(actualConnector);
pool = new ConnectionPool(this);
poolStats = new ConnectionPoolStats(ConnectionPoolStats.NON_XA_POOL_TYPE);
+ poolStats.setConnectorBindingName(this.getConnectorBindingName());
if (actualConnector instanceof XAConnector) {
xaPool = new ConnectionPool(this);
xaPoolStats = new ConnectionPoolStats(ConnectionPoolStats.XA_POOL_TYPE);
+ xaPoolStats.setConnectorBindingName(this.getConnectorBindingName());
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-05-18 18:31:12 UTC (rev 972)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-05-18 18:32:05 UTC (rev 973)
@@ -396,6 +396,16 @@
}
return getQueueStatistics();
}
+
+ /**
+ * Returns a QueueStats object that represent the queue in
+ * this service.
+ * If there is no queue with the given name, an empty Collection is returned.
+ */
+ public Collection getConnectionPoolsStatistics(String connectorBindingName) {
+
+
+ }
/**
* Cancel and close all requests associated with the clientConnection/session. Also runs a final cleanup any caches within
Modified: trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java 2009-05-18 18:31:12 UTC (rev 972)
+++ trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java 2009-05-18 18:32:05 UTC (rev 973)
@@ -29,14 +29,17 @@
import java.util.Iterator;
import java.util.List;
+import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
import org.teiid.dqp.internal.datamgr.impl.ConnectorWorkItem;
import org.teiid.dqp.internal.process.DQPWorkContext;
+import com.metamatrix.api.exception.ComponentNotFoundException;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.application.exception.ApplicationLifecycleException;
import com.metamatrix.common.comm.api.ResultsReceiver;
import com.metamatrix.common.config.api.ConnectorBinding;
import com.metamatrix.common.types.DataTypeManager;
+import com.metamatrix.dqp.embedded.DQPEmbeddedPlugin;
import com.metamatrix.dqp.internal.datamgr.ConnectorID;
import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.AtomicRequestMessage;
@@ -215,6 +218,14 @@
public Collection getConnectorBindingStatistics(String connectorBindingName) throws MetaMatrixComponentException {
return null;
}
+
+ /**
+ * @see com.metamatrix.dqp.service.DataService#getConnectionPoolStatistics(java.lang.String)
+ * @since 6.1
+ */
+ public Collection getConnectionPoolStatistics(String connectorBindingName) throws MetaMatrixComponentException {
+ return null;
+ }
/**
* @see com.metamatrix.dqp.service.DataService#clearConnectorBindingCache(java.lang.String)
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2009-05-18 18:31:12 UTC (rev 972)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2009-05-18 18:32:05 UTC (rev 973)
@@ -29,6 +29,8 @@
import java.util.Map;
import java.util.Properties;
+import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
+
import junit.framework.TestCase;
import com.metamatrix.api.exception.ComponentNotFoundException;
@@ -42,6 +44,7 @@
import com.metamatrix.common.buffer.TupleBatch;
import com.metamatrix.common.comm.api.ResultsReceiver;
import com.metamatrix.common.config.api.ConnectorBinding;
+import com.metamatrix.dqp.embedded.DQPEmbeddedPlugin;
import com.metamatrix.dqp.internal.datamgr.ConnectorID;
import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.AtomicRequestMessage;
@@ -370,6 +373,8 @@
public Boolean getConnectorBindingState(String connectorBindingName) throws MetaMatrixComponentException {return null;}
public ConnectorBinding getConnectorBinding(String connectorBindingName) throws MetaMatrixComponentException {return null;}
public Collection getConnectorBindingStatistics(String connectorBindingName) throws MetaMatrixComponentException {return null;}
+ public Collection getConnectionPoolStatistics(String connectorBindingName) throws MetaMatrixComponentException { return null; }
+
public void clearConnectorBindingCache(String connectorBindingName) throws MetaMatrixComponentException {}
public void cancelRequest(AtomicRequestID request,
15 years, 7 months