teiid SVN: r2039 - trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-08 17:30:30 -0400 (Thu, 08 Apr 2010)
New Revision: 2039
Modified:
trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectDecoderInputStream.java
Log:
TEIID-943 adding streaming from server to client using the same method as client to server.
Modified: trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectDecoderInputStream.java
===================================================================
--- trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectDecoderInputStream.java 2010-04-08 20:56:33 UTC (rev 2038)
+++ trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectDecoderInputStream.java 2010-04-08 21:30:30 UTC (rev 2039)
@@ -110,12 +110,6 @@
public InputStream getInputStream() throws IOException {
return new BufferedInputStream(new FileInputStream(f)) {
@Override
- public void close() throws IOException {
- super.close();
- f.delete();
- }
-
- @Override
protected void finalize() throws Throwable {
super.finalize();
f.delete();
14 years, 8 months
teiid SVN: r2038 - in trunk: client/src/main/java/org/teiid/adminapi/impl and 2 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-04-08 16:56:33 -0400 (Thu, 08 Apr 2010)
New Revision: 2038
Added:
trunk/client/src/test/java/org/teiid/adminapi/impl/TestModelMetaData.java
Removed:
trunk/common-core/src/main/java/com/metamatrix/core/vdb/ModelType.java
Modified:
trunk/client/src/main/java/org/teiid/adminapi/Model.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
Log:
TEIID-998: Since the Model type is not a enumeration in the VDB.xml file, the Model.Type enum class and ModelMetadata classes need to be written to accept any "string" as model type and try to match the known types, if not found treat it as a type "OTHER" model.
Modified: trunk/client/src/main/java/org/teiid/adminapi/Model.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Model.java 2010-04-08 15:33:59 UTC (rev 2037)
+++ trunk/client/src/main/java/org/teiid/adminapi/Model.java 2010-04-08 20:56:33 UTC (rev 2038)
@@ -32,7 +32,7 @@
*/
public interface Model extends AdminObject {
- enum Type {PHYSICAL, VIRTUAL, FUNCTION};
+ enum Type {PHYSICAL, VIRTUAL, FUNCTION, OTHER};
/**
* Description about the model
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-04-08 15:33:59 UTC (rev 2037)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-04-08 20:56:33 UTC (rev 2038)
@@ -39,9 +39,7 @@
import org.jboss.managed.api.annotation.ManagementProperty;
import org.teiid.adminapi.Model;
-import com.metamatrix.core.vdb.ModelType;
-
@XmlAccessorType(XmlAccessType.NONE)
@XmlType(name = "", propOrder = {
"description",
@@ -102,7 +100,7 @@
@Override
@ManagementProperty(description = "Is Model Source model")
public boolean isSource() {
- return ModelType.parseString(modelType.toUpperCase()) == ModelType.PHYSICAL;
+ return getModelType() == Model.Type.PHYSICAL;
}
@Override
@@ -114,7 +112,11 @@
@Override
@ManagementProperty(description = "Model Type")
public Type getModelType() {
- return Type.valueOf(modelType);
+ try {
+ return Type.valueOf(modelType.toUpperCase());
+ } catch(IllegalArgumentException e) {
+ return Type.OTHER;
+ }
}
@ManagementProperty(description = "Path to model file inside the archive")
Added: trunk/client/src/test/java/org/teiid/adminapi/impl/TestModelMetaData.java
===================================================================
--- trunk/client/src/test/java/org/teiid/adminapi/impl/TestModelMetaData.java (rev 0)
+++ trunk/client/src/test/java/org/teiid/adminapi/impl/TestModelMetaData.java 2010-04-08 20:56:33 UTC (rev 2038)
@@ -0,0 +1,59 @@
+/*
+ * 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.adminapi.impl;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.teiid.adminapi.Model;
+
+public class TestModelMetaData {
+
+ @Test
+ public void testModelType() {
+
+ ModelMetaData model = new ModelMetaData();
+ model.modelType = "physical";
+
+ assertTrue(model.getModelType() == Model.Type.PHYSICAL);
+ assertTrue(model.isSource());
+
+ model.modelType = "VIRTUAL";
+ assertTrue(model.getModelType() == Model.Type.VIRTUAL);
+
+ model.modelType = "TYPE";
+ assertTrue(model.getModelType() == Model.Type.OTHER);
+ assertTrue(!model.isSource());
+ }
+
+ @Test
+ public void testSupportMultiSource() {
+ ModelMetaData model = new ModelMetaData();
+ assertFalse(model.isSupportsMultiSourceBindings());
+ model.setSupportsMultiSourceBindings(true);
+
+ assertTrue(model.isSupportsMultiSourceBindings());
+
+ assertTrue(!model.getProperties().isEmpty());
+ }
+}
Property changes on: trunk/client/src/test/java/org/teiid/adminapi/impl/TestModelMetaData.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/common-core/src/main/java/com/metamatrix/core/vdb/ModelType.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/core/vdb/ModelType.java 2010-04-08 15:33:59 UTC (rev 2037)
+++ trunk/common-core/src/main/java/com/metamatrix/core/vdb/ModelType.java 2010-04-08 20:56:33 UTC (rev 2038)
@@ -1,114 +0,0 @@
-/*
- * 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 com.metamatrix.core.vdb;
-
-/**
- * Fix me: these contants come from com.metamatrix.metamodels.relational.ModelType
- */
-public final class ModelType {
-
- /**
- * The '<em><b>PHYSICAL</b></em>' literal value.>
- */
- public static final int PHYSICAL = 0;
-
- /**
- * The '<em><b>VIRTUAL</b></em>' literal value.
- */
- public static final int VIRTUAL = 1;
-
- /**
- * The '<em><b>TYPE</b></em>' literal value.
- */
- public static final int TYPE = 2;
-
- /**
- * The '<em><b>VDB ARCHIVE</b></em>' literal value.
- */
- public static final int VDB_ARCHIVE = 3;
-
- /**
- * The '<em><b>UNKNOWN</b></em>' literal value.ed
- */
- public static final int UNKNOWN = 4;
-
- /**
- * The '<em><b>FUNCTION</b></em>' literal value.
- */
- public static final int FUNCTION = 5;
-
- /**
- * The '<em><b>CONFIGURATION</b></em>' literal value.
- */
- public static final int CONFIGURATION = 6;
-
- /**
- * The '<em><b>METAMODEL</b></em>' literal value.
- */
- public static final int METAMODEL = 7;
-
- /**
- * The '<em><b>EXTENSION</b></em>' literal value.d
- */
- public static final int EXTENSION = 8;
-
- /**
- * The '<em><b>LOGICAL</b></em>' literal value.
- */
- public static final int LOGICAL = 9;
-
- /**
- * The '<em><b>MATERIALIZATION</b></em>' literal value.
- */
- public static final int MATERIALIZATION = 10;
-
- public static final String[] MODEL_NAMES = {
- "PHYSICAL", //$NON-NLS-1$
- "VIRTUAL", //$NON-NLS-1$
- "TYPE", //$NON-NLS-1$
- "VDB_ARCHIVE", //$NON-NLS-1$
- "UNKNOWN", //$NON-NLS-1$
- "FUNCTION", //$NON-NLS-1$
- "CONFIGURATION", //$NON-NLS-1$
- "METAMODEL", //$NON-NLS-1$
- "EXTENSION", //$NON-NLS-1$
- "LOGICAL", //$NON-NLS-1$
- "MATERIALIZATION" //$NON-NLS-1$
- };
-
- public static int parseString(String s) {
- for(int i = PHYSICAL; i <= MATERIALIZATION; i++ ) {
- if (MODEL_NAMES[i].equals(s)) {
- return i;
- }
- }
- throw new IllegalArgumentException("Unknown model type"); //$NON-NLS-1$
- }
-
- public static String getString(int modelType) {
- if (modelType < 0 || modelType >= MODEL_NAMES.length) {
- throw new IllegalArgumentException("Unknown model type"); //$NON-NLS-1$
- }
- return MODEL_NAMES[modelType];
- }
-}
14 years, 8 months
teiid SVN: r2037 - in trunk: connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver and 3 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-08 11:33:59 -0400 (Thu, 08 Apr 2010)
New Revision: 2037
Added:
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SQLServerCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SQLServerSQLTranslator.java
Removed:
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerSQLTranslator.java
Modified:
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCManagedConnectionFactory.java
trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/sqlserver/TestSqlServerConversionVisitor.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestTPCR.java
Log:
TEIID-833 addressing misc. issues - Specific Translators were not being used and changed SqlServer to SQLServer for consistency
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCManagedConnectionFactory.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCManagedConnectionFactory.java 2010-04-08 02:41:01 UTC (rev 2036)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCManagedConnectionFactory.java 2010-04-08 15:33:59 UTC (rev 2037)
@@ -60,10 +60,11 @@
if (this.sqlTranslator == null) {
try {
String className = getExtensionTranslationClassName();
- if (StringUtil.isValid(className)) {
- className = Translator.class.getName();
+ if (!StringUtil.isValid(className)) {
+ this.sqlTranslator = new Translator();
+ } else {
+ this.sqlTranslator = (Translator)ReflectionHelper.create(className, null, Thread.currentThread().getContextClassLoader());
}
- this.sqlTranslator = (Translator)ReflectionHelper.create(className, null, Thread.currentThread().getContextClassLoader());
sqlTranslator.initialize(this);
} catch (MetaMatrixCoreException e) {
throw new ConnectorException(e);
Copied: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SQLServerCapabilities.java (from rev 2035, trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerCapabilities.java)
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SQLServerCapabilities.java (rev 0)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SQLServerCapabilities.java 2010-04-08 15:33:59 UTC (rev 2037)
@@ -0,0 +1,138 @@
+/*
+ * 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.sqlserver;
+
+import java.util.*;
+
+import org.teiid.connector.jdbc.JDBCCapabilities;
+
+
+/**
+ */
+public class SQLServerCapabilities extends JDBCCapabilities {
+
+ public SQLServerCapabilities() {
+ }
+
+ /**
+ * @see com.metamatrix.data.ConnectorCapabilities#getSupportedFunctions()
+ */
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+ supportedFunctions.add("ABS"); //$NON-NLS-1$
+ supportedFunctions.add("ACOS"); //$NON-NLS-1$
+ supportedFunctions.add("ASIN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN2"); //$NON-NLS-1$
+ supportedFunctions.add("COS"); //$NON-NLS-1$
+ supportedFunctions.add("COT"); //$NON-NLS-1$
+ supportedFunctions.add("DEGREES"); //$NON-NLS-1$
+ supportedFunctions.add("EXP"); //$NON-NLS-1$
+ supportedFunctions.add("FLOOR"); //$NON-NLS-1$
+ supportedFunctions.add("LOG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG10"); //$NON-NLS-1$
+ supportedFunctions.add("MOD"); //$NON-NLS-1$
+ supportedFunctions.add("PI"); //$NON-NLS-1$
+ supportedFunctions.add("POWER"); //$NON-NLS-1$
+ supportedFunctions.add("RADIANS"); //$NON-NLS-1$
+ supportedFunctions.add("SIGN"); //$NON-NLS-1$
+ supportedFunctions.add("SIN"); //$NON-NLS-1$
+ supportedFunctions.add("SQRT"); //$NON-NLS-1$
+ supportedFunctions.add("TAN"); //$NON-NLS-1$
+ supportedFunctions.add("ASCII"); //$NON-NLS-1$
+ supportedFunctions.add("CHAR"); //$NON-NLS-1$
+ supportedFunctions.add("CHR"); //$NON-NLS-1$
+ supportedFunctions.add("CONCAT"); //$NON-NLS-1$
+ supportedFunctions.add("||"); //$NON-NLS-1$
+ //supportedFunctons.add("INITCAP"); //$NON-NLS-1$
+ supportedFunctions.add("LCASE"); //$NON-NLS-1$
+ supportedFunctions.add("LEFT"); //$NON-NLS-1$
+ supportedFunctions.add("LENGTH"); //$NON-NLS-1$
+ //supportedFunctons.add("LOCATE"); //$NON-NLS-1$
+ supportedFunctions.add("LOWER"); //$NON-NLS-1$
+ //supportedFunctons.add("LPAD"); //$NON-NLS-1$
+ supportedFunctions.add("LTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("REPEAT"); //$NON-NLS-1$
+ //supportedFunctions.add("RAND"); //$NON-NLS-1$
+ supportedFunctions.add("REPLACE"); //$NON-NLS-1$
+ supportedFunctions.add("RIGHT"); //$NON-NLS-1$
+ //supportedFunctons.add("RPAD"); //$NON-NLS-1$
+ supportedFunctions.add("RTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("SPACE"); //$NON-NLS-1$
+ supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
+ //supportedFunctons.add("TRANSLATE"); //$NON-NLS-1$
+ supportedFunctions.add("UCASE"); //$NON-NLS-1$
+ supportedFunctions.add("UPPER"); //$NON-NLS-1$
+ //supportedFunctons.add("CURDATE"); //$NON-NLS-1$
+ //supportedFunctons.add("CURTIME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
+ supportedFunctions.add("HOUR"); //$NON-NLS-1$
+ supportedFunctions.add("MINUTE"); //$NON-NLS-1$
+ supportedFunctions.add("MONTH"); //$NON-NLS-1$
+ supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
+ //supportedFunctions.add("NOW"); //$NON-NLS-1$
+ supportedFunctions.add("QUARTER"); //$NON-NLS-1$
+ supportedFunctions.add("SECOND"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
+ supportedFunctions.add("WEEK"); //$NON-NLS-1$
+ supportedFunctions.add("YEAR"); //$NON-NLS-1$
+ supportedFunctions.add("CAST"); //$NON-NLS-1$
+ supportedFunctions.add("CONVERT"); //$NON-NLS-1$
+ supportedFunctions.add("IFNULL"); //$NON-NLS-1$
+ supportedFunctions.add("NVL"); //$NON-NLS-1$
+
+ return supportedFunctions;
+ }
+
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ /**
+ * @see org.teiid.connector.api.ConnectorCapabilities#supportsFunctionsInGroupBy()
+ * @since 5.0
+ */
+ public boolean supportsFunctionsInGroupBy() {
+ return true;
+ }
+
+ public boolean supportsRowLimit() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return true;
+ }
+
+ public boolean supportsExcept() {
+ return true;
+ };
+}
Copied: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SQLServerSQLTranslator.java (from rev 2035, trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerSQLTranslator.java)
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SQLServerSQLTranslator.java (rev 0)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SQLServerSQLTranslator.java 2010-04-08 15:33:59 UTC (rev 2037)
@@ -0,0 +1,71 @@
+/*
+ * 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.sqlserver;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.teiid.connector.api.ConnectorCapabilities;
+import org.teiid.connector.api.ExecutionContext;
+import org.teiid.connector.api.TypeFacility;
+import org.teiid.connector.jdbc.sybase.SybaseSQLTranslator;
+import org.teiid.connector.language.ColumnReference;
+import org.teiid.connector.language.Function;
+import org.teiid.connector.language.LanguageObject;
+
+/**
+ * Updated to assume the use of the DataDirect, 2005 driver, or later.
+ */
+public class SQLServerSQLTranslator extends SybaseSQLTranslator {
+
+ //TEIID-31 remove mod modifier for SQL Server 2008
+
+ @Override
+ protected List<Object> convertDateToString(Function function) {
+ return Arrays.asList("replace(convert(varchar, ", function.getParameters().get(0), ", 102), '.', '-')"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ protected List<?> convertTimestampToString(Function function) {
+ return Arrays.asList("convert(varchar, ", function.getParameters().get(0), ", 21)"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
+ return SQLServerCapabilities.class;
+ }
+
+ @Override
+ public List<?> translate(LanguageObject obj, ExecutionContext context) {
+ if (obj instanceof ColumnReference) {
+ ColumnReference elem = (ColumnReference)obj;
+ if (TypeFacility.RUNTIME_TYPES.STRING.equals(elem.getType()) && elem.getMetadataObject() != null && "uniqueidentifier".equalsIgnoreCase(elem.getMetadataObject().getNativeType())) { //$NON-NLS-1$
+ return Arrays.asList("cast(", elem, " as char(36))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ return super.translate(obj, context);
+ }
+
+}
Deleted: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerCapabilities.java 2010-04-08 02:41:01 UTC (rev 2036)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerCapabilities.java 2010-04-08 15:33:59 UTC (rev 2037)
@@ -1,138 +0,0 @@
-/*
- * 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.sqlserver;
-
-import java.util.*;
-
-import org.teiid.connector.jdbc.JDBCCapabilities;
-
-
-/**
- */
-public class SqlServerCapabilities extends JDBCCapabilities {
-
- public SqlServerCapabilities() {
- }
-
- /**
- * @see com.metamatrix.data.ConnectorCapabilities#getSupportedFunctions()
- */
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add("COT"); //$NON-NLS-1$
- supportedFunctions.add("DEGREES"); //$NON-NLS-1$
- supportedFunctions.add("EXP"); //$NON-NLS-1$
- supportedFunctions.add("FLOOR"); //$NON-NLS-1$
- supportedFunctions.add("LOG"); //$NON-NLS-1$
- supportedFunctions.add("LOG10"); //$NON-NLS-1$
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- supportedFunctions.add("PI"); //$NON-NLS-1$
- supportedFunctions.add("POWER"); //$NON-NLS-1$
- supportedFunctions.add("RADIANS"); //$NON-NLS-1$
- supportedFunctions.add("SIGN"); //$NON-NLS-1$
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- supportedFunctions.add("TAN"); //$NON-NLS-1$
- supportedFunctions.add("ASCII"); //$NON-NLS-1$
- supportedFunctions.add("CHAR"); //$NON-NLS-1$
- supportedFunctions.add("CHR"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT"); //$NON-NLS-1$
- supportedFunctions.add("||"); //$NON-NLS-1$
- //supportedFunctons.add("INITCAP"); //$NON-NLS-1$
- supportedFunctions.add("LCASE"); //$NON-NLS-1$
- supportedFunctions.add("LEFT"); //$NON-NLS-1$
- supportedFunctions.add("LENGTH"); //$NON-NLS-1$
- //supportedFunctons.add("LOCATE"); //$NON-NLS-1$
- supportedFunctions.add("LOWER"); //$NON-NLS-1$
- //supportedFunctons.add("LPAD"); //$NON-NLS-1$
- supportedFunctions.add("LTRIM"); //$NON-NLS-1$
- supportedFunctions.add("REPEAT"); //$NON-NLS-1$
- //supportedFunctions.add("RAND"); //$NON-NLS-1$
- supportedFunctions.add("REPLACE"); //$NON-NLS-1$
- supportedFunctions.add("RIGHT"); //$NON-NLS-1$
- //supportedFunctons.add("RPAD"); //$NON-NLS-1$
- supportedFunctions.add("RTRIM"); //$NON-NLS-1$
- supportedFunctions.add("SPACE"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
- //supportedFunctons.add("TRANSLATE"); //$NON-NLS-1$
- supportedFunctions.add("UCASE"); //$NON-NLS-1$
- supportedFunctions.add("UPPER"); //$NON-NLS-1$
- //supportedFunctons.add("CURDATE"); //$NON-NLS-1$
- //supportedFunctons.add("CURTIME"); //$NON-NLS-1$
- supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
- //supportedFunctions.add("NOW"); //$NON-NLS-1$
- supportedFunctions.add("QUARTER"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
- supportedFunctions.add("WEEK"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
- supportedFunctions.add("CAST"); //$NON-NLS-1$
- supportedFunctions.add("CONVERT"); //$NON-NLS-1$
- supportedFunctions.add("IFNULL"); //$NON-NLS-1$
- supportedFunctions.add("NVL"); //$NON-NLS-1$
-
- return supportedFunctions;
- }
-
- public boolean supportsInlineViews() {
- return true;
- }
-
- /**
- * @see org.teiid.connector.api.ConnectorCapabilities#supportsFunctionsInGroupBy()
- * @since 5.0
- */
- public boolean supportsFunctionsInGroupBy() {
- return true;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
-
- @Override
- public boolean supportsIntersect() {
- return true;
- }
-
- public boolean supportsExcept() {
- return true;
- };
-}
Deleted: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerSQLTranslator.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerSQLTranslator.java 2010-04-08 02:41:01 UTC (rev 2036)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerSQLTranslator.java 2010-04-08 15:33:59 UTC (rev 2037)
@@ -1,71 +0,0 @@
-/*
- * 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.sqlserver;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.connector.api.ConnectorCapabilities;
-import org.teiid.connector.api.ExecutionContext;
-import org.teiid.connector.api.TypeFacility;
-import org.teiid.connector.jdbc.sybase.SybaseSQLTranslator;
-import org.teiid.connector.language.ColumnReference;
-import org.teiid.connector.language.Function;
-import org.teiid.connector.language.LanguageObject;
-
-/**
- * Updated to assume the use of the DataDirect, 2005 driver, or later.
- */
-public class SqlServerSQLTranslator extends SybaseSQLTranslator {
-
- //TEIID-31 remove mod modifier for SQL Server 2008
-
- @Override
- protected List<Object> convertDateToString(Function function) {
- return Arrays.asList("replace(convert(varchar, ", function.getParameters().get(0), ", 102), '.', '-')"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Override
- protected List<?> convertTimestampToString(Function function) {
- return Arrays.asList("convert(varchar, ", function.getParameters().get(0), ", 21)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return SqlServerCapabilities.class;
- }
-
- @Override
- public List<?> translate(LanguageObject obj, ExecutionContext context) {
- if (obj instanceof ColumnReference) {
- ColumnReference elem = (ColumnReference)obj;
- if (TypeFacility.RUNTIME_TYPES.STRING.equals(elem.getType()) && elem.getMetadataObject() != null && "uniqueidentifier".equalsIgnoreCase(elem.getMetadataObject().getNativeType())) { //$NON-NLS-1$
- return Arrays.asList("cast(", elem, " as char(36))"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return super.translate(obj, context);
- }
-
-}
Modified: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/sqlserver/TestSqlServerConversionVisitor.java
===================================================================
--- trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-04-08 02:41:01 UTC (rev 2036)
+++ trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-04-08 15:33:59 UTC (rev 2037)
@@ -46,7 +46,7 @@
*/
public class TestSqlServerConversionVisitor {
- private static SqlServerSQLTranslator trans = new SqlServerSQLTranslator();
+ private static SQLServerSQLTranslator trans = new SQLServerSQLTranslator();
@BeforeClass
public static void setup() throws ConnectorException {
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 2010-04-08 02:41:01 UTC (rev 2036)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-04-08 15:33:59 UTC (rev 2037)
@@ -243,10 +243,8 @@
}
protected void processMore() throws BlockedException, MetaMatrixCoreException {
- if (this.processor != null) {
- this.processor.getContext().setTimeSliceEnd(System.currentTimeMillis() + this.processorTimeslice);
- }
if (!doneProducingBatches) {
+ this.processor.getContext().setTimeSliceEnd(System.currentTimeMillis() + this.processorTimeslice);
sendResultsIfNeeded(null);
collector.collectTuples();
doneProducingBatches = this.resultsBuffer.isFinal();
@@ -287,25 +285,21 @@
protected void attemptClose() {
int rowcount = -1;
if (this.resultsBuffer != null) {
- if (this.processor != null) {
- this.processor.closeProcessing();
- }
+ this.processor.closeProcessing();
if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
LogManager.logDetail(LogConstants.CTX_DQP, "Removing tuplesource for the request " + requestID); //$NON-NLS-1$
}
rowcount = resultsBuffer.getRowCount();
- if (this.processor != null) {
- if (this.cid == null || !this.doneProducingBatches) {
- resultsBuffer.remove();
- } else {
- boolean sessionScope = this.processor.getContext().isSessionFunctionEvaluated();
- CachedResults cr = new CachedResults();
- cr.setCommand(originalCommand);
- cr.setAnalysisRecord(analysisRecord);
- cr.setResults(this.resultsBuffer);
- dqpCore.getRsCache().put(cid, sessionScope, cr);
- }
+ if (this.cid == null || !this.doneProducingBatches) {
+ resultsBuffer.remove();
+ } else {
+ boolean sessionScope = this.processor.getContext().isSessionFunctionEvaluated();
+ CachedResults cr = new CachedResults();
+ cr.setCommand(originalCommand);
+ cr.setAnalysisRecord(analysisRecord);
+ cr.setResults(this.resultsBuffer);
+ dqpCore.getRsCache().put(cid, sessionScope, cr);
}
for (DataTierTupleSource connectorRequest : this.connectorInfo.values()) {
@@ -313,7 +307,6 @@
}
this.resultsBuffer = null;
- this.processor = null;
for (LobWorkItem lobWorkItem : this.lobStreams.values()) {
lobWorkItem.close();
@@ -381,7 +374,6 @@
doneProducingBatches = true;
resultsBuffer.close();
this.cid = null;
- this.processor = null;
}
this.returnsUpdateCount = request.returnsUpdateCount;
request = null;
@@ -446,12 +438,10 @@
// send any warnings with the response object
List<Throwable> responseWarnings = new ArrayList<Throwable>();
- if (this.processor != null) {
- List<Exception> currentWarnings = processor.getAndClearWarnings();
- if (currentWarnings != null) {
- responseWarnings.addAll(currentWarnings);
- }
- }
+ List<Exception> currentWarnings = processor.getAndClearWarnings();
+ if (currentWarnings != null) {
+ responseWarnings.addAll(currentWarnings);
+ }
synchronized (warnings) {
responseWarnings.addAll(this.warnings);
this.warnings.clear();
Modified: trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestTPCR.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestTPCR.java 2010-04-08 02:41:01 UTC (rev 2036)
+++ trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestTPCR.java 2010-04-08 15:33:59 UTC (rev 2037)
@@ -26,7 +26,7 @@
import java.util.List;
import org.teiid.connector.jdbc.oracle.OracleCapabilities;
-import org.teiid.connector.jdbc.sqlserver.SqlServerCapabilities;
+import org.teiid.connector.jdbc.sqlserver.SQLServerCapabilities;
import org.teiid.dqp.internal.datamgr.impl.CapabilitiesConverter;
import com.metamatrix.core.util.UnitTestUtil;
@@ -113,7 +113,7 @@
public void testQueryCase3047() throws Exception{
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
finder.addCapabilities("TPCR_Ora", CapabilitiesConverter.convertCapabilities(new OracleCapabilities())); //$NON-NLS-1$
- finder.addCapabilities("TPCR_SQLS", CapabilitiesConverter.convertCapabilities(new SqlServerCapabilities())); //$NON-NLS-1$
+ finder.addCapabilities("TPCR_SQLS", CapabilitiesConverter.convertCapabilities(new SQLServerCapabilities())); //$NON-NLS-1$
HardcodedDataManager dataMgr = new HardcodedDataManager();
@@ -153,7 +153,7 @@
public void testQueryCase3047workaround() throws Exception{
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
finder.addCapabilities("TPCR_Ora", CapabilitiesConverter.convertCapabilities(new OracleCapabilities())); //$NON-NLS-1$
- finder.addCapabilities("TPCR_SQLS", CapabilitiesConverter.convertCapabilities(new SqlServerCapabilities())); //$NON-NLS-1$
+ finder.addCapabilities("TPCR_SQLS", CapabilitiesConverter.convertCapabilities(new SQLServerCapabilities())); //$NON-NLS-1$
HardcodedDataManager dataMgr = new HardcodedDataManager();
@@ -197,7 +197,7 @@
public void testDefect22475() throws Exception {
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
- finder.addCapabilities("TPCR_Oracle_9i", CapabilitiesConverter.convertCapabilities(new SqlServerCapabilities())); //$NON-NLS-1$
+ finder.addCapabilities("TPCR_Oracle_9i", CapabilitiesConverter.convertCapabilities(new SQLServerCapabilities())); //$NON-NLS-1$
ProcessorPlan plan = TestOptimizer.helpPlan("select S_ACCTBAL, S_NAME, N_NAME, P_PARTKEY, P_MFGR, S_ADDRESS, S_PHONE, S_COMMENT from (SELECT SUPPLIER.S_ACCTBAL, SUPPLIER.S_NAME, NATION.N_NAME, PART.P_PARTKEY, PART.P_MFGR, SUPPLIER.S_ADDRESS, SUPPLIER.S_PHONE, SUPPLIER.S_COMMENT FROM PART, SUPPLIER, PARTSUPP, NATION, REGION WHERE (PART.P_PARTKEY = PS_PARTKEY) AND (S_SUPPKEY = PS_SUPPKEY) AND (P_SIZE = 15) AND (P_TYPE LIKE '%BRASS') AND (S_NATIONKEY = N_NATIONKEY) AND (N_REGIONKEY = R_REGIONKEY) AND (R_NAME = 'EUROPE') AND (PS_SUPPLYCOST = (SELECT MIN(PS_SUPPLYCOST) FROM PARTSUPP, SUPPLIER, NATION, REGION WHERE (PART.P_PARTKEY = PS_PARTKEY) AND (S_SUPPKEY = PS_SUPPKEY) AND (S_NATIONKEY = N_NATIONKEY) AND (N_REGIONKEY = R_REGIONKEY) AND (R_NAME = 'EUROPE'))) ORDER BY SUPPLIER.S_ACCTBAL DESC, NATION.N_NAME, SUPPLIER.S_NAME, PART.P_PARTKEY) as x", //$NON-NLS-1$
METADATA, null, finder,
14 years, 8 months
teiid SVN: r2036 - in trunk: build/kit-jboss-container/deploy/teiid and 13 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-07 22:41:01 -0400 (Wed, 07 Apr 2010)
New Revision: 2036
Removed:
trunk/connectors/connector-xml-soap/src/main/java/org/teiid/connector/xmlsource/
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequestWorkItem.java
Modified:
trunk/adminshell/src/main/java/org/teiid/MigrationUtil.java
trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml
trunk/client/src/main/java/org/teiid/client/RequestMessage.java
trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java
trunk/connectors/connector-jdbc/src/main/rar/META-INF/ra.xml
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/XMLConnectorState.java
trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnectorStateImpl.java
trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/FakeHttpProperties.java
trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/TestHTTPConnectorState.java
trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicRequestMessage.java
trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNode.java
trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNodeStatistics.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/test/java/com/metamatrix/query/analysis/TestAnalysisRecord.java
Log:
TEIID-833 addressing misc. issues with jca changes. foremost the jdbc capabilities were not being picked up.
Modified: trunk/adminshell/src/main/java/org/teiid/MigrationUtil.java
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/MigrationUtil.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/adminshell/src/main/java/org/teiid/MigrationUtil.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -66,7 +66,9 @@
"\n create underlying DataSource connection pools." +
"\n You will need to manually create one -ds.xml for each JDBC DataSource " +
"\n with a JNDI name of <connector binding name>DS, " +
- "\n where any spaces in the name are replace by _");
+ "\n where any spaces in the name are replace by _" +
+ "\n\nNode: depending upon the connectors used, you may need to manually edit the " +
+ " -bindings.xml file.");
System.exit(-1);
}
File file = new File(args[0]);
@@ -99,7 +101,7 @@
manifest.delete();
}
transformConfig(config, "/vdb.xsl", new StreamResult(new File(metainf, "vdb.xml")));
- transformConfig(config, "/connector.xsl", new StreamResult(new File(metainf, "bindings-ds.xml")));
+ transformConfig(config, "/connector.xsl", new StreamResult(new File(file.getParentFile(), fileName + "-bindings-ds.xml")));
config.delete();
FileOutputStream out = new FileOutputStream(new File(file.getParent(), fileName + "_70.vdb"));
ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(out));
Modified: trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-04-08 02:41:01 UTC (rev 2036)
@@ -74,8 +74,8 @@
<!-- Name of the process that uniquely identifies this process -->
<property name="processName">localhost</property>
- <!-- Process pool maximum thread count. (default 16) Increase this value if your load includes a large number of XQueries or if the system's available processors is larger than 8. -->
- <property name="maxThreads">16</property>
+ <!-- Process pool maximum thread count. (default 32) Increase this value if your load includes a large number of XQueries or if the system's available processors is larger than 8. -->
+ <property name="maxThreads">32</property>
<!-- Query processor time slice, in milliseconds. (default 2000) -->
<property name="timeSliceInMilli">2000</property>
<!-- Maximum allowed fetch size, set via JDBC. User requested value ignored above this value. (default 20480) -->
Modified: trunk/client/src/main/java/org/teiid/client/RequestMessage.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/RequestMessage.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/client/src/main/java/org/teiid/client/RequestMessage.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -243,7 +243,6 @@
}
public boolean useResultSetCache() {
- //not use caching when there is a txn
return useResultSetCache;
}
Modified: trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicManagedConnectionFactory.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -56,7 +56,7 @@
// Properties set by ra.xml
private String connectorClass;
- private String capabilitiesClass = BasicConnectorCapabilities.class.getName();
+ private String capabilitiesClass;
private boolean immutable = false;
private boolean exceptionOnMaxRows = false;
private int maxResultRows = -1;
Modified: trunk/connectors/connector-jdbc/src/main/rar/META-INF/ra.xml
===================================================================
--- trunk/connectors/connector-jdbc/src/main/rar/META-INF/ra.xml 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/connectors/connector-jdbc/src/main/rar/META-INF/ra.xml 2010-04-08 02:41:01 UTC (rev 2036)
@@ -51,7 +51,6 @@
<description>{$display:"Connector Capabilities",$description:"The class to use to provide the Connector Capabilities",$advanced:"true"}</description>
<config-property-name>CapabilitiesClass</config-property-name>
<config-property-type>java.lang.String</config-property-type>
- <config-property-value>org.teiid.connector.basic.BasicConnectorCapabilities</config-property-value>
</config-property>
<config-property>
@@ -95,7 +94,7 @@
<description>{$display:"fetch size used from the connector to its underlying source.",$advanced:"true"}</description>
<config-property-name>FetchSize</config-property-name>
<config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>2000</config-property-value>
+ <config-property-value>1024</config-property-value>
</config-property>
<config-property>
Modified: trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/XMLConnectorState.java
===================================================================
--- trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/XMLConnectorState.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/XMLConnectorState.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -23,10 +23,7 @@
package org.teiid.connector.xml;
-import java.sql.SQLXML;
-
import org.teiid.connector.api.Connection;
-import org.teiid.connector.api.ConnectorCapabilities;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ConnectorLogger;
import org.teiid.connector.xml.http.HTTPManagedConnectionFactory;
@@ -40,8 +37,6 @@
public abstract boolean isPreprocess();
- public abstract ConnectorCapabilities getConnectorCapabilities();
-
public abstract boolean isLogRequestResponse();
public abstract SAXFilterProvider getSAXFilterProvider();
Modified: trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnectorStateImpl.java
===================================================================
--- trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnectorStateImpl.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/connectors/connector-xml-http/src/main/java/org/teiid/connector/xml/base/XMLConnectorStateImpl.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -25,7 +25,6 @@
import java.io.InputStream;
-import org.teiid.connector.api.ConnectorCapabilities;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.ConnectorLogger;
import org.teiid.connector.xml.XMLConnectorState;
@@ -61,8 +60,6 @@
private SAXFilterProvider provider;
- private ConnectorCapabilities capabilites;
-
public XMLConnectorStateImpl() {
setPreprocess(true);
setLogRequestResponse(false);
@@ -77,8 +74,6 @@
}
setLogRequestResponse(env.getLogRequestResponseDocs());
- setCapabilites(loadConnectorCapabilities(env.getCapabilitiesClass()));
-
String provider = env.getSaxFilterProviderClass();
if (provider != null && !provider.equals(SAX_FILTER_PROVIDER_CLASS_DEFAULT)) {
setSaxProviderClass(provider);
@@ -97,19 +92,6 @@
}
}
- private ConnectorCapabilities loadConnectorCapabilities(
- String connectorCapabilitiesClass) throws ConnectorException {
- ConnectorCapabilities caps = null;
- try {
- Class clazz = Thread.currentThread().getContextClassLoader().loadClass(connectorCapabilitiesClass);
- caps = (ConnectorCapabilities) clazz.newInstance();
- } catch (Exception e) {
- logger.logError(e.getMessage(), e);
- throw new ConnectorException(e);
- }
- return caps;
- }
-
/*
* (non-Javadoc)
*
@@ -145,20 +127,6 @@
return m_preprocess;
}
- /*
- * (non-Javadoc)
- *
- * @see com.metamatrix.connector.xml.base.XMLConnectorState#getConnectorCapabilities()
- */
- public ConnectorCapabilities getConnectorCapabilities() {
- return capabilites;
- }
-
- private void setCapabilites(ConnectorCapabilities capabilities) {
- this.capabilites = capabilities;
- }
-
-
private void setLogRequestResponse(boolean logRequestResponse) {
m_logRequestResponse = logRequestResponse;
}
Modified: trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/FakeHttpProperties.java
===================================================================
--- trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/FakeHttpProperties.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/FakeHttpProperties.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -1,47 +1,21 @@
package org.teiid.connector.xml.http;
-import java.util.Properties;
-import org.teiid.connector.xml.SecureConnectorState;
-import org.teiid.connector.xml.XMLConnectorState;
-
@SuppressWarnings("nls")
public class FakeHttpProperties {
- public static Properties getDefaultXMLRequestProps() {
- Properties defaultHTTPProps = getDefaultHttpProps();
- defaultHTTPProps.setProperty(HTTPConnectorState.PARAMETER_METHOD,HTTPConnectorState.PARAMETER_XML_REQUEST);
- return defaultHTTPProps;
- }
-
- public static Properties getDefaultHttpProps() {
- Properties testHTTPProps = new Properties();
- testHTTPProps.setProperty(XMLConnectorState.STATE_CLASS_PROP, "com.metamatrix.connector.xml.http.HTTPConnectorState");
- testHTTPProps.setProperty(HTTPConnectorState.ACCESS_METHOD,HTTPConnectorState.GET);
- testHTTPProps.setProperty(HTTPConnectorState.PARAMETER_METHOD,HTTPConnectorState.PARAMETER_XML_REQUEST);
- testHTTPProps.setProperty(HTTPConnectorState.URI, "http://0.0.0.0:8673");
+
+ public static HTTPManagedConnectionFactory getDefaultXMLRequestProps() {
+ HTTPManagedConnectionFactory env = new HTTPManagedConnectionFactory();
+ env.setConnectorStateClass("com.metamatrix.connector.xml.http.HTTPConnectorState");
+ env.setAccessMethod(HTTPConnectorState.GET);
+ env.setParameterMethod(HTTPConnectorState.PARAMETER_XML_REQUEST);
+ env.setUri("http://0.0.0.0:8673");
// testHTTPProps.setProperty(HTTPConnectorState.PROXY_URI,
// "http://0.0.0.0:8673");
- testHTTPProps.setProperty(HTTPConnectorState.REQUEST_TIMEOUT, "60");
- testHTTPProps.setProperty(HTTPConnectorState.XML_PARAMETER_NAME,"XMLRequest");
- testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_USER, "");
- testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_PASSWORD, "");
- testHTTPProps.setProperty(SecureConnectorState.SECURITY_DESERIALIZER_CLASS,"org.teiid.connector.xml.http.DefaultTrustDeserializer");
- return testHTTPProps;
-
+ env.setRequestTimeout(60);
+ env.setXMLParmName("XMLRequest");
+ env.setTrustDeserializerClass("org.teiid.connector.xml.http.DefaultTrustDeserializer");
+ return env;
}
-
-
- public static Properties getDefaultHTTPProps() {
- Properties testHTTPProps = new Properties();
- testHTTPProps.setProperty(HTTPConnectorState.URI, "http://localhost:8673"); //$NON-NLS-1$
- testHTTPProps.setProperty(HTTPConnectorState.REQUEST_TIMEOUT, "60"); //$NON-NLS-1$
- testHTTPProps.setProperty(XMLConnectorState.STATE_CLASS_PROP, "com.metamatrix.connector.xml.http.HTTPConnectorState"); //$NON-NLS-1$
- testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_USER, "");
- testHTTPProps.setProperty(HTTPConnectorState.HTTP_BASIC_PASSWORD, "");
- testHTTPProps.setProperty(SecureConnectorState.SECURITY_DESERIALIZER_CLASS, "com.metamatrix.connector.xml.http.DefaultTrustDeserializer");
- testHTTPProps.setProperty(HTTPConnectorState.PARAMETER_METHOD, HTTPConnectorState.PARAMETER_NAME_VALUE);
- testHTTPProps.setProperty(HTTPConnectorState.ACCESS_METHOD, HTTPConnectorState.GET);
- return testHTTPProps;
- }
}
Modified: trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/TestHTTPConnectorState.java
===================================================================
--- trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/TestHTTPConnectorState.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/connectors/connector-xml-http/src/test/java/org/teiid/connector/xml/http/TestHTTPConnectorState.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -22,18 +22,16 @@
package org.teiid.connector.xml.http;
-import java.util.Properties;
-
import junit.framework.TestCase;
import org.teiid.connector.api.ConnectorException;
import com.metamatrix.cdk.api.SysLogger;
-import com.metamatrix.common.util.PropertiesUtils;
/**
*
*/
+@SuppressWarnings("nls")
public class TestHTTPConnectorState extends TestCase {
/**
@@ -94,28 +92,20 @@
assertEquals(paramName, state.getXmlParameterName());
}
- public void testHostnameVerifier() {
- Properties props = FakeHttpProperties.getDefaultXMLRequestProps();
- props.put("HostnameVerifier", "org.teiid.connector.xml.http.MockHostnameVerifier");
+ public void testHostnameVerifier() throws ConnectorException {
HTTPConnectorState state = new HTTPConnectorState();
- try {
- HTTPManagedConnectionFactory env = new HTTPManagedConnectionFactory();
- PropertiesUtils.setBeanProperties(env, props, null);
- state.setLogger(new SysLogger(false));
- state.setState(env);
- } catch (ConnectorException ce) {
- fail(ce.getMessage());
- }
+ HTTPManagedConnectionFactory env = FakeHttpProperties.getDefaultXMLRequestProps();
+ env.setHostnameVerifier("org.teiid.connector.xml.http.MockHostnameVerifier");
+ state.setLogger(new SysLogger(false));
+ state.setState(env);
}
public void testBadHostnameVerifier() {
- Properties props = FakeHttpProperties.getDefaultXMLRequestProps();
- props.put("HostnameVerifier", "com.metamatrix.connector.xml.BogusHostnameVerifier");
HTTPConnectorState state = new HTTPConnectorState();
try {
state.setLogger(new SysLogger(false));
- HTTPManagedConnectionFactory env = new HTTPManagedConnectionFactory();
- PropertiesUtils.setBeanProperties(env, props, null);
+ HTTPManagedConnectionFactory env = FakeHttpProperties.getDefaultXMLRequestProps();
+ env.setHostnameVerifier("com.metamatrix.connector.xml.BogusHostnameVerifier");
state.setState(env);
} catch (ConnectorException ce) {
return;
Modified: trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicRequestMessage.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicRequestMessage.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/message/AtomicRequestMessage.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -73,9 +73,6 @@
// The time when command begins processing on the server.
private long processingTimestamp = System.currentTimeMillis();
- // whether to use ResultSet cache if there is one
- private boolean useResultSetCache;
-
private boolean partialResultsFlag;
private RequestID requestID;
@@ -153,16 +150,6 @@
return processingTimestamp;
}
- public boolean useResultSetCache() {
- //not use caching when there is a txn
- return useResultSetCache
- && !isTransactional();
- }
-
- public void setUseResultSetCache(boolean useResultSetCacse) {
- this.useResultSetCache = useResultSetCacse;
- }
-
public boolean supportsPartialResults() {
return partialResultsFlag;
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -106,9 +106,6 @@
private boolean recordQueryPlan;
private boolean recordDebug;
- // Query plan
- private PlanNode queryPlan;
-
// Annotations
private Collection<Annotation> annotations;
@@ -159,22 +156,6 @@
}
/**
- * Set the query plan that was created
- * @param queryPlan The plan
- */
- public void setQueryPlan(PlanNode queryPlan) {
- this.queryPlan = queryPlan;
- }
-
- /**
- * Get the query plan that was created
- * @return The plan
- */
- public PlanNode getQueryPlan() {
- return this.queryPlan;
- }
-
- /**
* Add an annotation. This can only be used if {@link #recordAnnotations}
* returns true.
* @param annotation Annotation to add
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNode.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNode.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNode.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -500,7 +500,6 @@
PlanNode result = new PlanNode(getClassName());
result.addProperty(PROP_OUTPUT_COLS, AnalysisRecord.getOutputColumnProperties(this.elements));
if(this.context != null && this.context.getCollectNodeStatistics()) {
- this.nodeStatistics.setStatisticsList();
result.addProperty(PROP_NODE_STATS_LIST, this.nodeStatistics.getStatisticsList());
}
List<String> costEstimates = this.getCostEstimates();
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNodeStatistics.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNodeStatistics.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/relational/RelationalNodeStatistics.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -37,7 +37,6 @@
static final int BATCHCOMPLETE_STOP = 0;
static final int BLOCKEDEXCEPTION_STOP = 1;
- private List<String> statisticsList = new ArrayList<String>();
private boolean setNodeStartTime;
// The total amount of rows output by this node
@@ -115,18 +114,15 @@
}
}
- public void setStatisticsList() {
- this.statisticsList.clear();
- this.statisticsList.add("Node Output Rows: " + this.nodeOutputRows); //$NON-NLS-1$
- this.statisticsList.add("Node Process Time: " + this.nodeProcessingTime); //$NON-NLS-1$
- this.statisticsList.add("Node Cumulative Process Time: " + this.nodeCumulativeProcessingTime); //$NON-NLS-1$
- this.statisticsList.add("Node Cumulative Next Batch Process Time: " + this.nodeCumulativeNextBatchProcessingTime); //$NON-NLS-1$
- this.statisticsList.add("Node Next Batch Calls: " + this.nodeNextBatchCalls); //$NON-NLS-1$
- this.statisticsList.add("Node Blocks: " + this.nodeBlocks); //$NON-NLS-1$
- }
-
public List<String> getStatisticsList() {
- return this.statisticsList;
+ ArrayList<String> statisticsList = new ArrayList<String>(6);
+ statisticsList.add("Node Output Rows: " + this.nodeOutputRows); //$NON-NLS-1$
+ statisticsList.add("Node Process Time: " + this.nodeProcessingTime); //$NON-NLS-1$
+ statisticsList.add("Node Cumulative Process Time: " + this.nodeCumulativeProcessingTime); //$NON-NLS-1$
+ statisticsList.add("Node Cumulative Next Batch Process Time: " + this.nodeCumulativeNextBatchProcessingTime); //$NON-NLS-1$
+ statisticsList.add("Node Next Batch Calls: " + this.nodeNextBatchCalls); //$NON-NLS-1$
+ statisticsList.add("Node Blocks: " + this.nodeBlocks); //$NON-NLS-1$
+ return statisticsList;
}
/**
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -326,7 +326,6 @@
AtomicRequestMessage aqr = new AtomicRequestMessage(request, workItem.getDqpWorkContext(), nodeID);
aqr.setCommand(command);
aqr.setModelName(modelName);
- aqr.setUseResultSetCache(request.useResultSetCache());
aqr.setPartialResults(request.supportsPartialResults());
if (nodeID >= 0) {
aqr.setTransactionContext(workItem.getTransactionContext());
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 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -377,9 +377,6 @@
if (this.transactionContext != null && this.transactionContext.getTransactionType() != Scope.NONE) {
this.transactionState = TransactionState.ACTIVE;
}
- if (analysisRecord.recordQueryPlan()) {
- analysisRecord.setQueryPlan(processor.getProcessorPlan().getDescriptionProperties());
- }
if (requestMsg.isNoExec()) {
doneProducingBatches = true;
resultsBuffer.close();
@@ -440,7 +437,7 @@
}
int finalRowCount = this.resultsBuffer.isFinal()?this.resultsBuffer.getRowCount():(batch.getTerminationFlag()?batch.getEndRow():-1);
- response = createResultsMessage(requestMsg, batch.getAllTuples(), this.originalCommand.getProjectedSymbols(), analysisRecord);
+ response = createResultsMessage(batch.getAllTuples(), this.originalCommand.getProjectedSymbols());
response.setFirstRow(batch.getBeginRow());
response.setLastRow(batch.getEndRow());
response.setUpdateResult(this.returnsUpdateCount);
@@ -479,7 +476,7 @@
return result;
}
- public static ResultsMessage createResultsMessage(RequestMessage message, List[] batch, List columnSymbols, AnalysisRecord analysisRecord) {
+ public ResultsMessage createResultsMessage(List[] batch, List columnSymbols) {
String[] columnNames = new String[columnSymbols.size()];
String[] dataTypes = new String[columnSymbols.size()];
@@ -488,16 +485,15 @@
columnNames[i] = SingleElementSymbol.getShortName(symbol.getOutputName());
dataTypes[i] = DataTypeManager.getDataTypeName(symbol.getType());
}
-
- ResultsMessage result = new ResultsMessage(message, batch, columnNames, dataTypes);
- setAnalysisRecords(message, result, analysisRecord);
+ ResultsMessage result = new ResultsMessage(requestMsg, batch, columnNames, dataTypes);
+ setAnalysisRecords(result);
return result;
}
- private static void setAnalysisRecords(RequestMessage requestMsg, ResultsMessage response, AnalysisRecord analysisRecord) {
+ private void setAnalysisRecords(ResultsMessage response) {
if(analysisRecord != null) {
if (requestMsg.getShowPlan() != ShowPlan.OFF) {
- response.setPlanDescription(analysisRecord.getQueryPlan());
+ response.setPlanDescription(processor.getProcessorPlan().getDescriptionProperties());
response.setAnnotations(analysisRecord.getAnnotations());
}
if (requestMsg.getShowPlan() == ShowPlan.DEBUG) {
@@ -516,7 +512,7 @@
LogManager.logDetail(LogConstants.CTX_DQP, processingException, "Sending error to client", requestID); //$NON-NLS-1$
ResultsMessage response = new ResultsMessage(requestMsg);
response.setException(processingException);
- setAnalysisRecords(this.requestMsg, response, analysisRecord);
+ setAnalysisRecords(response);
resultsReceiver.receiveResults(response);
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/analysis/TestAnalysisRecord.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/analysis/TestAnalysisRecord.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/engine/src/test/java/com/metamatrix/query/analysis/TestAnalysisRecord.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -27,7 +27,6 @@
import junit.framework.TestCase;
import org.teiid.client.plan.Annotation;
-import org.teiid.client.plan.PlanNode;
import org.teiid.client.plan.Annotation.Priority;
import com.metamatrix.core.util.StringUtil;
@@ -44,16 +43,6 @@
super(name);
}
- public void testQueryPlan() {
- AnalysisRecord rec = new AnalysisRecord(true, false);
- assertTrue(rec.recordQueryPlan());
-
- PlanNode plan = new PlanNode("test"); //$NON-NLS-1$
- plan.addProperty("node", "value"); //$NON-NLS-1$ //$NON-NLS-2$
- rec.setQueryPlan(plan);
- assertEquals(rec.getQueryPlan(), plan);
- }
-
public void testAnnotations() {
AnalysisRecord rec = new AnalysisRecord(true, false);
assertTrue(rec.recordAnnotations());
Deleted: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequestWorkItem.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequestWorkItem.java 2010-04-07 19:55:09 UTC (rev 2035)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequestWorkItem.java 2010-04-08 02:41:01 UTC (rev 2036)
@@ -1,45 +0,0 @@
-/*
- * 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.dqp.internal.process;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.client.ResultsMessage;
-import org.teiid.client.TestRequestMessage;
-import org.teiid.dqp.internal.process.RequestWorkItem;
-
-import com.metamatrix.query.sql.symbol.ElementSymbol;
-
-import junit.framework.TestCase;
-
-public class TestRequestWorkItem extends TestCase {
-
- public void testResultsMetadata() {
- ElementSymbol e1 = new ElementSymbol("g1.E1"); //name in metadata
- e1.setOutputName("G1.e1"); //name in query
- ResultsMessage message = RequestWorkItem.createResultsMessage(TestRequestMessage.example(), new List[] {}, Arrays.asList(e1), null);
- assertEquals(Arrays.asList("e1"), Arrays.asList(message.getColumnNames()));
- }
-
-}
14 years, 8 months
teiid SVN: r2035 - in trunk: client/src/main/java/org/teiid/adminapi and 3 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-04-07 15:55:09 -0400 (Wed, 07 Apr 2010)
New Revision: 2035
Modified:
trunk/adminshell/src/main/resources/scripts/adminapi.bsh
trunk/client/src/main/java/org/teiid/adminapi/Admin.java
trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java
trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
Log:
TEIID-910: Changing the start/stop connection factory methods to work based on the "deployedName" rather than the
Modified: trunk/adminshell/src/main/resources/scripts/adminapi.bsh
===================================================================
--- trunk/adminshell/src/main/resources/scripts/adminapi.bsh 2010-04-07 19:26:47 UTC (rev 2034)
+++ trunk/adminshell/src/main/resources/scripts/adminapi.bsh 2010-04-07 19:55:09 UTC (rev 2035)
@@ -7,10 +7,8 @@
/**
* Deploy a {@link VDB} file.
- * @param name Name of the VDB file to save under
- * @param URL VDB file location.
+ * @param vdbFile - VDB File Name
* @throws AdminException
- * if there's a system error.
* @return the {@link VDB} representing the current property values and runtime state.
*/
VDB deployVDB(String vdbFile) {
@@ -21,8 +19,8 @@
/**
* Delete the VDB with the given name and version
- * @param vdbName
- * @param version
+ * @param name - name of VDB
+ * @param version - version of the VDB
* @throws AdminException
*/
void deleteVDB(String name, int version) {
@@ -35,13 +33,13 @@
*
* @param vdbName identifier of the {@link VDB}
* @param vdbVersion {@link VDB} version
- * @return InputStream of the VDB
- * @throws AdminException if there's a system error.
+ * @param fileName - File name to save the VDB
+ * @throws AdminException
*/
-void exportVDB(String name, int vdbVersion, String fileName){
- debug("Exporting VDB " + name + " version " + vdbVersion + " to file " + fileName);
+void exportVDB(String vdbName, int vdbVersion, String fileName){
+ debug("Exporting VDB " + vdbName + " version " + vdbVersion + " to file " + fileName);
checkAdmin();
- contents = internalAdmin.exportVDB(name, vdbVersion);
+ contents = internalAdmin.exportVDB(vdbName, vdbVersion);
if (contents != null) {
ObjectConverterUtil.write(contents, fileName);
}
@@ -71,10 +69,10 @@
* @param deployedName - deployed name of the connection factory
* @throws AdminException
*/
-void deleteConnectionFactory(String bindingName) throws AdminException {
- debug("Deleting Connection Factory " + bindingName);
+void deleteConnectionFactory(String deployedName) throws AdminException {
+ debug("Deleting Connection Factory " + deployedName);
checkAdmin();
- internalAdmin.deleteConnectionFactory(bindingName);
+ internalAdmin.deleteConnectionFactory(deployedName);
}
/**
@@ -83,12 +81,11 @@
* @param deployedName the unique identifier for a {@link ConnectionFactory}.
* @param fileName - Name under which exported content stored under
* @throws AdminException
- *
*/
-void exportConnectionFactory(String bindingName, String fileName){
- debug("Exporting Connection Factory " + bindingName + " to file " + fileName);
+void exportConnectionFactory(String deployedName, String fileName){
+ debug("Exporting Connection Factory " + deployedName + " to file " + fileName);
checkAdmin();
- contents = internalAdmin.exportConnectionFactory(bindingName);
+ contents = internalAdmin.exportConnectionFactory(deployedName);
if (contents != null) {
ObjectConverterUtil.write(contents, fileName);
}
@@ -120,10 +117,10 @@
* @param properties - properties
* @throws AdminException
*/
-void addDataSource(String deploymentName, Properties properties) {
- debug("Adding Datasource " + deploymentName);
+void addDataSource(String dsName, Properties properties) {
+ debug("Adding Datasource " + dsName);
checkAdmin();
- return internalAdmin.addDataSource(deploymentName, properties);
+ return internalAdmin.addDataSource(dsName, properties);
}
/**
@@ -131,10 +128,10 @@
* @param dsName
* @throws AdminException
*/
-void deleteDataSource(String deploymentName) {
- debug("Deleting Datasource " + deploymentName);
+void deleteDataSource(String dsName) {
+ debug("Deleting Datasource " + dsName);
checkAdmin();
- return internalAdmin.deleteDataSource(deploymentName);
+ return internalAdmin.deleteDataSource(dsName);
}
@@ -219,9 +216,6 @@
internalAdmin.terminateTransaction(transactionId);
}
-//** property methods******************************************************************
-
-
/**
* Set/update the property for the Connection Factory identified by the given deployed name.
* @param deployedName
@@ -391,6 +385,7 @@
/**
* Get the Requests for the given session
+ * @param sessionId - session id
* @return Collection of {@link Request}
* @throws AdminException if there's a system error.
*/
@@ -442,7 +437,7 @@
/**
* Start Connection Factory
*
- * @param factory
+ * @param deployedName
* @throws AdminException
*/
void startConnectionFactory(String deployedName) {
@@ -454,7 +449,7 @@
/**
* Stop Connection Factory
*
- * @param factory
+ * @param deployedName
* @throws AdminException
*/
void stopConnectionFactory(String deployedName) {
@@ -478,9 +473,8 @@
/**
* Terminate the Session
*
- * @param identifier Session Identifier {@link org.teiid.adminapi.Session}.
- * No wild cards currently supported, must be explicit
- * @throws AdminException if there's a system error.
+ * @param sessionId Session Identifier {@link org.teiid.adminapi.Session}.
+ * @throws AdminException
*/
void terminateSession(long sessionId) {
debug("Terminating Session " + sessionId);
@@ -493,8 +487,7 @@
*
* @param sessionId session Identifier for the request.
* @param requestId request Identifier
- *
- * @throws AdminException if there's a system error.
+ * @throws AdminException
*/
void cancelRequest(long sessionId, long requestId) {
debug("Canceling Request Session=" + sessionId + " request id = "+requestId);
Modified: trunk/client/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-04-07 19:26:47 UTC (rev 2034)
+++ trunk/client/src/main/java/org/teiid/adminapi/Admin.java 2010-04-07 19:55:09 UTC (rev 2035)
@@ -278,18 +278,18 @@
/**
* Start Connection Factory
*
- * @param factory
+ @param deployedName - name of the deployed Connection Factory
* @throws AdminException
*/
- void startConnectionFactory(ConnectionFactory factory) throws AdminException;
+ void startConnectionFactory(String deployedName) throws AdminException;
/**
* Stop Connection Factory
*
- * @param factory
+ * @param deployedName - name of the deployed Connection Factory
* @throws AdminException
*/
- void stopConnectionFactory(ConnectionFactory factory) throws AdminException;
+ void stopConnectionFactory(String deployedName) throws AdminException;
/**
* Clear the cache or caches specified by the cacheIdentifier.
@@ -370,6 +370,17 @@
* @param policyName
* @param role
*/
- void removeRoleFromDataPolicy(String vdbName, int vdbVersion, String policyName, String role) throws AdminException;
+ void removeRoleFromDataPolicy(String vdbName, int vdbVersion, String policyName, String role) throws AdminException;
+
+
+// /**
+// * Merge the Source VDB into Target VDB. Both Source and Target VDBs must be present for this method to
+// * succeed. The changes will not be persistent between server restarts.
+// * @param sourceVDBName
+// * @param sourceVDBVersion
+// * @param targetVDBName
+// * @param targetVDBVersion
+// */
+// void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) throws AdminException;
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-04-07 19:26:47 UTC (rev 2034)
+++ trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-04-07 19:55:09 UTC (rev 2035)
@@ -319,26 +319,34 @@
}
@Override
- public void startConnectionFactory(ConnectionFactory binding) throws AdminException {
+ public void startConnectionFactory(String deployedName) throws AdminException {
try {
- String deployerName = binding.getPropertyValue("deployer-name"); //$NON-NLS-1$
+ ConnectionFactory factory = getConnectionFactory(deployedName);
+ if (factory == null) {
+ throw new AdminProcessingException(IntegrationPlugin.Util.getString("failed_to_connector_deployer")); //$NON-NLS-1$
+ }
+ String deployerName = factory.getPropertyValue("deployer-name"); //$NON-NLS-1$
if (deployerName == null) {
throw new AdminProcessingException(IntegrationPlugin.Util.getString("failed_to_connector_deployer")); //$NON-NLS-1$
}
- ManagedUtil.execute(getDeploymentManager().start(deployerName), IntegrationPlugin.Util.getString("failed_to_start_connector", binding.getName())); //$NON-NLS-1$
+ ManagedUtil.execute(getDeploymentManager().start(deployerName), IntegrationPlugin.Util.getString("failed_to_start_connector", factory.getName())); //$NON-NLS-1$
} catch (Exception e) {
ManagedUtil.handleException(e);
}
}
@Override
- public void stopConnectionFactory(ConnectionFactory binding) throws AdminException {
+ public void stopConnectionFactory(String deployedName) throws AdminException {
try {
- String deployerName = binding.getPropertyValue("deployer-name");//$NON-NLS-1$
+ ConnectionFactory factory = getConnectionFactory(deployedName);
+ if (factory == null) {
+ throw new AdminProcessingException(IntegrationPlugin.Util.getString("failed_to_connector_deployer")); //$NON-NLS-1$
+ }
+ String deployerName = factory.getPropertyValue("deployer-name");//$NON-NLS-1$
if (deployerName == null) {
throw new AdminProcessingException(IntegrationPlugin.Util.getString("failed_to_connector_deployer")); //$NON-NLS-1$
}
- ManagedUtil.execute(getDeploymentManager().stop(deployerName), IntegrationPlugin.Util.getString("failed_to_stop_connector", binding.getName())); //$NON-NLS-1$
+ ManagedUtil.execute(getDeploymentManager().stop(deployerName), IntegrationPlugin.Util.getString("failed_to_stop_connector", factory.getName())); //$NON-NLS-1$
} catch (Exception e) {
ManagedUtil.handleException(e);
}
@@ -1052,4 +1060,17 @@
manageRoleToDataPolicy(vdbName, vdbVersion, policyName, role, false);
}
+// @Override
+// public void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) throws AdminException {
+// try {
+// ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE);
+// ManagedUtil.executeOperation(mc, "mergeVDBs",
+// SimpleValueSupport.wrap(sourceVDBName),
+// SimpleValueSupport.wrap(sourceVDBVersion),
+// SimpleValueSupport.wrap(targetVDBName),
+// SimpleValueSupport.wrap(targetVDBVersion));//$NON-NLS-1$
+// } catch (Exception e) {
+// throw new AdminComponentException(e.getMessage(), e);
+// }
+// }
}
Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java 2010-04-07 19:26:47 UTC (rev 2034)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategy.java 2010-04-07 19:55:09 UTC (rev 2035)
@@ -205,7 +205,7 @@
api.assignConnectionFactoryToModel(vdb.getName(), vdb.getVersion(), m.getName(), ds.getName(), ds.getProperty("jndi-name"));
- api.startConnectionFactory(api.getConnectionFactory(ds.getName()));
+ api.startConnectionFactory(ds.getName());
} else {
throw new QueryTestFailedException(
"Error: Unable to create binding to map to model : "
Modified: trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-04-07 19:26:47 UTC (rev 2034)
+++ trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-04-07 19:55:09 UTC (rev 2035)
@@ -91,9 +91,9 @@
assertEquals("java:DerbyDS", binding.getPropertyValue("SourceJNDIName")); //$NON-NLS-1$ //$NON-NLS-2$
- admin.stopConnectionFactory(binding);
+ admin.stopConnectionFactory("test-mysql-cb");
- admin.startConnectionFactory(binding);
+ admin.startConnectionFactory("test-mysql-cb");
admin.setConnectionFactoryProperty("test-mysql-cb", "SourceJNDIName", "DummyDS"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
14 years, 8 months
teiid SVN: r2034 - trunk/jboss-integration.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-04-07 15:26:47 -0400 (Wed, 07 Apr 2010)
New Revision: 2034
Modified:
trunk/jboss-integration/pom.xml
Log:
TEIID-833: removing the duplicate entry in the dependencies list
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2010-04-07 15:52:07 UTC (rev 2033)
+++ trunk/jboss-integration/pom.xml 2010-04-07 19:26:47 UTC (rev 2034)
@@ -75,11 +75,6 @@
</dependency>
<dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-client</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnp-client</artifactId>
<version>5.0.3.GA</version>
14 years, 8 months
teiid SVN: r2033 - in trunk: engine/src/main/java/com/metamatrix/query/analysis and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-07 11:52:07 -0400 (Wed, 07 Apr 2010)
New Revision: 2033
Added:
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestQueryPlans.java
Modified:
trunk/client/src/main/java/org/teiid/jdbc/BaseDataSource.java
trunk/client/src/main/java/org/teiid/jdbc/JDBCURL.java
trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
Log:
TEIID-908 TEIID-1040 refining the plannode logic and moving option debug, showplan, and planonly to be set commands
Modified: trunk/client/src/main/java/org/teiid/jdbc/BaseDataSource.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/BaseDataSource.java 2010-04-07 14:57:01 UTC (rev 2032)
+++ trunk/client/src/main/java/org/teiid/jdbc/BaseDataSource.java 2010-04-07 15:52:07 UTC (rev 2033)
@@ -153,7 +153,7 @@
// Default execution property constants
protected static final int DEFAULT_FETCH_SIZE = RequestMessage.DEFAULT_FETCH_SIZE;
protected static final String DEFAULT_PARTIAL_RESULTS_MODE = "FALSE"; //$NON-NLS-1$
- protected static final String DEFAULT_RESULT_SET_CACHE_MODE = "TRUE"; //$NON-NLS-1$
+ protected static final String DEFAULT_RESULT_SET_CACHE_MODE = "FALSE"; //$NON-NLS-1$
/**
* Transaction auto wrap constant - never wrap a command execution in a transaction
Modified: trunk/client/src/main/java/org/teiid/jdbc/JDBCURL.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/JDBCURL.java 2010-04-07 14:57:01 UTC (rev 2032)
+++ trunk/client/src/main/java/org/teiid/jdbc/JDBCURL.java 2010-04-07 15:52:07 UTC (rev 2033)
@@ -284,7 +284,7 @@
}
}
- private static void addNormalizedProperty(String key, Object value, Properties target) {
+ public static void addNormalizedProperty(String key, Object value, Properties target) {
String validKey = getValidKey(key);
// now add the normalized key and value into the properties object.
Modified: trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2010-04-07 14:57:01 UTC (rev 2032)
+++ trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2010-04-07 15:52:07 UTC (rev 2033)
@@ -371,7 +371,6 @@
}
ResultsMessage currentResultMsg = results.get(timeoutSeconds, TimeUnit.SECONDS);
this.accumulateWarnings(currentResultMsg);
- this.updatedPlanDescription = currentResultMsg.getPlanDescription();
return getCurrentBatch(currentResultMsg);
} catch (MetaMatrixProcessingException e) {
throw TeiidSQLException.create(e);
@@ -385,6 +384,7 @@
}
private Batch getCurrentBatch(ResultsMessage currentResultMsg) {
+ this.updatedPlanDescription = currentResultMsg.getPlanDescription();
boolean isLast = currentResultMsg.getResults().length == 0 || currentResultMsg.getFinalRow() == currentResultMsg.getLastRow();
return new Batch(currentResultMsg.getResults(), currentResultMsg.getFirstRow(), currentResultMsg.getLastRow(), isLast);
}
Modified: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-04-07 14:57:01 UTC (rev 2032)
+++ trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-04-07 15:52:07 UTC (rev 2033)
@@ -402,7 +402,7 @@
if (match.matches()) {
String key = match.group(1);
String value = match.group(2);
- this.driverConnection.getConnectionProperties().setProperty(key, value);
+ JDBCURL.addNormalizedProperty(key, value, this.driverConnection.getConnectionProperties());
this.updateCounts = new int[] {0};
return;
}
@@ -745,7 +745,7 @@
String showPlan = getExecutionProperty(ExecutionProperties.SQL_OPTION_SHOWPLAN);
if (showPlan != null) {
try {
- res.setShowPlan(ShowPlan.valueOf(showPlan));
+ res.setShowPlan(ShowPlan.valueOf(showPlan.toUpperCase()));
} catch (IllegalArgumentException e) {
}
@@ -887,14 +887,6 @@
this.styleSheet = null;
}
- void setPlanDescription(PlanNode planDescription) {
- this.currentPlanDescription = planDescription;
- }
-
- void setDebugLog(String debugLog) {
- this.debugLog = debugLog;
- }
-
/**
* Get Query plan description.
* If the Statement has a resultSet, we get the plan description from the result set
@@ -905,7 +897,6 @@
* @return Query plan description, if it exists, otherwise null
*/
public PlanNode getPlanDescription() {
- Map planDescription = null;
if(this.resultSet != null) {
return this.resultSet.getUpdatedPlanDescription();
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-04-07 14:57:01 UTC (rev 2032)
+++ trunk/engine/src/main/java/com/metamatrix/query/analysis/AnalysisRecord.java 2010-04-07 15:52:07 UTC (rev 2033)
@@ -105,7 +105,6 @@
// Flags regarding what should be recorded
private boolean recordQueryPlan;
private boolean recordDebug;
- private boolean logDebug;
// Query plan
private PlanNode queryPlan;
@@ -118,8 +117,7 @@
private PrintWriter debugWriter; // public
public AnalysisRecord(boolean recordQueryPlan, boolean recordDebug) {
- this.recordQueryPlan = recordQueryPlan | LogManager.isMessageToBeRecorded(LogConstants.CTX_QUERY_PLANNER, MessageLevel.DETAIL);
- this.logDebug = recordDebug;
+ this.recordQueryPlan = recordQueryPlan | LogManager.isMessageToBeRecorded(LogConstants.CTX_QUERY_PLANNER, MessageLevel.DETAIL);
this.recordDebug = recordDebug | LogManager.isMessageToBeRecorded(LogConstants.CTX_QUERY_PLANNER, MessageLevel.TRACE);
if(this.recordQueryPlan) {
@@ -132,10 +130,6 @@
}
}
- public boolean logDebug() {
- return logDebug;
- }
-
public static AnalysisRecord createNonRecordingRecord() {
return new AnalysisRecord(false, false);
}
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-04-07 14:57:01 UTC (rev 2032)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2010-04-07 15:52:07 UTC (rev 2033)
@@ -437,7 +437,7 @@
} finally {
String debugLog = analysisRecord.getDebugLog();
if(debugLog != null && debugLog.length() > 0) {
- LogManager.log(analysisRecord.logDebug()?MessageLevel.INFO:MessageLevel.TRACE, LogConstants.CTX_QUERY_PLANNER, debugLog);
+ LogManager.log(requestMsg.getShowPlan()==ShowPlan.DEBUG?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());
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 2010-04-07 14:57:01 UTC (rev 2032)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-04-07 15:52:07 UTC (rev 2033)
@@ -33,6 +33,7 @@
import org.teiid.client.RequestMessage;
import org.teiid.client.ResultsMessage;
import org.teiid.client.SourceWarning;
+import org.teiid.client.RequestMessage.ShowPlan;
import org.teiid.client.lob.LobChunk;
import org.teiid.client.metadata.ParameterInfo;
import org.teiid.client.util.ResultsReceiver;
@@ -489,15 +490,19 @@
}
ResultsMessage result = new ResultsMessage(message, batch, columnNames, dataTypes);
- setAnalysisRecords(result, analysisRecord);
+ setAnalysisRecords(message, result, analysisRecord);
return result;
}
- private static void setAnalysisRecords(ResultsMessage response, AnalysisRecord analysisRecord) {
+ private static void setAnalysisRecords(RequestMessage requestMsg, ResultsMessage response, AnalysisRecord analysisRecord) {
if(analysisRecord != null) {
- response.setPlanDescription(analysisRecord.getQueryPlan());
- response.setDebugLog(analysisRecord.getDebugLog());
- response.setAnnotations(analysisRecord.getAnnotations());
+ if (requestMsg.getShowPlan() != ShowPlan.OFF) {
+ response.setPlanDescription(analysisRecord.getQueryPlan());
+ response.setAnnotations(analysisRecord.getAnnotations());
+ }
+ if (requestMsg.getShowPlan() == ShowPlan.DEBUG) {
+ response.setDebugLog(analysisRecord.getDebugLog());
+ }
}
}
@@ -511,7 +516,7 @@
LogManager.logDetail(LogConstants.CTX_DQP, processingException, "Sending error to client", requestID); //$NON-NLS-1$
ResultsMessage response = new ResultsMessage(requestMsg);
response.setException(processingException);
- setAnalysisRecords(response, analysisRecord);
+ setAnalysisRecords(this.requestMsg, response, analysisRecord);
resultsReceiver.receiveResults(response);
}
Added: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestQueryPlans.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestQueryPlans.java (rev 0)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestQueryPlans.java 2010-04-07 15:52:07 UTC (rev 2033)
@@ -0,0 +1,70 @@
+/*
+ * 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.jdbc;
+
+import static org.junit.Assert.*;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.metamatrix.core.util.UnitTestUtil;
+
+@SuppressWarnings("nls")
+public class TestQueryPlans {
+
+ private Connection conn;
+
+ @Before public void setUp() throws Exception {
+ conn = TestMMDatabaseMetaData.createConnection("jdbc:teiid:test", UnitTestUtil.getTestDataPath() + "/TestCase3473/test.vdb"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testNoExec() throws Exception {
+ Statement s = conn.createStatement();
+ s.execute("set noexec on");
+ ResultSet rs = s.executeQuery("select * from all_tables");
+ assertFalse(rs.next());
+ s.execute("SET NOEXEC off");
+ rs = s.executeQuery("select * from all_tables");
+ assertTrue(rs.next());
+ }
+
+ @Test public void testShowPlan() throws Exception {
+ Statement s = conn.createStatement();
+ s.execute("set showplan on");
+ ResultSet rs = s.executeQuery("select * from all_tables");
+ assertNotNull(s.unwrap(TeiidStatement.class).getPlanDescription());
+ assertNull(s.unwrap(TeiidStatement.class).getDebugLog());
+ s.execute("SET showplan debug");
+ rs = s.executeQuery("select * from all_tables");
+ assertNotNull(s.unwrap(TeiidStatement.class).getDebugLog());
+ s.execute("SET showplan off");
+ rs = s.executeQuery("select * from all_tables");
+ assertNull(s.unwrap(TeiidStatement.class).getPlanDescription());
+ assertTrue(rs.next());
+ }
+
+}
Property changes on: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestQueryPlans.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 8 months
teiid SVN: r2032 - in trunk/engine/src/test/java: com/metamatrix/query/parser and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-04-07 10:57:01 -0400 (Wed, 07 Apr 2010)
New Revision: 2032
Modified:
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinOptimization.java
trunk/engine/src/test/java/com/metamatrix/query/parser/TestOptionsAndHints.java
trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java
trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcedureRelational.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
Log:
TEIID-908 TEIID-1040 refining the plannode logic and moving option debug, showplan, and planonly to be set commands
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinOptimization.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinOptimization.java 2010-04-07 03:29:59 UTC (rev 2031)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinOptimization.java 2010-04-07 14:57:01 UTC (rev 2032)
@@ -136,7 +136,7 @@
}
@Test public void testOuterJoinPushNonJoinCriteria_Case5547() {
- String sql = "select bqt1.smalla.intkey from bqt1.smalla left outer join bqt2.smalla on (1=1) option debug"; //$NON-NLS-1$
+ String sql = "select bqt1.smalla.intkey from bqt1.smalla left outer join bqt2.smalla on (1=1)"; //$NON-NLS-1$
String BQT1 = "BQT1"; //$NON-NLS-1$
String BQT2 = "BQT2"; //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
Modified: trunk/engine/src/test/java/com/metamatrix/query/parser/TestOptionsAndHints.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/parser/TestOptionsAndHints.java 2010-04-07 03:29:59 UTC (rev 2031)
+++ trunk/engine/src/test/java/com/metamatrix/query/parser/TestOptionsAndHints.java 2010-04-07 14:57:01 UTC (rev 2032)
@@ -203,11 +203,10 @@
query);
}
- @Test public void testOptionMakedepBankOfAmerica() throws Exception {
+ @Test public void testOptionMakedep() throws Exception {
String sql = "SELECT A.alert_id " + //$NON-NLS-1$
"FROM (FSK_ALERT AS A MAKEDEP INNER JOIN Core.FSC_PARTY_DIM AS C ON A.primary_entity_key = C.PARTY_KEY) " +//$NON-NLS-1$
- "LEFT OUTER JOIN FSK_SCENARIO AS S ON A.scenario_id = S.scenario_id " +//$NON-NLS-1$
- "OPTION PLANONLY DEBUG"; //$NON-NLS-1$
+ "LEFT OUTER JOIN FSK_SCENARIO AS S ON A.scenario_id = S.scenario_id ";//$NON-NLS-1$
Query command = (Query)new QueryParser().parseCommand(sql);
JoinPredicate predicate = (JoinPredicate)command.getFrom().getClauses().get(0);
assertTrue(((JoinPredicate)predicate.getLeftClause()).getLeftClause().isMakeDep());
Modified: trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java 2010-04-07 03:29:59 UTC (rev 2031)
+++ trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java 2010-04-07 14:57:01 UTC (rev 2032)
@@ -6135,19 +6135,19 @@
}
@Test public void testCompoundNonJoinCriteria_defect15167_1() throws Exception {
- QueryParser.getQueryParser().parseCommand("SELECT A.alert_id, A.primary_entity_name, A.primary_entity_level_code, A.alert_description, A.create_date, A.alert_risk_score, S.scenario_name, A.alert_status_code, A.process_id, A.actual_values_text, S.SCENARIO_CATEGORY_DESC, A.primary_entity_number, A.scenario_id, A.primary_entity_key FROM (FSK_ALERT AS A LEFT OUTER JOIN FSK_SCENARIO AS S ON A.scenario_id = S.scenario_id) INNER JOIN FSC_ACCOUNT_DIM AS C ON A.primary_entity_key = C.ACCOUNT_KEY AND ((S.current_ind = 'Y') OR (S.current_ind IS NULL)) WHERE (A.primary_entity_level_code = 'ACC') AND (C.ACCOUNT_KEY = 23923) AND (A.logical_delete_ind = 'N') OPTION PLANONLY"); //$NON-NLS-1$
+ QueryParser.getQueryParser().parseCommand("SELECT A.alert_id, A.primary_entity_name, A.primary_entity_level_code, A.alert_description, A.create_date, A.alert_risk_score, S.scenario_name, A.alert_status_code, A.process_id, A.actual_values_text, S.SCENARIO_CATEGORY_DESC, A.primary_entity_number, A.scenario_id, A.primary_entity_key FROM (FSK_ALERT AS A LEFT OUTER JOIN FSK_SCENARIO AS S ON A.scenario_id = S.scenario_id) INNER JOIN FSC_ACCOUNT_DIM AS C ON A.primary_entity_key = C.ACCOUNT_KEY AND ((S.current_ind = 'Y') OR (S.current_ind IS NULL)) WHERE (A.primary_entity_level_code = 'ACC') AND (C.ACCOUNT_KEY = 23923) AND (A.logical_delete_ind = 'N')"); //$NON-NLS-1$
}
@Test public void testCompoundNonJoinCriteria_defect15167_2() throws Exception {
- QueryParser.getQueryParser().parseCommand("SELECT A.alert_id, A.primary_entity_name, A.primary_entity_level_code, A.alert_description, A.create_date, A.alert_risk_score, S.scenario_name, A.alert_status_code, A.process_id, A.actual_values_text, S.SCENARIO_CATEGORY_DESC, A.primary_entity_number, A.scenario_id, A.primary_entity_key FROM (FSK_ALERT AS A LEFT OUTER JOIN FSK_SCENARIO AS S ON A.scenario_id = S.scenario_id) INNER JOIN FSC_ACCOUNT_DIM AS C ON A.primary_entity_key = C.ACCOUNT_KEY AND (S.current_ind = 'Y' OR S.current_ind IS NULL) WHERE (A.primary_entity_level_code = 'ACC') AND (C.ACCOUNT_KEY = 23923) AND (A.logical_delete_ind = 'N') OPTION PLANONLY"); //$NON-NLS-1$
+ QueryParser.getQueryParser().parseCommand("SELECT A.alert_id, A.primary_entity_name, A.primary_entity_level_code, A.alert_description, A.create_date, A.alert_risk_score, S.scenario_name, A.alert_status_code, A.process_id, A.actual_values_text, S.SCENARIO_CATEGORY_DESC, A.primary_entity_number, A.scenario_id, A.primary_entity_key FROM (FSK_ALERT AS A LEFT OUTER JOIN FSK_SCENARIO AS S ON A.scenario_id = S.scenario_id) INNER JOIN FSC_ACCOUNT_DIM AS C ON A.primary_entity_key = C.ACCOUNT_KEY AND (S.current_ind = 'Y' OR S.current_ind IS NULL) WHERE (A.primary_entity_level_code = 'ACC') AND (C.ACCOUNT_KEY = 23923) AND (A.logical_delete_ind = 'N')"); //$NON-NLS-1$
}
@Test public void testCompoundNonJoinCriteria_defect15167_3() throws Exception {
- QueryParser.getQueryParser().parseCommand("SELECT A.alert_id, A.primary_entity_name, A.primary_entity_level_code, A.alert_description, A.create_date, A.alert_risk_score, S.scenario_name, A.alert_status_code, A.process_id, A.actual_values_text, S.SCENARIO_CATEGORY_DESC, A.primary_entity_number, A.scenario_id, A.primary_entity_key FROM (FSK_ALERT AS A LEFT OUTER JOIN FSK_SCENARIO AS S ON A.scenario_id = S.scenario_id) INNER JOIN FSC_ACCOUNT_DIM AS C ON (A.primary_entity_key = C.ACCOUNT_KEY AND (S.current_ind = 'Y' OR S.current_ind IS NULL)) WHERE (A.primary_entity_level_code = 'ACC') AND (C.ACCOUNT_KEY = 23923) AND (A.logical_delete_ind = 'N') OPTION PLANONLY"); //$NON-NLS-1$
+ QueryParser.getQueryParser().parseCommand("SELECT A.alert_id, A.primary_entity_name, A.primary_entity_level_code, A.alert_description, A.create_date, A.alert_risk_score, S.scenario_name, A.alert_status_code, A.process_id, A.actual_values_text, S.SCENARIO_CATEGORY_DESC, A.primary_entity_number, A.scenario_id, A.primary_entity_key FROM (FSK_ALERT AS A LEFT OUTER JOIN FSK_SCENARIO AS S ON A.scenario_id = S.scenario_id) INNER JOIN FSC_ACCOUNT_DIM AS C ON (A.primary_entity_key = C.ACCOUNT_KEY AND (S.current_ind = 'Y' OR S.current_ind IS NULL)) WHERE (A.primary_entity_level_code = 'ACC') AND (C.ACCOUNT_KEY = 23923) AND (A.logical_delete_ind = 'N')"); //$NON-NLS-1$
}
@Test public void testCompoundNonJoinCriteria_defect15167_4() throws Exception {
- QueryParser.getQueryParser().parseCommand("SELECT A.alert_id, A.primary_entity_name, A.primary_entity_level_code, A.alert_description, A.create_date, A.alert_risk_score, S.scenario_name, A.alert_status_code, A.process_id, A.actual_values_text, S.SCENARIO_CATEGORY_DESC, A.primary_entity_number, A.scenario_id, A.primary_entity_key FROM (FSK_ALERT AS A LEFT OUTER JOIN FSK_SCENARIO AS S ON A.scenario_id = S.scenario_id) INNER JOIN FSC_ACCOUNT_DIM AS C ON (A.primary_entity_key = C.ACCOUNT_KEY AND S.current_ind = 'Y' OR S.current_ind IS NULL) WHERE (A.primary_entity_level_code = 'ACC') AND (C.ACCOUNT_KEY = 23923) AND (A.logical_delete_ind = 'N') OPTION PLANONLY"); //$NON-NLS-1$
+ QueryParser.getQueryParser().parseCommand("SELECT A.alert_id, A.primary_entity_name, A.primary_entity_level_code, A.alert_description, A.create_date, A.alert_risk_score, S.scenario_name, A.alert_status_code, A.process_id, A.actual_values_text, S.SCENARIO_CATEGORY_DESC, A.primary_entity_number, A.scenario_id, A.primary_entity_key FROM (FSK_ALERT AS A LEFT OUTER JOIN FSK_SCENARIO AS S ON A.scenario_id = S.scenario_id) INNER JOIN FSC_ACCOUNT_DIM AS C ON (A.primary_entity_key = C.ACCOUNT_KEY AND S.current_ind = 'Y' OR S.current_ind IS NULL) WHERE (A.primary_entity_level_code = 'ACC') AND (C.ACCOUNT_KEY = 23923) AND (A.logical_delete_ind = 'N')"); //$NON-NLS-1$
}
@Test public void testFunctionInGroupBy() throws Exception {
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcedureRelational.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcedureRelational.java 2010-04-07 03:29:59 UTC (rev 2031)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcedureRelational.java 2010-04-07 14:57:01 UTC (rev 2032)
@@ -548,7 +548,7 @@
//virtual group with procedure in transformation
@Test public void testCase6395ProcAsVirtualGroup9(){
- String sql = "SELECT P.e2 as ve3, P.e1 as ve4 FROM pm1.vsp47 as P where param1=1 and param2='a' OPTION DEBUG"; //$NON-NLS-1$
+ String sql = "SELECT P.e2 as ve3, P.e1 as ve4 FROM pm1.vsp47 as P where param1=1 and param2='a'"; //$NON-NLS-1$
// Create expected results
List[] expected = new List[] {
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2010-04-07 03:29:59 UTC (rev 2031)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2010-04-07 14:57:01 UTC (rev 2032)
@@ -155,11 +155,6 @@
helpExecute(sql, "a", 1, true); //$NON-NLS-1$
}
- @Test public void testPlanOnly() throws Exception {
- String sql = "SELECT * FROM BQT1.SmallA option planonly"; //$NON-NLS-1$
- helpExecute(sql,"a"); //$NON-NLS-1$
- }
-
/**
* Tests whether an exception result is sent when an exception occurs
* @since 4.3
14 years, 8 months