teiid SVN: r3094 - in trunk: common-core/src/test/java/org/teiid/core/types and 1 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-04-15 14:12:29 -0400 (Fri, 15 Apr 2011)
New Revision: 3094
Modified:
trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java
trunk/connectors/translator-olap/src/main/java/org/teiid/translator/olap/OlapQueryExecution.java
Log:
TEIID-1011: adding the conversion between the Object[] and Object acceptable. Also returning the results as Object[] from the OLAP Execution factory.
Modified: trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2011-04-15 13:59:42 UTC (rev 3093)
+++ trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2011-04-15 18:12:29 UTC (rev 3094)
@@ -772,7 +772,7 @@
@SuppressWarnings("unchecked")
public static <T> T transformValue(Object value, Class sourceType,
Class<T> targetClass) throws TransformationException {
- if (value == null || sourceType == targetClass) {
+ if (value == null || sourceType == targetClass || DefaultDataClasses.OBJECT == targetClass) {
return (T) value;
}
Transform transform = DataTypeManager.getTransform(sourceType,
Modified: trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java 2011-04-15 13:59:42 UTC (rev 3093)
+++ trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java 2011-04-15 18:12:29 UTC (rev 3094)
@@ -222,4 +222,9 @@
assertEquals("hello", DataTypeManager.transformValue(new Foo(), DataTypeManager.DefaultDataClasses.STRING)); //$NON-NLS-1$
}
+ @SuppressWarnings("unchecked")
+ @Test public void testObjectArrayToObject() throws Exception {
+ Object[] value = {1,2};
+ assertArrayEquals(value, (Object[])DataTypeManager.transformValue(value, value.getClass(), DataTypeManager.DefaultDataClasses.OBJECT));
+ }
}
Modified: trunk/connectors/translator-olap/src/main/java/org/teiid/translator/olap/OlapQueryExecution.java
===================================================================
--- trunk/connectors/translator-olap/src/main/java/org/teiid/translator/olap/OlapQueryExecution.java 2011-04-15 13:59:42 UTC (rev 3093)
+++ trunk/connectors/translator-olap/src/main/java/org/teiid/translator/olap/OlapQueryExecution.java 2011-04-15 18:12:29 UTC (rev 3094)
@@ -22,7 +22,7 @@
package org.teiid.translator.olap;
import java.sql.SQLException;
-import java.util.Arrays;
+import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
@@ -126,8 +126,10 @@
for (Position colPos : cols) {
Cell cell = cellSet.getCell(colPos, nextRow);
result[i++] = cell.getValue();
- }
- return Arrays.asList(result);
+ }
+ ArrayList<Object[]> results = new ArrayList<Object[]>();
+ results.add(result);
+ return results;
}
@Override
14 years, 9 months
teiid SVN: r3093 - in trunk/engine/src: test/java/org/teiid/query/optimizer and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-04-15 09:59:42 -0400 (Fri, 15 Apr 2011)
New Revision: 3093
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestSortOptimization.java
Log:
TEIID-1554 fix for npe with order by project optimization
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java 2011-04-15 01:56:17 UTC (rev 3092)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanSorts.java 2011-04-15 13:59:42 UTC (rev 3093)
@@ -272,9 +272,17 @@
}
if (raiseAccess) {
PlanNode accessNode = node.getFirstChild();
- root = RuleRaiseAccess.raiseAccessNode(root, accessNode, metadata, capFinder, true, record);
- if (accessNode.getParent().getType() == NodeConstants.Types.TUPLE_LIMIT) {
- root = RulePushLimit.raiseAccessOverLimit(root, accessNode, metadata, capFinder, accessNode.getParent());
+ //instead of just calling ruleraiseaccess, we're more selective
+ //we do not want to raise the access node over a project that is handling an unrelated sort
+ PlanNode newRoot = RuleRaiseAccess.raiseAccessNode(root, accessNode, metadata, capFinder, true, record);
+ if (newRoot != null) {
+ root = newRoot;
+ if (accessNode.getParent().getType() == NodeConstants.Types.TUPLE_LIMIT) {
+ newRoot = RulePushLimit.raiseAccessOverLimit(root, accessNode, metadata, capFinder, accessNode.getParent());
+ }
+ if (newRoot != null) {
+ root = newRoot;
+ }
}
}
return root;
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestSortOptimization.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestSortOptimization.java 2011-04-15 01:56:17 UTC (rev 3092)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestSortOptimization.java 2011-04-15 13:59:42 UTC (rev 3093)
@@ -204,6 +204,14 @@
new String[] {"SELECT g_0.e1 AS c_0, g_0.e2 AS c_1 FROM pm1.g1 AS g_0 ORDER BY c_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
}
+ @Test public void testProjectionRaisingWithAccessAndLimit() throws Exception {
+ // Create query
+ String sql = "select e1, (select e1 from pm2.g1 where e2 = x.e2) as z from pm1.g1 as x order by e1 limit 1"; //$NON-NLS-1$
+
+ helpPlan(sql, FakeMetadataFactory.example1Cached(), null, TestOptimizer.getGenericFinder(),
+ new String[] {"SELECT g_0.e1 AS c_0, g_0.e2 AS c_1 FROM pm1.g1 AS g_0 ORDER BY c_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ }
+
@Test public void testProjectionRaisingForUnrelatedWithLimit() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
14 years, 9 months
teiid SVN: r3092 - in trunk/common-core/src: test/java/org/teiid/core/types and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-04-14 21:56:17 -0400 (Thu, 14 Apr 2011)
New Revision: 3092
Modified:
trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java
Log:
TEIID-1538 adding the catch all object to string conversion
Modified: trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2011-04-15 01:43:34 UTC (rev 3091)
+++ trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2011-04-15 01:56:17 UTC (rev 3092)
@@ -691,6 +691,13 @@
DataTypeManager.addTransform(new NullToAnyTransform(type));
}
}
+
+ DataTypeManager.addTransform(new AnyToStringTransform(DefaultDataClasses.OBJECT) {
+ @Override
+ public boolean isExplicit() {
+ return true;
+ }
+ });
}
Modified: trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java 2011-04-15 01:43:34 UTC (rev 3091)
+++ trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java 2011-04-15 01:56:17 UTC (rev 3092)
@@ -32,6 +32,7 @@
import org.junit.Test;
+@SuppressWarnings("nls")
public class TestDataTypeManager {
private void helpDetermineDataType(Object value, Class<?> expectedClass) {
@@ -206,9 +207,19 @@
DataTypeManager.DefaultDataTypes.OBJECT), DataTypeManager.getImplicitConversions(DataTypeManager.DefaultDataTypes.INTEGER));
}
- @SuppressWarnings("unchecked")
@Test(expected=TransformationException.class) public void testStringToXML() throws Exception {
DataTypeManager.transformValue("hello", DataTypeManager.DefaultDataClasses.XML); //$NON-NLS-1$
}
+ static class Foo {
+ @Override
+ public String toString() {
+ return "hello";
+ }
+ }
+
+ @Test public void testObjectToString() throws Exception {
+ assertEquals("hello", DataTypeManager.transformValue(new Foo(), DataTypeManager.DefaultDataClasses.STRING)); //$NON-NLS-1$
+ }
+
}
14 years, 9 months
teiid SVN: r3091 - in trunk: test-integration/common/src/test/java/org/teiid/transport and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-04-14 21:43:34 -0400 (Thu, 14 Apr 2011)
New Revision: 3091
Added:
trunk/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java
trunk/test-integration/common/src/test/resources/TestJDBCSocketTransport/
trunk/test-integration/common/src/test/resources/TestJDBCSocketTransport/testSelect.expected
Modified:
trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
Log:
TEIID-1536 fixing the regression with synch query execution
Modified: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-04-14 16:19:52 UTC (rev 3090)
+++ trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-04-15 01:43:34 UTC (rev 3091)
@@ -526,16 +526,32 @@
final RequestMessage reqMessage = createRequestMessage(commands, isBatchedCommand, resultsMode);
reqMessage.setSync(synch);
- ResultsFuture<Boolean> result = execute(reqMessage);
+ ResultsFuture<ResultsMessage> pendingResult = execute(reqMessage, synch);
+ final ResultsFuture<Boolean> result = new ResultsFuture<Boolean>();
+ pendingResult.addCompletionListener(new ResultsFuture.CompletionListener<ResultsMessage>() {
+ @Override
+ public void onCompletion(ResultsFuture<ResultsMessage> future) {
+ try {
+ postReceiveResults(reqMessage, future.get());
+ result.getResultsReceiver().receiveResults(hasResultSet());
+ } catch (Throwable t) {
+ result.getResultsReceiver().exceptionOccurred(t);
+ }
+ }
+ });
if (synch) {
try {
if (queryTimeoutMS > 0) {
- result.get(queryTimeoutMS, TimeUnit.MILLISECONDS);
+ pendingResult.get(queryTimeoutMS, TimeUnit.MILLISECONDS);
} else {
- result.get();
+ pendingResult.get();
}
+ result.get(); //throw an exception if needed
return result;
} catch (ExecutionException e) {
+ if (e.getCause() instanceof SQLException) {
+ throw (SQLException)e.getCause();
+ }
throw TeiidSQLException.create(e);
} catch (InterruptedException e) {
timeoutOccurred();
@@ -547,7 +563,7 @@
return result;
}
- private ResultsFuture<Boolean> execute(final RequestMessage reqMsg) throws SQLException,
+ private ResultsFuture<ResultsMessage> execute(final RequestMessage reqMsg, boolean synch) throws SQLException,
TeiidSQLException {
this.getConnection().beginLocalTxnIfNeeded();
this.currentRequestID = this.driverConnection.nextRequestID();
@@ -564,7 +580,7 @@
reqMsg.setExecutionId(this.currentRequestID);
ResultsFuture.CompletionListener<ResultsMessage> compeletionListener = null;
- if (queryTimeoutMS > 0) {
+ if (queryTimeoutMS > 0 && !synch) {
final CancelTask c = new QueryTimeoutCancelTask(queryTimeoutMS, this);
cancellationTimer.add(c);
compeletionListener = new ResultsFuture.CompletionListener<ResultsMessage>() {
@@ -584,19 +600,7 @@
if (compeletionListener != null) {
pendingResult.addCompletionListener(compeletionListener);
}
- final ResultsFuture<Boolean> result = new ResultsFuture<Boolean>();
- pendingResult.addCompletionListener(new ResultsFuture.CompletionListener<ResultsMessage>() {
- @Override
- public void onCompletion(ResultsFuture<ResultsMessage> future) {
- try {
- postReceiveResults(reqMsg, future.get());
- result.getResultsReceiver().receiveResults(hasResultSet());
- } catch (Throwable t) {
- result.getResultsReceiver().exceptionOccurred(t);
- }
- }
- });
- return result;
+ return pendingResult;
}
public static ResultsFuture<Boolean> booleanFuture(boolean isTrue) {
Added: trunk/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java (rev 0)
+++ trunk/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java 2011-04-15 01:43:34 UTC (rev 3091)
@@ -0,0 +1,93 @@
+/*
+ * 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.transport;
+
+import static org.junit.Assert.*;
+
+import java.net.InetSocketAddress;
+import java.sql.Connection;
+import java.sql.Statement;
+import java.util.Properties;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.teiid.common.buffer.BufferManagerFactory;
+import org.teiid.core.util.UnitTestUtil;
+import org.teiid.jdbc.FakeServer;
+import org.teiid.jdbc.TeiidDriver;
+import org.teiid.jdbc.TestMMDatabaseMetaData;
+
+@SuppressWarnings("nls")
+public class TestJDBCSocketTransport {
+
+ static InetSocketAddress addr;
+ static SocketListener jdbcTransport;
+
+ @BeforeClass public static void oneTimeSetup() throws Exception {
+ SocketConfiguration config = new SocketConfiguration();
+ config.setSSLConfiguration(new SSLConfiguration());
+ addr = new InetSocketAddress(0);
+ config.setBindAddress(addr.getHostName());
+ config.setPortNumber(0);
+
+ FakeServer server = new FakeServer();
+ server.setUseCallingThread(false);
+ server.deployVDB("parts", UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
+
+ jdbcTransport = new SocketListener(config, server, BufferManagerFactory.getStandaloneBufferManager(), 0);
+ }
+
+ @AfterClass public static void oneTimeTearDown() throws Exception {
+ if (jdbcTransport != null) {
+ jdbcTransport.stop();
+ }
+ }
+
+ Connection conn;
+
+ @Before public void setUp() throws Exception {
+ Properties p = new Properties();
+ p.setProperty("user", "testuser");
+ p.setProperty("password", "testpassword");
+ conn = TeiidDriver.getInstance().connect("jdbc:teiid:parts@mm://"+addr.getHostName()+":" +jdbcTransport.getPort(), p);
+ }
+
+ @After public void tearDown() throws Exception {
+ if (conn != null) {
+ conn.close();
+ }
+ }
+
+ /**
+ * Under the covers this still executes a prepared statement due to the driver handling
+ */
+ @Test public void testSelect() throws Exception {
+ Statement s = conn.createStatement();
+ assertTrue(s.execute("select * from tables order by name"));
+ TestMMDatabaseMetaData.compareResultSet(s.getResultSet());
+ }
+
+}
Property changes on: trunk/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/test-integration/common/src/test/resources/TestJDBCSocketTransport/testSelect.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestJDBCSocketTransport/testSelect.expected (rev 0)
+++ trunk/test-integration/common/src/test/resources/TestJDBCSocketTransport/testSelect.expected 2011-04-15 01:43:34 UTC (rev 3091)
@@ -0,0 +1,48 @@
+string string string string string boolean boolean string integer string boolean boolean integer
+VDBName SchemaName Name Type NameInSource IsPhysical SupportsUpdates UID Cardinality Description IsSystem IsMaterialized OID
+parts SYS Columns Table <null> true false mmuuid:1c9a5cb2-17b1-4e4a-8b0e-3a42bd052509 0 <null> true false 8
+parts SYS DataTypes Table <null> true false mmuuid:9a8794f9-66f8-49e8-8576-89d212d0f957 0 <null> true false 9
+parts SYS KeyColumns Table <null> true false mmuuid:14946083-3bd5-42d5-8283-1c0694347c29 0 <null> true false 10
+parts SYS Keys Table <null> true false mmuuid:1e5135dc-ce5d-4b25-a8ff-63f5440b3108 0 <null> true false 11
+parts SYSADMIN MatViews Table <null> true false mmuuid:520ba1e8-3553-460f-8d18-9b43f089e256 0 <null> true false 6
+parts PartsSupplier PARTSSUPPLIER.PARTS Table PARTS true true mmuuid:f6276601-73fe-1edc-a81c-ecf397b10590 16 <null> false false 1
+parts PartsSupplier PARTSSUPPLIER.SHIP_VIA Table SHIP_VIA true true mmuuid:0f4e9b80-73ff-1edc-a81c-ecf397b10590 4 <null> false false 2
+parts PartsSupplier PARTSSUPPLIER.STATUS Table STATUS true true mmuuid:1f297200-73ff-1edc-a81c-ecf397b10590 3 <null> false false 3
+parts PartsSupplier PARTSSUPPLIER.SUPPLIER Table SUPPLIER true true mmuuid:2c371ec0-73ff-1edc-a81c-ecf397b10590 16 <null> false false 5
+parts PartsSupplier PARTSSUPPLIER.SUPPLIER_PARTS Table SUPPLIER_PARTS true true mmuuid:3deafb00-73ff-1edc-a81c-ecf397b10590 227 <null> false false 4
+parts SYS ProcedureParams Table <null> true false mmuuid:a56bd7fe-c87a-411c-8f5d-661975a25626 0 <null> true false 12
+parts SYS Procedures Table <null> true false mmuuid:0bc132a5-9f8d-4a3c-9f5d-98156a98a962 0 <null> true false 13
+parts SYS Properties Table <null> true false mmuuid:7a45e50a-d03f-4548-ba35-761651bbca85 0 <null> true false 14
+parts SYS ReferenceKeyColumns Table <null> true false mmuuid:6a9653e8-a337-41b2-86fa-77b98f409a29 0 <null> true false 15
+parts SYS Schemas Table <null> true false mmuuid:8648a554-b2ad-4e8e-84ca-2ec618b311a9 0 <null> true false 16
+parts SYS Tables Table <null> true false mmuuid:8551b3bd-11cc-4049-9bcf-fe91a0eb7ba7 0 <null> true false 17
+parts SYSADMIN VDBResources Table <null> true false mmuuid:1785804d-beaf-4831-9531-e59164fedd49 0 <null> true false 7
+parts SYS VirtualDatabases Table <null> true false mmuuid:47297c72-d621-4f4e-af4e-74060ac5f489 0 <null> true false 18
+parts pg_catalog matpg_datatype Table <null> false false mmuid:17448311-6679-4dfd-aeb6-4aabbd894729 0 <null> true true 31
+parts pg_catalog matpg_relatt Table <null> false false mmuid:8c0714d6-1c72-40b4-8528-3b2c63059107 0 <null> true true 30
+parts pg_catalog pg_am Table <null> false false mmuid:f6517a63-8c14-4b73-a18d-afaa5dfb35d9 0 <null> true false 24
+parts pg_catalog pg_attrdef Table <null> false false mmuid:76a7dd05-9a7d-4243-b561-f3056500dcaf 0 <null> true false 27
+parts pg_catalog pg_attribute Table <null> false false mmuid:fa463d98-365f-489a-a707-025193cb51eb 0 <null> true true 21
+parts pg_catalog pg_class Table <null> false false mmuid:7e21f2e6-06e3-4bca-9b01-72ea47821560 0 <null> true true 20
+parts pg_catalog pg_database Table <null> false false mmuid:382f9fc9-8c96-4df7-ab5d-04dfb47ee142 0 <null> true false 28
+parts pg_catalog pg_index Table <null> false false mmuid:09daed8d-b0b8-4552-a261-2b6c775b46b0 0 <null> true true 23
+parts pg_catalog pg_namespace Table <null> false false mmuid:6609866a-3d7b-4f4b-95fe-ebfac769d699 0 <null> true false 19
+parts pg_catalog pg_proc Table <null> false false mmuid:f20c9489-10ca-4596-8a37-24218b67f764 0 <null> true true 25
+parts pg_catalog pg_trigger Table <null> false false mmuid:2b75f0b1-7475-4ed5-9da3-d37a8a25f26a 0 <null> true false 26
+parts pg_catalog pg_type Table <null> false false mmuid:9462e3f8-cd3c-414f-a570-f6f33c40e36a 0 <null> true false 22
+parts pg_catalog pg_user Table <null> false false mmuid:e63613cb-01ee-4b37-8b91-99d1aac4dfcb 0 <null> true false 29
+Row Count : 31
+getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
+VDBName 12 parts java.lang.String VDBName string SYS Tables 255 255 0 false true false true 1 false true true true
+SchemaName 12 parts java.lang.String SchemaName string SYS Tables 255 255 0 false true false true 1 false true true true
+Name 12 parts java.lang.String Name string SYS Tables 255 255 0 false true false false 0 true true false false
+Type 12 parts java.lang.String Type string SYS Tables 20 20 0 false false false false 0 true true false false
+NameInSource 12 parts java.lang.String NameInSource string SYS Tables 255 255 0 false true false false 1 true true false false
+IsPhysical -7 parts java.lang.Boolean IsPhysical boolean SYS Tables 5 1 0 false true false false 0 true true false false
+SupportsUpdates -7 parts java.lang.Boolean SupportsUpdates boolean SYS Tables 5 1 0 false false false false 0 true true false false
+UID 12 parts java.lang.String UID string SYS Tables 50 50 0 false false false false 0 true true false false
+Cardinality 4 parts java.lang.Integer Cardinality integer SYS Tables 11 10 0 false true false false 0 true true true false
+Description 12 parts java.lang.String Description string SYS Tables 255 255 0 false true false true 1 false true true true
+IsSystem -7 parts java.lang.Boolean IsSystem boolean SYS Tables 5 1 0 false true false true 1 false true true true
+IsMaterialized -7 parts java.lang.Boolean IsMaterialized boolean SYS Tables 5 1 0 false false false true 0 false true false true
+OID 4 parts java.lang.Integer OID integer SYS Tables 11 10 0 false false false false 0 true true false false
14 years, 9 months
teiid SVN: r3090 - in trunk/engine/src/main/java/org/teiid: query/function/aggregate and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-04-14 12:19:52 -0400 (Thu, 14 Apr 2011)
New Revision: 3090
Modified:
trunk/engine/src/main/java/org/teiid/common/buffer/FileStore.java
trunk/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java
trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java
Log:
TEIID-1556 better handling for xmlagg and reducing the memory held by associated buffers
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/FileStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/FileStore.java 2011-04-13 20:34:39 UTC (rev 3089)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/FileStore.java 2011-04-14 16:19:52 UTC (rev 3090)
@@ -27,6 +27,7 @@
import java.io.OutputStream;
import java.lang.ref.PhantomReference;
import java.lang.ref.ReferenceQueue;
+import java.util.Arrays;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.Set;
@@ -46,6 +47,7 @@
private byte[] buffer;
private int count;
private boolean bytesWritten;
+ private boolean closed;
public FileStoreOutputStream(int size) {
this.buffer = new byte[size];
@@ -58,6 +60,7 @@
@Override
public void write(byte[] b, int off, int len) throws IOException {
+ checkOpen();
if (len > buffer.length) {
flushBuffer();
writeDirect(b, off, len);
@@ -86,12 +89,18 @@
}
public void flushBuffer() throws IOException {
+ checkOpen();
if (count > 0) {
writeDirect(buffer, 0, count);
count = 0;
}
}
+ /**
+ * Return the buffer. Can be null if closed and the underlying filestore
+ * has been writen to.
+ * @return
+ */
public byte[] getBuffer() {
return buffer;
}
@@ -114,8 +123,21 @@
@Override
public void close() throws IOException {
flush();
+ closed = true;
+ if (bytesWritten) {
+ this.buffer = null;
+ } else {
+ //truncate
+ this.buffer = Arrays.copyOf(this.buffer, this.count);
+ }
}
+ private void checkOpen() {
+ if (closed) {
+ throw new IllegalStateException("Alread closed"); //$NON-NLS-1$
+ }
+ }
+
}
static class CleanupReference extends PhantomReference<Object> {
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java 2011-04-13 20:34:39 UTC (rev 3089)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java 2011-04-14 16:19:52 UTC (rev 3090)
@@ -59,10 +59,20 @@
return lobBuffer.getLength();
}
+ /**
+ * Returns a new writer instance that is backed by the shared output stream.
+ * Closing a writer will prevent further writes.
+ * @return
+ */
public Writer getWriter() {
return new OutputStreamWriter(getOuputStream(), Charset.forName(encoding));
}
+ /**
+ * The returned output stream is shared among all uses.
+ * Once closed no further writing can occur
+ * @return
+ */
public FileStoreOutputStream getOuputStream() {
if (fsos == null) {
fsos = lobBuffer.createOutputStream(DataTypeManager.MAX_LOB_MEMORY_BYTES);
@@ -77,6 +87,6 @@
@Override
public boolean isPersistent() {
- return true;
+ return fsos == null || fsos.bytesWritten();
}
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java 2011-04-13 20:34:39 UTC (rev 3089)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java 2011-04-14 16:19:52 UTC (rev 3090)
@@ -72,7 +72,7 @@
}
}, textLine.getDelimiter(), textLine.getQuote()));
}
- w.close();
+ w.flush();
return fisf;
} catch (IOException e) {
throw new TeiidProcessingException(e);
@@ -96,7 +96,7 @@
String in = (String)input;
Writer w = result.getWriter();
w.write(in);
- w.close();
+ w.flush();
} catch (IOException e) {
throw new TeiidProcessingException(e);
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java 2011-04-13 20:34:39 UTC (rev 3089)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java 2011-04-14 16:19:52 UTC (rev 3090)
@@ -27,7 +27,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.XMLType;
-import org.teiid.query.function.source.XMLSystemFunctions;
+import org.teiid.query.function.source.XMLSystemFunctions.XmlConcat;
import org.teiid.query.util.CommandContext;
/**
@@ -35,7 +35,8 @@
*/
public class XMLAgg extends AggregateFunction {
- private XMLType result;
+ private XMLType result;
+ private XmlConcat concat;
private CommandContext context;
public XMLAgg(CommandContext context) {
@@ -43,7 +44,8 @@
}
public void reset() {
- result = null;
+ concat = null;
+ result = null;
}
/**
@@ -52,13 +54,25 @@
* @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(Object, List)
*/
public void addInputDirect(Object input, List<?> tuple) throws TeiidComponentException, TeiidProcessingException {
- result = XMLSystemFunctions.xmlConcat(context, result, input);
+ if (concat == null) {
+ concat = new XmlConcat(context.getBufferManager());
+ }
+ concat.addValue(input);
}
/**
+ * @throws TeiidProcessingException
+ * @throws TeiidComponentException
* @see org.teiid.query.function.aggregate.AggregateFunction#getResult()
*/
- public Object getResult() {
+ public Object getResult() throws TeiidComponentException, TeiidProcessingException {
+ if (result == null) {
+ if (concat == null) {
+ return null;
+ }
+ result = concat.close();
+ concat = null;
+ }
return result;
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java 2011-04-13 20:34:39 UTC (rev 3089)
+++ trunk/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java 2011-04-14 16:19:52 UTC (rev 3090)
@@ -386,27 +386,67 @@
return singleValue;
}
- XMLType result = new XMLType(XMLSystemFunctions.saveToBufferManager(context.getBufferManager(), new XMLTranslator() {
-
- @Override
- public void translate(Writer writer) throws TransformerException,
- IOException {
- try {
- XMLOutputFactory factory = getOutputFactory();
- XMLEventWriter eventWriter = factory.createXMLEventWriter(writer);
- XMLEventFactory eventFactory = XMLEventFactory.newInstance();
- convertValue(writer, eventWriter, eventFactory, xml);
- for (Object object : other) {
- convertValue(writer, eventWriter, eventFactory, object);
- }
- eventWriter.flush(); //woodstox needs a flush rather than a close
- } catch (XMLStreamException e) {
- throw new TransformerException(e);
- }
+ XmlConcat concat = new XmlConcat(context.getBufferManager());
+ concat.addValue(xml);
+ for (Object object : other) {
+ concat.addValue(object);
+ }
+ return concat.close();
+ }
+
+ public static class XmlConcat {
+ private XMLOutputFactory factory;
+ private XMLEventWriter eventWriter;
+ private XMLEventFactory eventFactory;
+ private Writer writer;
+ private FileStoreInputStreamFactory fsisf;
+ private FileStore fs;
+
+ public XmlConcat(BufferManager bm) throws TeiidProcessingException {
+ fs = bm.createFileStore("xml"); //$NON-NLS-1$
+ fsisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING);
+ writer = fsisf.getWriter();
+ factory = getOutputFactory();
+ try {
+ eventWriter = factory.createXMLEventWriter(writer);
+ } catch (XMLStreamException e) {
+ fs.remove();
+ throw new TeiidProcessingException(e);
}
- }));
- result.setType(Type.CONTENT);
- return result;
+ eventFactory = XMLEventFactory.newInstance();
+ }
+
+ public void addValue(Object object) throws TeiidProcessingException {
+ try {
+ convertValue(writer, eventWriter, eventFactory, object);
+ } catch (IOException e) {
+ fs.remove();
+ throw new TeiidProcessingException(e);
+ } catch (XMLStreamException e) {
+ fs.remove();
+ throw new TeiidProcessingException(e);
+ } catch (TransformerException e) {
+ fs.remove();
+ throw new TeiidProcessingException(e);
+ }
+ }
+
+ public XMLType close() throws TeiidProcessingException {
+ try {
+ eventWriter.flush();
+ writer.close();
+ } catch (XMLStreamException e) {
+ fs.remove();
+ throw new TeiidProcessingException(e);
+ } catch (IOException e) {
+ fs.remove();
+ throw new TeiidProcessingException(e);
+ }
+ XMLType result = new XMLType(new SQLXMLImpl(fsisf));
+ result.setType(Type.CONTENT);
+ return result;
+ }
+
}
private static XMLOutputFactory getOutputFactory() throws FactoryConfigurationError {
14 years, 9 months
teiid SVN: r3089 - in trunk: api/src/main/java/org/teiid/events and 15 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-04-13 16:34:39 -0400 (Wed, 13 Apr 2011)
New Revision: 3089
Added:
trunk/api/src/main/java/org/teiid/events/
Removed:
trunk/engine/src/main/java/org/teiid/events/
Modified:
trunk/api/src/main/java/org/teiid/events/EventDistributor.java
trunk/cache-jbosscache/pom.xml
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java
trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataID.java
trunk/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java
trunk/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/BatchedUpdateCommand.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java
trunk/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestBatchedUpdateNode.java
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java
Log:
TEIID-1507 refining previous check-in and adding detection of local data change events
Modified: trunk/api/src/main/java/org/teiid/events/EventDistributor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/events/EventDistributor.java 2011-04-12 23:20:51 UTC (rev 3084)
+++ trunk/api/src/main/java/org/teiid/events/EventDistributor.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -24,8 +24,41 @@
import java.util.List;
+/**
+ * Distributes events across the Teiid cluster
+ */
public interface EventDistributor {
+
+ /**
+ * Update the given materialized view row using the internal mat view name #MAT_VIEWFQN.
+ * The tuple is expected to be in table order, which has the primary key first.
+ * Deletes need to only send the key, not the entire row contents.
+ *
+ * @param vdbName
+ * @param vdbVersion
+ * @param matViewFqn
+ * @param tuple
+ * @param delete
+ */
void updateMatViewRow(String vdbName, int vdbVersion, String matViewFqn, List<?> tuple, boolean delete);
- void schemaModification(String vdbName, int vdbVersion, String fqn);
- void dataModification(String vdbName, int vdbVersion, String tableFqn);
+
+ /**
+ * Notify that the metadata has been changed for the given fqns.
+ * A fqn has the form schema.entityname.
+ * This typically implies that the costing metadata has changed, but may also indicate
+ * a view definition has changed.
+ * @param vdbName
+ * @param vdbVersion
+ * @param fqns
+ */
+ void schemaModification(String vdbName, int vdbVersion, String... fqns);
+
+ /**
+ * Notify that the table data has changed.
+ * A table fqn has the form schema.tablename.
+ * @param vdbName
+ * @param vdbVersion
+ * @param tableFqns
+ */
+ void dataModification(String vdbName, int vdbVersion, String... tableFqns);
}
Modified: trunk/cache-jbosscache/pom.xml
===================================================================
--- trunk/cache-jbosscache/pom.xml 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/cache-jbosscache/pom.xml 2011-04-13 20:34:39 UTC (rev 3089)
@@ -14,7 +14,12 @@
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-common-core</artifactId>
<scope>provided</scope>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-engine</artifactId>
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2011-04-13 20:34:39 UTC (rev 3089)
@@ -330,7 +330,11 @@
<c:simple-property name="RuntimeEngineDeployer.useDataRoles"
displayName="Data Roles Enabled"
description="Turn on role checking of resources based on the roles defined in VDB (default true)"
- required="false" readOnly="false" />
+ required="false" readOnly="false" />
+ <c:simple-property name="RuntimeEngineDeployer.detectingChangeEvents"
+ displayName="Detecting Change Events"
+ description="Set to true for the engine to detect local change events. Should be disabled if using external change data capture tools. (default true)"
+ required="false" readOnly="false" />
</c:group>
<c:group name="ResultSetCacheConfig" displayName="ResultSet Cache Properties" hiddenByDefault="false">
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -171,7 +171,7 @@
}
} else if (o instanceof TempMetadataID) {
TempMetadataID tid = (TempMetadataID)o;
- if (tid.getTableData().getLastModified() - modTime > this.creationTime) {
+ if ((data?tid.getTableData().getLastDataModification():tid.getTableData().getLastModified()) - modTime > this.creationTime) {
return false;
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -55,6 +55,7 @@
private CacheConfiguration preparedPlanCacheConfig = new CacheConfiguration();
private int maxODBCLobSizeAllowed = 5*1024*1024; // 5 MB
private int userRequestSourceConcurrency = DEFAULT_USER_REQUEST_SOURCE_CONCURRENCY;
+ private boolean detectingChangeEvents = true;
private transient AuthorizationValidator authorizationValidator;
private transient MetadataProvider metadataProvider;
@@ -231,4 +232,13 @@
this.preparedPlanCacheConfig = preparedPlanCacheConfig;
}
+ public boolean isDetectingChangeEvents() {
+ return detectingChangeEvents;
+ }
+
+ @ManagementProperty(description="Set to true for the engine to detect local change events. Should be disabled if using external change data capture tools. (default true)")
+ public void setDetectingChangeEvents(boolean detectingChangeEvents) {
+ this.detectingChangeEvents = detectingChangeEvents;
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -715,7 +715,7 @@
matTables.setBufferManager(this.bufferManager);
}
- dataTierMgr = new TempTableDataManager(new DataTierManagerImpl(this,this.bufferService), this.bufferManager, this.processWorkerPool, this.rsCache, this.matTables, this.cacheFactory);
+ dataTierMgr = new TempTableDataManager(new DataTierManagerImpl(this,this.bufferService, this.config.isDetectingChangeEvents()), this.bufferManager, this.processWorkerPool, this.rsCache, this.matTables, this.cacheFactory);
}
public void setBufferService(BufferService service) {
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 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -52,6 +52,7 @@
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.RequestID;
import org.teiid.dqp.service.BufferService;
+import org.teiid.events.EventDistributor;
import org.teiid.metadata.AbstractMetadataRecord;
import org.teiid.metadata.Column;
import org.teiid.metadata.Datatype;
@@ -110,12 +111,27 @@
// Resources
private DQPCore requestMgr;
private BufferService bufferService;
+ private EventDistributor eventDistributor;
+ private boolean detectChangeEvents;
- public DataTierManagerImpl(DQPCore requestMgr, BufferService bufferService) {
+ public DataTierManagerImpl(DQPCore requestMgr, BufferService bufferService, boolean detectChangeEvents) {
this.requestMgr = requestMgr;
this.bufferService = bufferService;
+ this.detectChangeEvents = detectChangeEvents;
}
+ public boolean detectChangeEvents() {
+ return detectChangeEvents;
+ }
+
+ public void setEventDistributor(EventDistributor eventDistributor) {
+ this.eventDistributor = eventDistributor;
+ }
+
+ public EventDistributor getEventDistributor() {
+ return eventDistributor;
+ }
+
public TupleSource registerRequest(CommandContext context, Command command, String modelName, String connectorBindingId, int nodeID, int limit) throws TeiidComponentException, TeiidProcessingException {
RequestWorkItem workItem = requestMgr.getRequestWorkItem((RequestID)context.getProcessorID());
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -23,6 +23,7 @@
package org.teiid.dqp.internal.process;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
@@ -56,7 +57,13 @@
import org.teiid.dqp.internal.process.DQPCore.FutureWork;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.AtomicResultsMessage;
+import org.teiid.metadata.Table;
import org.teiid.query.function.source.XMLSystemFunctions;
+import org.teiid.query.processor.relational.RelationalNodeUtil;
+import org.teiid.query.sql.lang.BatchedUpdateCommand;
+import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.lang.ProcedureContainer;
+import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.TranslatorException;
@@ -133,7 +140,7 @@
}, this, 100);
}
- private List correctTypes(List row) throws TransformationException {
+ private List<?> correctTypes(List<Object> row) throws TransformationException {
//TODO: add a proper intermediate schema
for (int i = 0; i < row.size(); i++) {
Object value = row.get(i);
@@ -213,6 +220,25 @@
} else {
results = getResults();
}
+ //check for update events
+ if (index == 0 && this.dtm.detectChangeEvents()) {
+ Command command = aqr.getCommand();
+ ArrayList<String> updates = new ArrayList<String>();
+ int commandIndex = 0;
+ if (RelationalNodeUtil.isUpdate(command)) {
+ long ts = System.currentTimeMillis();
+ checkForUpdates(results, command, updates, commandIndex, ts);
+ } else if (command instanceof BatchedUpdateCommand) {
+ long ts = System.currentTimeMillis();
+ BatchedUpdateCommand bac = (BatchedUpdateCommand)command;
+ for (Command uc : bac.getUpdateCommands()) {
+ checkForUpdates(results, uc, updates, commandIndex++, ts);
+ }
+ }
+ if (this.dtm.getEventDistributor() != null && !updates.isEmpty()) {
+ this.dtm.getEventDistributor().dataModification(this.workItem.getDqpWorkContext().getVdbName(), this.workItem.getDqpWorkContext().getVdbVersion(), updates.toArray(new String[updates.size()]));
+ }
+ }
} catch (TranslatorException e) {
results = exceptionOccurred(e, true);
} catch (DataNotAvailableException e) {
@@ -241,6 +267,29 @@
}
}
+ private void checkForUpdates(AtomicResultsMessage results, Command command,
+ ArrayList<String> updates, int commandIndex, long ts) {
+ if (!RelationalNodeUtil.isUpdate(command) || !(command instanceof ProcedureContainer)) {
+ return;
+ }
+ ProcedureContainer pc = (ProcedureContainer)aqr.getCommand();
+ GroupSymbol gs = pc.getGroup();
+ Integer zero = Integer.valueOf(0);
+ if (results.getResults().length <= commandIndex || zero.equals(results.getResults()[commandIndex].get(0))) {
+ return;
+ }
+ Object metadataId = gs.getMetadataID();
+ if (metadataId == null) {
+ return;
+ }
+ if (!(metadataId instanceof Table)) {
+ return;
+ }
+ Table t = (Table)metadataId;
+ updates.add(t.getFullName());
+ t.setLastDataModification(ts);
+ }
+
private AtomicResultsMessage asynchGet()
throws BlockedException, TeiidProcessingException,
TeiidComponentException, TranslatorException {
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -45,6 +45,9 @@
this.result = new ArrayList<Object>();
}
this.result.add(input);
+ if (this.result.size() > 1000) {
+ throw new AssertionError("Exceeded the max allowable array size of 1000."); //$NON-NLS-1$
+ }
}
@Override
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataID.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataID.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataID.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -33,7 +33,6 @@
import org.teiid.query.sql.lang.CacheHint;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-
/**
* This class represents a temporary metadata ID. A temporary metadata ID
* does not exist in a real metadata source. Rather, it is used temporarily
@@ -48,6 +47,8 @@
private static final long serialVersionUID = -1879211827339120135L;
private static final int LOCAL_CACHE_SIZE = 8;
+ private static final int MOD_COUNT_FOR_COST_UPDATE = 8;
+
public static class TableData {
Collection<TempMetadataID> accessPatterns;
List<TempMetadataID> elements;
@@ -58,15 +59,31 @@
CacheHint cacheHint;
List<List<TempMetadataID>> keys;
List<List<TempMetadataID>> indexes;
+ long lastDataModification;
long lastModified;
+ int modCount;
+ public long getLastDataModification() {
+ return lastDataModification;
+ }
+
+ public void dataModified(int updateCount) {
+ if (updateCount == 0) {
+ return;
+ }
+ long ts = System.currentTimeMillis();
+ modCount += updateCount;
+ if (modCount > MOD_COUNT_FOR_COST_UPDATE) {
+ this.lastModified = ts;
+ modCount = 0;
+ }
+ this.lastDataModification = ts;
+ }
+
public long getLastModified() {
return lastModified;
}
- public void setLastModified(long lastModified) {
- this.lastModified = lastModified;
- }
}
private static TableData DUMMY_DATA = new TableData();
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -262,9 +262,9 @@
public boolean hasProcedure(String name) throws TeiidComponentException {
try {
- return getStoredProcedureInfoForProcedure(name) != null;
+ return getStoredProcInfoDirect(name) != null;
} catch (QueryMetadataException e) {
- return false;
+ return true;
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -26,6 +26,7 @@
import org.teiid.common.buffer.TupleSource;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.events.EventDistributor;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.util.CommandContext;
@@ -47,5 +48,7 @@
String keyElementName,
Object keyValue) throws BlockedException,
TeiidComponentException, TeiidProcessingException;
+
+ void setEventDistributor(EventDistributor ed);
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/BatchedUpdateCommand.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/BatchedUpdateCommand.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/BatchedUpdateCommand.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -23,10 +23,9 @@
package org.teiid.query.sql.lang;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
import java.util.List;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.util.VariableContext;
@@ -38,42 +37,13 @@
*/
public class BatchedUpdateCommand extends Command {
- protected List commands;
+ protected List<Command> commands;
private List<VariableContext> variableContexts; //processing state
- /**
- * Add sub command
- * @param command Additional sub-command
- */
- public void addSubCommand(Command command) {
- if(this.commands == null) {
- this.commands = new ArrayList();
- }
- this.commands.add(command);
- }
-
- /**
- * Add sub commands
- * @param commands Additional sub-commands
- */
- public void addSubCommands(Collection commands) {
- if(commands == null || commands.size() == 0) {
- return;
- }
-
- if(this.commands == null) {
- this.commands = new ArrayList();
- }
- this.commands.addAll(commands);
- }
-
/**
* @see org.teiid.query.sql.lang.Command#getSubCommands()
*/
- public List getSubCommands() {
- if(commands == null || commands.size() == 0) {
- return Collections.EMPTY_LIST;
- }
+ public List<Command> getSubCommands() {
return commands;
}
@@ -82,8 +52,8 @@
* @param updateCommands
* @since 4.2
*/
- public BatchedUpdateCommand(List updateCommands) {
- addSubCommands(updateCommands);
+ public BatchedUpdateCommand(List<? extends Command> updateCommands) {
+ this.commands = new ArrayList<Command>(updateCommands);
}
/**
@@ -91,7 +61,7 @@
* @return
* @since 4.2
*/
- public List getUpdateCommands() {
+ public List<Command> getUpdateCommands() {
return getSubCommands();
}
@@ -123,10 +93,7 @@
* @since 4.2
*/
public Object clone() {
- List clonedCommands = new ArrayList(commands.size());
- for (int i = 0; i < commands.size(); i++) {
- clonedCommands.add(((Command)commands.get(i)).clone());
- }
+ List<Command> clonedCommands = LanguageObject.Util.deepClone(this.commands, Command.class);
BatchedUpdateCommand copy = new BatchedUpdateCommand(clonedCommands);
copyMetadataState(copy);
return copy;
@@ -142,9 +109,9 @@
public String toString() {
StringBuffer val = new StringBuffer("BatchedUpdate{"); //$NON-NLS-1$
if (commands != null && commands.size() > 0) {
- val.append(getCommandToken((Command)commands.get(0)));
+ val.append(getCommandToken(commands.get(0)));
for (int i = 1; i < commands.size(); i++) {
- val.append(',').append(getCommandToken((Command)commands.get(i)));
+ val.append(',').append(getCommandToken(commands.get(i)));
}
}
val.append('}');
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -482,7 +482,7 @@
}
public int truncate() {
- this.tid.getTableData().setLastModified(System.currentTimeMillis());
+ this.tid.getTableData().dataModified(tree.getRowCount());
return tree.truncate();
}
@@ -513,7 +513,7 @@
UpdateProcessor up = new InsertUpdateProcessor(tuples, rowId != null, shouldProject?indexes:null);
int updateCount = up.process();
tid.setCardinality(tree.getRowCount());
- tid.getTableData().setLastModified(System.currentTimeMillis());
+ tid.getTableData().dataModified(updateCount);
return CollectionTupleSource.createUpdateCountTupleSource(updateCount);
}
@@ -579,9 +579,7 @@
};
int updateCount = up.process();
- if (updateCount > 0) {
- tid.getTableData().setLastModified(System.currentTimeMillis());
- }
+ tid.getTableData().dataModified(updateCount);
return CollectionTupleSource.createUpdateCountTupleSource(updateCount);
}
@@ -614,9 +612,7 @@
};
int updateCount = up.process();
tid.setCardinality(tree.getRowCount());
- if (updateCount > 0) {
- tid.getTableData().setLastModified(System.currentTimeMillis());
- }
+ tid.getTableData().dataModified(updateCount);
return CollectionTupleSource.createUpdateCountTupleSource(updateCount);
}
@@ -646,7 +642,7 @@
index.tree.remove(tuple);
}
}
- tid.getTableData().setLastModified(System.currentTimeMillis());
+ tid.getTableData().dataModified(1);
return result;
}
List<?> result = tree.insert(tuple, InsertMode.UPDATE, -1);
@@ -656,7 +652,7 @@
index.tree.insert(tuple, InsertMode.UPDATE, -1);
}
}
- tid.getTableData().setLastModified(System.currentTimeMillis());
+ tid.getTableData().dataModified(1);
return result;
} finally {
lock.writeLock().unlock();
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -161,6 +161,7 @@
public void setEventDistributor(EventDistributor eventDistributor) {
this.eventDistributor = eventDistributor;
+ this.processorDataManager.setEventDistributor(eventDistributor);
}
public TupleSource registerRequest(
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 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -37,6 +37,7 @@
import org.mockito.Mockito;
import org.teiid.CommandContext;
import org.teiid.api.exception.query.QueryResolverException;
+import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.DefaultCacheFactory;
import org.teiid.client.RequestMessage;
import org.teiid.client.ResultsMessage;
@@ -87,8 +88,10 @@
config = new DQPConfiguration();
config.setMaxActivePlans(1);
config.setUserRequestSourceConcurrency(2);
+ config.setResultsetCacheConfig(new CacheConfiguration());
core.start(config);
core.getPrepPlanCache().setModTime(1);
+ core.getRsCache().setModTime(1);
}
@After public void tearDown() throws Exception {
@@ -376,6 +379,21 @@
Thread.sleep(100);
+ //perform a minor update, we should still use the cache
+ sql = "delete from #temp where a12345 = '11'"; //$NON-NLS-1$
+ reqMsg = exampleRequestMessage(sql);
+ rm = execute(userName, sessionid, reqMsg);
+ assertEquals(1, rm.getResults().length); //$NON-NLS-1$
+
+ sql = "select * from #temp"; //$NON-NLS-1$
+ reqMsg = exampleRequestMessage(sql);
+ reqMsg.setStatementType(StatementType.PREPARED);
+ rm = execute(userName, sessionid, reqMsg);
+ assertEquals(10, rm.getResults().length); //$NON-NLS-1$
+
+ assertEquals(2, this.core.getPrepPlanCache().getCacheHitCount());
+
+ //perform a minor update, we will purge the plan
sql = "delete from #temp"; //$NON-NLS-1$
reqMsg = exampleRequestMessage(sql);
rm = execute(userName, sessionid, reqMsg);
@@ -387,9 +405,42 @@
rm = execute(userName, sessionid, reqMsg);
assertEquals(0, rm.getResults().length); //$NON-NLS-1$
- assertEquals(1, this.core.getPrepPlanCache().getCacheHitCount());
+ assertEquals(2, this.core.getPrepPlanCache().getCacheHitCount());
}
+ @Test public void testRsCacheInvalidation() throws Exception {
+ String sql = "select * FROM vqt.SmallB"; //$NON-NLS-1$
+ String userName = "1"; //$NON-NLS-1$
+ int sessionid = 1; //$NON-NLS-1$
+ RequestMessage reqMsg = exampleRequestMessage(sql);
+ reqMsg.setUseResultSetCache(true);
+ ResultsMessage rm = execute(userName, sessionid, reqMsg);
+ assertEquals(10, rm.getResults().length); //$NON-NLS-1$
+
+ sql = "select * FROM vqt.SmallB"; //$NON-NLS-1$
+ reqMsg = exampleRequestMessage(sql);
+ reqMsg.setUseResultSetCache(true);
+ rm = execute(userName, sessionid, reqMsg);
+ assertEquals(10, rm.getResults().length); //$NON-NLS-1$
+
+ assertEquals(1, this.core.getRsCache().getCacheHitCount());
+
+ Thread.sleep(100);
+
+ sql = "delete from bqt1.smalla"; //$NON-NLS-1$
+ reqMsg = exampleRequestMessage(sql);
+ rm = execute(userName, sessionid, reqMsg);
+ assertEquals(1, rm.getResults().length); //$NON-NLS-1$
+
+ sql = "select * FROM vqt.SmallB"; //$NON-NLS-1$
+ reqMsg = exampleRequestMessage(sql);
+ reqMsg.setUseResultSetCache(true);
+ rm = execute(userName, sessionid, reqMsg);
+ assertEquals(10, rm.getResults().length); //$NON-NLS-1$
+
+ assertEquals(1, this.core.getRsCache().getCacheHitCount());
+ }
+
public void helpTestVisibilityFails(String sql) throws Exception {
RequestMessage reqMsg = exampleRequestMessage(sql);
reqMsg.setTxnAutoWrapMode(RequestMessage.TXN_WRAP_OFF);
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -87,7 +87,7 @@
dtm = new DataTierManagerImpl(rm,
- bs);
+ bs, true);
command = helpGetCommand(sql, metadata);
RequestMessage original = new RequestMessage();
Modified: trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -25,6 +25,7 @@
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
@@ -38,6 +39,7 @@
import org.teiid.dqp.message.AtomicResultsMessage;
import org.teiid.query.optimizer.TestOptimizer;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
+import org.teiid.query.processor.relational.RelationalNodeUtil;
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.TranslatorException;
@@ -83,8 +85,11 @@
@Override
public ConnectorWork registerRequest(AtomicRequestMessage message)
throws TeiidComponentException {
- List projectedSymbols = (message.getCommand()).getProjectedSymbols();
+ List projectedSymbols = (message.getCommand()).getProjectedSymbols();
List[] results = createResults(projectedSymbols);
+ if (RelationalNodeUtil.isUpdate(message.getCommand())) {
+ results = new List[] {Arrays.asList(1)};
+ }
final AtomicResultsMessage msg = ConnectorWorkItem.createResultsMessage(results, projectedSymbols);
msg.setFinalRow(rows);
Modified: trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -34,6 +34,7 @@
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.TupleSource;
import org.teiid.core.TeiidComponentException;
+import org.teiid.events.EventDistributor;
import org.teiid.logging.LogManager;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.metadata.QueryMetadataInterface;
@@ -388,5 +389,8 @@
this.registerTuples(group.getMetadataID(), elementSymbols, tuples);
}
+ @Override
+ public void setEventDistributor(EventDistributor ed) {
+ }
}
\ No newline at end of file
Modified: trunk/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -32,6 +32,7 @@
import org.teiid.common.buffer.TupleSource;
import org.teiid.core.TeiidComponentException;
import org.teiid.dqp.internal.datamgr.LanguageBridgeFactory;
+import org.teiid.events.EventDistributor;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.util.CommandContext;
@@ -167,5 +168,9 @@
public void clearCodeTables() {
}
+
+ @Override
+ public void setEventDistributor(EventDistributor ed) {
+ }
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/relational/TestBatchedUpdateNode.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/relational/TestBatchedUpdateNode.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestBatchedUpdateNode.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -36,6 +36,7 @@
import org.teiid.common.buffer.TupleBatch;
import org.teiid.common.buffer.TupleSource;
import org.teiid.core.TeiidComponentException;
+import org.teiid.events.EventDistributor;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.TestBatchedUpdatePlanner;
import org.teiid.query.processor.ProcessorDataManager;
@@ -219,6 +220,10 @@
actualCommands.add(command);
return new FakeTupleSource(numExecutedCommands);
}
+ @Override
+ public void setEventDistributor(EventDistributor ed) {
+ }
+
}
private static final class FakeTupleSource implements TupleSource {
private int currentTuple = 0;
Modified: trunk/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -36,6 +36,7 @@
import org.teiid.common.buffer.TupleSource;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.events.EventDistributor;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.processor.FakeTupleSource;
import org.teiid.query.processor.ProcessorDataManager;
@@ -184,6 +185,9 @@
Object val = row.get(0);
assertEquals(new Integer(value), val);
}
+ @Override
+ public void setEventDistributor(EventDistributor ed) {
+ }
}
private static final class FakeDataTupleSource implements TupleSource {
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -659,7 +659,7 @@
}
@Override
- public void dataModification(String vdbName, int vdbVersion, String tableFqn) {
+ public void dataModification(String vdbName, int vdbVersion, String... tableFqns) {
VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
if (vdb == null) {
return;
@@ -668,16 +668,18 @@
if (tm == null) {
return;
}
- try {
- Table table = tm.getGroupID(tableFqn);
- table.setLastDataModification(System.currentTimeMillis());
- } catch (TeiidException e) {
- LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
+ for (String tableFqn:tableFqns) {
+ try {
+ Table table = tm.getGroupID(tableFqn);
+ table.setLastDataModification(System.currentTimeMillis());
+ } catch (TeiidException e) {
+ LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
+ }
}
}
@Override
- public void schemaModification(String vdbName, int vdbVersion, String fqn) {
+ public void schemaModification(String vdbName, int vdbVersion, String... fqns) {
VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
if (vdb == null) {
return;
@@ -686,11 +688,13 @@
if (tm == null) {
return;
}
- try {
- Table table = tm.getGroupID(fqn);
- table.setLastModified(System.currentTimeMillis());
- } catch (TeiidException e) {
- LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
+ for (String fqn:fqns) {
+ try {
+ Table table = tm.getGroupID(fqn);
+ table.setLastModified(System.currentTimeMillis());
+ } catch (TeiidException e) {
+ LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
+ }
}
}
}
Modified: trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java 2011-04-13 18:47:33 UTC (rev 3088)
+++ trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java 2011-04-13 20:34:39 UTC (rev 3089)
@@ -113,7 +113,7 @@
Mockito.stub(rwi.getDqpWorkContext()).toReturn(workContext);
Mockito.stub(core.getRequestWorkItem((RequestID)Mockito.anyObject())).toReturn(rwi);
- DataTierManagerImpl dataMgr = new DataTierManagerImpl(core, null);
+ DataTierManagerImpl dataMgr = new DataTierManagerImpl(core, null, true);
doProcess(metadata,
sql,
finder, dataMgr , new List[] {Arrays.asList(new String(ObjectConverterUtil.convertToByteArray(new FileInputStream(UnitTestUtil.getTestDataFile("test-schema.xsd")))))}, DEBUG); //$NON-NLS-1$
14 years, 9 months
teiid SVN: r3088 - trunk/client/src/main/java.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-04-13 14:47:33 -0400 (Wed, 13 Apr 2011)
New Revision: 3088
Removed:
trunk/client/src/main/java/net/
Log:
misc:removing the empty directories
14 years, 9 months
teiid SVN: r3087 - in trunk: documentation/admin-guide/src/main/docbook/en-US/content and 1 other directory.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-04-13 13:06:41 -0400 (Wed, 13 Apr 2011)
New Revision: 3087
Modified:
trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/content/logging.xml
Log:
TEIID-1551: documenting the ODBC logging context
Modified: trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml
===================================================================
--- trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml 2011-04-13 16:28:17 UTC (rev 3086)
+++ trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml 2011-04-13 17:06:41 UTC (rev 3087)
@@ -38,6 +38,8 @@
org.teiid.AUDIT_LOG - Authorization enforcement events.
org.teiid.ADMIN_API - Admin API logs.
+
+ org.teiid.ODBC - ODBC logs
-->
<!--
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/logging.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/logging.xml 2011-04-13 16:28:17 UTC (rev 3086)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/logging.xml 2011-04-13 17:06:41 UTC (rev 3087)
@@ -159,6 +159,14 @@
<para>Admin API logs.</para>
</entry>
</row>
+ <row>
+ <entry>
+ <para>org.teiid.ODBC</para>
+ </entry>
+ <entry>
+ <para>ODBC logs.</para>
+ </entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
14 years, 9 months
teiid SVN: r3086 - in trunk/documentation: reference/src/main/docbook/en-US/content and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-04-13 12:28:17 -0400 (Wed, 13 Apr 2011)
New Revision: 3086
Modified:
trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
Log:
minor doc updates on trim functions and use of an external load balancer
Modified: trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
===================================================================
--- trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2011-04-13 03:31:08 UTC (rev 3085)
+++ trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2011-04-13 16:28:17 UTC (rev 3086)
@@ -529,6 +529,8 @@
It's important to consider that 1 <code>ServerDiscovery</code> instance will be created for each connection. Any sharing of information between instances should be done through static state or some other shared lookup.
</para>
<para>Your customized server discovery class will then need to be referenced by the discoveryStategy connection/DataSource property by its full class name.</para>
+ <para>You may also choose to use an external tcp load balancer, such as <ulink url="http://haproxy.1wt.eu/">haproxy</ulink>.
+ The Teiid driver/DataSource should then typically be configured to just use the single host/port of your load balancer.</para>
</section>
</section>
<section>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2011-04-13 03:31:08 UTC (rev 3085)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2011-04-13 16:28:17 UTC (rev 3086)
@@ -913,7 +913,7 @@
<para>LTRIM(x)</para>
</entry>
<entry>
- <para>Left trim x of white space</para>
+ <para>Left trim x of blank chars</para>
</entry>
<entry>
<para>x in {string}, return string</para>
@@ -996,7 +996,7 @@
<para>RTRIM(x)</para>
</entry>
<entry>
- <para>Right trim x of white space</para>
+ <para>Right trim x of blank chars</para>
</entry>
<entry>
<para>x is string, return string</para>
14 years, 9 months
teiid SVN: r3085 - in branches/7.1.x: build and 20 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-04-12 23:31:08 -0400 (Tue, 12 Apr 2011)
New Revision: 3085
Added:
branches/7.1.x/client-jdk15/
branches/7.1.x/client-jdk15/pom.xml
branches/7.1.x/client-jdk15/src/
branches/7.1.x/client-jdk15/src/main/
branches/7.1.x/client-jdk15/src/main/java/
branches/7.1.x/client-jdk15/src/main/java/net/
branches/7.1.x/client-jdk15/src/main/java/net/sf/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/
branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
Modified:
branches/7.1.x/build/pom.xml
branches/7.1.x/pom.xml
Log:
SOA-2999: Adding support to produce JDK1.5 compatible Client JDBC driver to the build
Modified: branches/7.1.x/build/pom.xml
===================================================================
--- branches/7.1.x/build/pom.xml 2011-04-12 23:20:51 UTC (rev 3084)
+++ branches/7.1.x/build/pom.xml 2011-04-13 03:31:08 UTC (rev 3085)
@@ -8,6 +8,24 @@
<artifactId>teiid</artifactId>
<name>Build</name>
<description>Teiid Build</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client-jdk15</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.retrotranslator</groupId>
+ <artifactId>retrotranslator-runtime</artifactId>
+ <version>1.2.9</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.retrotranslator</groupId>
+ <artifactId>retrotranslator-transformer</artifactId>
+ <version>1.2.9</version>
+ </dependency>
+ </dependencies>
<build>
<outputDirectory>target/kits</outputDirectory>
<resources>
@@ -86,8 +104,33 @@
</descriptors>
</configuration>
</plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>net.sf.retrotranslator.transformer.Retrotranslator</mainClass>
+ <arguments>
+ <argument>-srcjar</argument>
+ <argument>${pom.basedir}/target/teiid-${pom.version}-client.jar</argument>
+ <argument>-destjar</argument>
+ <argument>${pom.basedir}/target/teiid-${pom.version}-client-jdk15.jar</argument>
+ <argument>-embed</argument>
+ <argument>org.teiid.retroruntime</argument>
+ </arguments>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</profile>
</profiles>
-</project>
\ No newline at end of file
+</project>
Added: branches/7.1.x/client-jdk15/pom.xml
===================================================================
--- branches/7.1.x/client-jdk15/pom.xml (rev 0)
+++ branches/7.1.x/client-jdk15/pom.xml 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid-parent</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.1.1.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-client-jdk15</artifactId>
+ <name>Client JDK15</name>
+ <description>Contains the packages related retrotranslator that will convert 1.6 to 1.5</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.io;
+
+import java.io.IOException;
+
+public class _IOException {
+ public static IOException createNewInstance(Throwable t){
+ IOException io = new IOException();
+ io.initCause(t);
+ return io;
+ }
+}
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.io;
+
+import java.io.ObjectStreamClass;
+import java.lang.reflect.Method;
+
+public class _ObjectStreamClass {
+ public static ObjectStreamClass lookupAny(Class<?> cl) {
+ try {
+ Method m = ObjectStreamClass.class.getDeclaredMethod("lookup",new Class[] { Class.class, Boolean.TYPE }); //$NON-NLS-1$
+ m.setAccessible(true);
+ return (ObjectStreamClass) m.invoke(null, new Object[] { cl,Boolean.valueOf(true) });
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.Clob;
+
+public abstract interface NClob_ extends Clob
+{
+}
\ No newline at end of file
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+public interface RowId_ {
+ boolean equals(Object obj);
+ byte[] getBytes();
+ String toString();
+ int hashCode();
+}
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public class SQLClientInfoException_ extends SQLException {
+
+}
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public class SQLFeatureNotSupportedException_ extends SQLException {
+
+}
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.sql.SQLException;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+
+public abstract interface SQLXML_
+{
+ public abstract void free()
+ throws SQLException;
+
+ public abstract InputStream getBinaryStream()
+ throws SQLException;
+
+ public abstract OutputStream setBinaryStream()
+ throws SQLException;
+
+ public abstract Reader getCharacterStream()
+ throws SQLException;
+
+ public abstract Writer setCharacterStream()
+ throws SQLException;
+
+ public abstract String getString()
+ throws SQLException;
+
+ public abstract void setString(String paramString)
+ throws SQLException;
+
+ public abstract <T extends Source> T getSource(Class<T> paramClass)
+ throws SQLException;
+
+ public abstract <T extends Result> T setResult(Class<T> paramClass)
+ throws SQLException;
+}
\ No newline at end of file
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public abstract interface Wrapper_
+{
+ public abstract <T> T unwrap(Class<T> paramClass)
+ throws SQLException;
+
+ public abstract boolean isWrapperFor(Class<?> paramClass)
+ throws SQLException;
+}
\ No newline at end of file
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public class _SQLException {
+ public static SQLException createNewInstance(Throwable t){
+ SQLException sql = new SQLException();
+ sql.initCause(t);
+ return sql;
+ }
+}
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLWarning;
+
+public class _SQLWarning {
+ public static SQLWarning createNewInstance(Throwable t){
+ SQLWarning sql = new SQLWarning();
+ sql.initCause(t);
+ return sql;
+ }
+}
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+public class _Types {
+ public final static int ROWID = -8;
+ public static final int NCHAR = -15;
+ public static final int NVARCHAR = -9;
+ public static final int LONGNVARCHAR = -16;
+ public static final int NCLOB = 2011;
+ public static final int SQLXML = 2009;
+}
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.util;
+
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+public class _Properties {
+
+ public static Set<String> stringPropertyNames(Properties props) {
+ return new HashSet<String>(Collections.list((Enumeration<String>)props.propertyNames()));
+ }
+}
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.javax.net.ssl;
+
+import java.security.NoSuchAlgorithmException;
+
+import javax.net.ssl.SSLContext;
+
+public class _SSLContext {
+ public static SSLContext getDefault() throws NoSuchAlgorithmException {
+ return SSLContext.getInstance("TLSv1"); //$NON-NLS-1$
+ }
+}
Added: branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
===================================================================
--- branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java (rev 0)
+++ branches/7.1.x/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java 2011-04-13 03:31:08 UTC (rev 3085)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.org.teiid.core.types.basic;
+
+import java.io.Reader;
+
+import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.types.Transform;
+import org.teiid.core.types.TransformationException;
+import org.teiid.core.types.XMLType.Type;
+
+public class StringToSQLXMLTransform_ extends Transform {
+
+ public static Type isXml(Reader reader) throws TransformationException {
+ return Type.UNKNOWN;
+ }
+
+ /**
+ * This method transforms a value of the source type into a value
+ * of the target type.
+ * @param value Incoming value of source type
+ * @return Outgoing value of target type
+ * @throws TransformationException if value is an incorrect input type or
+ * the transformation fails
+ */
+ public Object transformDirect(Object value) throws TransformationException {
+ throw new UnsupportedOperationException();
+ }
+
+
+
+ /**
+ * Type of the incoming value.
+ * @return Source type
+ */
+ public Class<?> getSourceType() {
+ return DataTypeManager.DefaultDataClasses.STRING;
+ }
+
+ /**
+ * Type of the outgoing value.
+ * @return Target type
+ */
+ public Class<?> getTargetType() {
+ return DataTypeManager.DefaultDataClasses.XML;
+ }
+
+ @Override
+ public boolean isExplicit() {
+ return true;
+ }
+}
Modified: branches/7.1.x/pom.xml
===================================================================
--- branches/7.1.x/pom.xml 2011-04-12 23:20:51 UTC (rev 3084)
+++ branches/7.1.x/pom.xml 2011-04-13 03:31:08 UTC (rev 3085)
@@ -470,8 +470,9 @@
<module>adminshell</module>
<module>cache-jbosscache</module>
<module>hibernate-dialect</module>
- <module>jboss-integration</module>
+ <module>jboss-integration</module>
<module>test-integration</module>
+ <module>client-jdk15</module>
</modules>
<distributionManagement>
<repository>
@@ -485,4 +486,4 @@
<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
-</project>
\ No newline at end of file
+</project>
14 years, 9 months