teiid SVN: r3083 - in trunk: api/src/main/java/org/teiid/metadata and 26 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-04-12 15:35:57 -0400 (Tue, 12 Apr 2011)
New Revision: 3083
Added:
trunk/cache-jbosscache/src/main/java/org/teiid/events/
trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/
trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java
trunk/engine/src/main/java/org/teiid/events/
trunk/engine/src/main/java/org/teiid/events/EventDistributor.java
Modified:
trunk/api/src/main/java/org/teiid/metadata/Table.java
trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml
trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
trunk/engine/src/main/java/org/teiid/cache/Cachable.java
trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.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/PreparedPlan.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/QueryProcessorFactoryImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataID.java
trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java
trunk/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java
trunk/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java
trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/IfInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ProgramInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.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/main/java/org/teiid/query/tempdata/TempTableStore.java
trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java
trunk/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java
trunk/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
trunk/pom.xml
Log:
TEIID-1507 initial support for cache invalidation based upon events
Modified: trunk/api/src/main/java/org/teiid/metadata/Table.java
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/Table.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/api/src/main/java/org/teiid/metadata/Table.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -66,6 +66,9 @@
private List<String> schemaPaths;
private String resourcePath;
+ private transient long lastModified;
+ private transient long lastDataModification;
+
public List<String> getBindings() {
return bindings;
}
@@ -270,4 +273,20 @@
column.setParent(this);
}
+ public long getLastDataModification() {
+ return lastDataModification;
+ }
+
+ public long getLastModified() {
+ return lastModified;
+ }
+
+ public void setLastDataModification(long lastDataModification) {
+ this.lastDataModification = lastDataModification;
+ }
+
+ public void setLastModified(long lastModified) {
+ this.lastModified = lastModified;
+ }
+
}
\ No newline at end of file
Modified: trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml 2011-04-12 19:35:57 UTC (rev 3083)
@@ -137,5 +137,15 @@
</map>
</property>
</bean>
+
+ <bean name="EventDistributorFactory" class="org.teiid.events.jboss.JGroupsEventDistributor">
+ <property name="jndiName">teiid/event-distributor</property>
+ <property name="channelFactory">
+ <inject bean="JChannelFactory" />
+ </property>
+ <property name="clusterName">${jboss.partition.name:DefaultPartition}-teiid-events</property>
+ <property name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <property name="localEventDistributorName">teiid/runtime-engine</property>
+ </bean>
</deployment>
\ No newline at end of file
Modified: trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-04-12 19:35:57 UTC (rev 3083)
@@ -57,15 +57,31 @@
<bean name="ResultsetCacheConfig" class="org.teiid.cache.CacheConfiguration">
<property name="name">ResultSetCacheConfig</property>
<property name="enabled">true</property>
- <!-- Max Entries allowed for ResultSet Cache (default 1024) -->
+ <!-- Max Entries allowed (default 1024) -->
<property name="maxEntries">1024</property>
<!-- Max age in seconds (default 7200 - 2 hours) -->
<property name="maxAgeInSeconds">7200</property>
+ <!-- Max staleness in seconds. Modifications are based upon data updates
+ -1 indicates no max. (default 60 - 1 minute) -->
+ <property name="maxStaleness">60</property>
<!-- Allowed values are LRU, EXPIRATION.
Setting this value to LRU will cause cache hint TTL values
to be ignored. (default EXPIRATION) -->
<property name="type">EXPIRATION</property>
<property name="location">resultset</property>
+ </bean>
+
+ <!-- Configuration for prepared plan caching. (local memory only)
+ -->
+ <bean name="PreparedPlanCacheConfig" class="org.teiid.cache.CacheConfiguration">
+ <property name="name">PreparedPlanCacheConfig</property>
+ <!-- Max Entries allowed (default 512) -->
+ <property name="maxEntries">512</property>
+ <!-- Max age in seconds (default 28800 - 8 hours) -->
+ <property name="maxAgeInSeconds">28800</property>
+ <!-- Max staleness in seconds. Modifications are based upon costing updates
+ -1 indicates no max. (default 300 - 5 minutes) -->
+ <property name="maxStaleness">300</property>
</bean>
<bean name="RuntimeEngineDeployer" class="org.teiid.jboss.deployers.RuntimeEngineDeployer">
@@ -84,6 +100,7 @@
<property name="VDBStatusChecker"><inject bean="VDBStatusChecker"/></property>
<property name="cacheFactory"><inject bean="CacheFactory"/></property>
<property name="resultsetCacheConfig"><inject bean="ResultsetCacheConfig"/></property>
+ <property name="preparedPlanCacheConfig"><inject bean="PreparedPlanCacheConfig"/></property>
<!-- Process pool maximum thread count. (default 64) -->
<property name="maxThreads">64</property>
@@ -100,10 +117,6 @@
<property name="maxRowsFetchSize">20480</property>
<!-- The max lob chunk size in KB transferred each time when processing blobs, clobs (100KB default) -->
<property name="lobChunkSizeInKB">100</property>
- <!-- The maximum number of query plans that are cached.
- This includes both user plans and internal prepared plans.
- Note: this is a memory based cache. (default 512) -->
- <property name="preparedPlanCacheMaxCount">512</property>
<!-- Turn on role checking based upon the data roles defined in VDBs. (default true) -->
<property name="useDataRoles">true</property>
<!-- Sets whether temporary table usage is enabled by default (default true) -->
@@ -116,6 +129,8 @@
<property name="exceptionOnMaxSourceRows">true</property>
<!-- Maximum size of lob allowed through ODBC connection in bytes (default 5MB) -->
<property name="maxODBCLobSizeAllowed">5242880</property>
+ <!-- The JNDI name of the Teiid Event Distributor -->
+ <property name="eventDistributorName">teiid/event-distributor</property>
</bean>
<!-- JDBC Socket connection properties (SSL see below) -->
Added: trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java (rev 0)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -0,0 +1,173 @@
+/*
+ * 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.events.jboss;
+
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.Vector;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.util.naming.Util;
+import org.jgroups.Address;
+import org.jgroups.Channel;
+import org.jgroups.JChannelFactory;
+import org.jgroups.ReceiverAdapter;
+import org.jgroups.View;
+import org.jgroups.blocks.GroupRequest;
+import org.jgroups.blocks.MethodCall;
+import org.jgroups.blocks.RpcDispatcher;
+import org.teiid.events.EventDistributor;
+
+public class JGroupsEventDistributor extends ReceiverAdapter implements Serializable {
+
+ private static final long serialVersionUID = -1140683411842561358L;
+
+ private transient JChannelFactory channelFactory;
+ private String multiplexerStack;
+ private String clusterName;
+ private String jndiName;
+ private String localEventDistributorName;
+
+ private transient EventDistributor proxyEventDistributor;
+ private transient EventDistributor localEventDistributor;
+
+ private transient Channel channel;
+ private transient RpcDispatcher rpcDispatcher;
+ private transient Vector<Address> members;
+
+ public JChannelFactory getChannelFactory() {
+ return channelFactory;
+ }
+
+ public void setJndiName(String jndiName) {
+ this.jndiName = jndiName;
+ }
+
+ public String getJndiName() {
+ return jndiName;
+ }
+
+ public String getLocalEventDistributorName() {
+ return localEventDistributorName;
+ }
+
+ public void setLocalEventDistributorName(String localEventDistributorName) {
+ this.localEventDistributorName = localEventDistributorName;
+ }
+
+ public String getMultiplexerStack() {
+ return multiplexerStack;
+ }
+
+ public String getClusterName() {
+ return clusterName;
+ }
+
+ public void setChannelFactory(JChannelFactory channelFactory) {
+ this.channelFactory = channelFactory;
+ }
+
+ public void setClusterName(String clusterName) {
+ this.clusterName = clusterName;
+ }
+
+ public void setMultiplexerStack(String multiplexerStack) {
+ this.multiplexerStack = multiplexerStack;
+ }
+
+ public void start() throws Exception {
+ if (this.channelFactory == null) {
+ return; //no need to distribute events
+ }
+ channel = this.channelFactory.createMultiplexerChannel(this.multiplexerStack, null);
+ channel.connect(this.clusterName);
+
+ proxyEventDistributor = (EventDistributor) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {EventDistributor.class}, new InvocationHandler() {
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ rpcDispatcher.callRemoteMethods(members, new MethodCall(method, args), GroupRequest.GET_NONE, 0);
+ return null;
+ }
+ });
+ //wrap the local in a proxy to prevent unintended methods from being called
+ rpcDispatcher = new RpcDispatcher(channel, this, this, Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {EventDistributor.class}, new InvocationHandler() {
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ EventDistributor local = getLocalEventDistributor();
+ if (local == null) {
+ return null;
+ }
+ return method.invoke(local, args);
+ }
+ }));
+ rpcDispatcher.setDeadlockDetection(false);
+ if (jndiName != null) {
+ final InitialContext ic = new InitialContext();
+ Util.bind(ic, jndiName, proxyEventDistributor);
+ }
+ }
+
+ private EventDistributor getLocalEventDistributor() {
+ if (localEventDistributor == null && this.localEventDistributorName != null) {
+ try {
+ Context ctx = new InitialContext();
+ return (EventDistributor) ctx.lookup(this.localEventDistributorName);
+ } catch (NamingException e) {
+ return null;
+ }
+ }
+ return localEventDistributor;
+ }
+
+ @Override
+ public void viewAccepted(View newView) {
+ Vector<Address> new_members = new Vector<Address>(newView.getMembers());
+ new_members.remove(this.channel.getLocalAddress());
+ this.members = new_members;
+ }
+
+ public void stop() {
+ if (jndiName != null) {
+ final InitialContext ic ;
+ try {
+ ic = new InitialContext() ;
+ Util.unbind(ic, jndiName) ;
+ } catch (final NamingException ne) {
+ }
+ }
+ if (this.channel != null) {
+ this.channel.close();
+ this.rpcDispatcher.stop();
+ }
+ }
+
+}
Property changes on: trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2011-04-12 19:35:57 UTC (rev 3083)
@@ -323,10 +323,6 @@
displayName="Lob Chunk Size In KB"
description="The max lob chunk size in KB transferred to the client for xml, blobs, clobs (default 100KB)"
required="false" readOnly="false" />
- <c:simple-property name="RuntimeEngineDeployer.preparedPlanCacheMaxCount"
- displayName="Prepared Plan Cache Max Count"
- description="The maximum number of query plans that are cached. Note: this is a memory based cache. (default 512)"
- required="false" readOnly="false" />
<c:simple-property name="RuntimeEngineDeployer.queryThresholdInSecs"
displayName="Long Running Query Threshold"
description="Length of time in seconds before a query is considered long running"
@@ -350,9 +346,29 @@
<c:simple-property name="ResultSetCacheConfig.maxAgeInSeconds"
displayName="Max Entry Age"
description="The maximum age of a result set cache entry in seconds. -1 indicates no max. (default 7200)"
+ required="false" readOnly="false" />
+ <c:simple-property name="ResultSetCacheConfig.maxStaleness"
+ displayName="Max Entry Staleness"
+ description="The maximum staleness of a result set cache entry in seconds based upon data modifications. -1 indicates no max. (default 60)"
required="false" readOnly="false" />
</c:group>
+ <c:group name="PreparedPlanCacheConfig" displayName="Prepared Plan Cache Properties" hiddenByDefault="false">
+ <!-- the below property on RuntimeEngineDeployer -->
+ <c:simple-property name="PreparedPlanCacheConfig.maxEntries"
+ displayName="Max Entries"
+ description="The maximum number of prepared plan cache entries. -1 indicates no limit. (default 512"
+ required="false" readOnly="false" />
+ <c:simple-property name="PreparedPlanCacheConfig.maxAgeInSeconds"
+ displayName="Max Entry Age"
+ description="The maximum age of a prepared plan cache entry in seconds. -1 indicates no max. (default 28800)"
+ required="false" readOnly="false" />
+ <c:simple-property name="PreparedPlanCacheConfig.maxStaleness"
+ displayName="Max Entry Staleness"
+ description="The maximum staleness of a prepared plan cache entry in seconds based upon costing modifications. -1 indicates no max. (default 300)"
+ required="false" readOnly="false" />
+ </c:group>
+
<c:group name="BufferService" displayName="Buffer Service Properties"
hiddenByDefault="false">
<c:simple-property name="BufferService.maxBufferSpace"
Modified: trunk/engine/src/main/java/org/teiid/cache/Cachable.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/cache/Cachable.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/cache/Cachable.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -22,10 +22,13 @@
package org.teiid.cache;
import org.teiid.common.buffer.BufferManager;
+import org.teiid.dqp.internal.process.AccessInfo;
public interface Cachable {
-
+
boolean prepare(Cache cache, BufferManager bufferManager);
boolean restore(Cache cache, BufferManager bufferManager);
+
+ AccessInfo getAccessInfo();
}
Modified: trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -27,6 +27,7 @@
import org.jboss.managed.api.annotation.ManagementObjectID;
import org.jboss.managed.api.annotation.ManagementProperties;
import org.jboss.managed.api.annotation.ManagementProperty;
+import org.teiid.dqp.internal.process.SessionAwareCache;
@ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
public class CacheConfiguration {
@@ -37,12 +38,14 @@
}
private Policy policy;
- private int maxage;
- private int maxEntries;
+ private int maxage = -1;
+ private int maxEntries = SessionAwareCache.DEFAULT_MAX_SIZE_TOTAL;
private boolean enabled = true;
private String name;
private String location;
-
+
+ private int maxStaleness = -1;
+
public CacheConfiguration() {
}
@@ -57,7 +60,7 @@
return this.policy;
}
- @ManagementProperty(description="The maximum age of a result set cache entry in seconds. -1 indicates no max. (default 7200)")
+ @ManagementProperty(description="The maximum age of an entry in seconds. -1 indicates no max.")
public int getMaxAgeInSeconds(){
return maxage;
}
@@ -66,7 +69,16 @@
this.maxage = maxage;
}
- @ManagementProperty(description="The maximum number of result set cache entries. -1 indicates no limit. (default 1024)")
+ @ManagementProperty(description="The maximum staleness in seconds of an entry based upon modifications. -1 indicates no max.")
+ public int getMaxStaleness() {
+ return maxStaleness;
+ }
+
+ public void setMaxStaleness(int maxStaleDataModification) {
+ this.maxStaleness = maxStaleDataModification;
+ }
+
+ @ManagementProperty(description="The maximum number of cache entries. -1 indicates no limit. (default 1024)")
public int getMaxEntries() {
return this.maxEntries;
}
@@ -98,37 +110,6 @@
this.location = location;
}
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + maxage;
- result = prime * result + maxEntries;
- result = prime * result + ((policy == null) ? 0 : policy.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- CacheConfiguration other = (CacheConfiguration) obj;
- if (maxage != other.maxage)
- return false;
- if (maxEntries != other.maxEntries)
- return false;
- if (policy == null) {
- if (other.policy != null)
- return false;
- } else if (!policy.equals(other.policy))
- return false;
- return true;
- }
-
public boolean isEnabled() {
return enabled;
}
Added: trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -0,0 +1,182 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.dqp.internal.process;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.api.exception.query.QueryResolverException;
+import org.teiid.api.exception.query.QueryValidatorException;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.metadata.Table;
+import org.teiid.query.metadata.TempMetadataID;
+import org.teiid.query.metadata.TransformationMetadata;
+import org.teiid.query.optimizer.relational.RelationalPlanner;
+import org.teiid.query.processor.ProcessorPlan;
+import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.tempdata.TempTableStore;
+import org.teiid.query.util.CommandContext;
+
+/**
+ * Tracks what views were used and what tables are accessed
+ */
+public class AccessInfo implements Serializable {
+
+ private static final long serialVersionUID = -2608267960584191359L;
+
+ private transient Set<Table> viewsAccessed;
+ private transient Set<Object> tablesAccessed;
+
+ private List<List<String>> externalTableNames;
+ private List<List<String>> externalViewNames;
+
+ private transient long creationTime = System.currentTimeMillis();
+
+ private void writeObject(java.io.ObjectOutputStream out) throws IOException {
+ externalTableNames = initExternalList(externalTableNames, tablesAccessed);
+ externalViewNames = initExternalList(externalViewNames, viewsAccessed);
+ out.defaultWriteObject();
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
+ in.defaultReadObject();
+ this.creationTime = System.currentTimeMillis();
+ }
+
+ private List<List<String>> initExternalList(List<List<String>> externalNames, Set<? extends Object> accessed) {
+ if (externalNames == null) {
+ externalNames = new ArrayList<List<String>>(accessed.size());
+ for (Object object : accessed) {
+ if (object instanceof Table) {
+ Table t = (Table)object;
+ externalNames.add(Arrays.asList(t.getParent().getName(), t.getName()));
+ } else if (object instanceof TempMetadataID) {
+ TempMetadataID t = (TempMetadataID)object;
+ externalNames.add(Arrays.asList(t.getID()));
+ }
+ }
+ }
+ return externalNames;
+ }
+
+ public Set<Table> getViewsAccessed() {
+ return viewsAccessed;
+ }
+
+ public Set<Object> getTablesAccessed() {
+ return tablesAccessed;
+ }
+
+ public long getCreationTime() {
+ return creationTime;
+ }
+
+ void populate(ProcessorPlan plan, CommandContext context) {
+ List<GroupSymbol> groups = new ArrayList<GroupSymbol>();
+ plan.getAccessedGroups(groups);
+ if (!groups.isEmpty()) {
+ tablesAccessed = new HashSet<Object>();
+ for (GroupSymbol groupSymbol : groups) {
+ tablesAccessed.add(groupSymbol.getMetadataID());
+ }
+ } else {
+ tablesAccessed = Collections.emptySet();
+ }
+ if (!context.getViewsAccessed().isEmpty()) {
+ this.viewsAccessed = new HashSet<Table>(context.getViewsAccessed());
+ } else {
+ this.viewsAccessed = Collections.emptySet();
+ }
+ }
+
+ void restore() throws QueryResolverException, QueryValidatorException, TeiidComponentException {
+ if (this.viewsAccessed != null) {
+ return;
+ }
+ VDBMetaData vdb = DQPWorkContext.getWorkContext().getVDB();
+ TransformationMetadata tm = vdb.getAttachment(TransformationMetadata.class);
+ TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
+ if (!externalViewNames.isEmpty()) {
+ this.viewsAccessed = new HashSet<Table>();
+ for (List<String> key : this.externalViewNames) {
+ this.viewsAccessed.add(tm.getMetadataStore().getSchema(key.get(0).toUpperCase()).getTables().get(key.get(1).toUpperCase()));
+ }
+ } else {
+ this.viewsAccessed = Collections.emptySet();
+ }
+ this.externalViewNames = null;
+ if (!externalTableNames.isEmpty()) {
+ for (List<String> key : this.externalTableNames) {
+ if (key.size() == 1) {
+ String matTableName = key.get(0);
+ TempMetadataID id = globalStore.getMetadataStore().getTempGroupID(matTableName);
+ if (id == null) {
+ //if the id is null, then create a local instance
+ String viewFullName = matTableName.substring(RelationalPlanner.MAT_PREFIX.length());
+ id = globalStore.getGlobalTempTableMetadataId(tm.getGroupID(viewFullName), tm);
+ }
+ this.tablesAccessed.add(id);
+ } else {
+ this.tablesAccessed.add(tm.getMetadataStore().getSchema(key.get(0).toUpperCase()).getTables().get(key.get(1).toUpperCase()));
+ }
+ }
+ } else {
+ this.tablesAccessed = Collections.emptySet();
+ }
+ this.externalTableNames = null;
+ }
+
+ boolean validate(boolean data, long modTime) {
+ if (this.tablesAccessed == null || modTime < 0) {
+ return true;
+ }
+ if (!data) {
+ for (Table t : getViewsAccessed()) {
+ if (t.getLastModified() - modTime > this.creationTime) {
+ return false;
+ }
+ }
+ }
+ for (Object o : getTablesAccessed()) {
+ if (o instanceof Table) {
+ Table t = (Table)o;
+ if ((data?t.getLastDataModification():t.getLastModified()) - modTime > this.creationTime) {
+ return false;
+ }
+ } else if (o instanceof TempMetadataID) {
+ TempMetadataID tid = (TempMetadataID)o;
+ if (tid.getTableData().getLastModified() - modTime > this.creationTime) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+}
Property changes on: trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -35,6 +35,7 @@
import org.teiid.common.buffer.TupleBuffer;
import org.teiid.common.buffer.BufferManager.TupleSourceType;
import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.Assertion;
import org.teiid.logging.LogConstants;
@@ -44,6 +45,7 @@
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.parser.ParseInfo;
import org.teiid.query.parser.QueryParser;
+import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.resolver.QueryResolver;
import org.teiid.query.sql.lang.CacheHint;
import org.teiid.query.sql.lang.Command;
@@ -65,6 +67,8 @@
private int rowCount;
private boolean hasLobs;
+ private AccessInfo accessInfo = new AccessInfo();
+
public String getId() {
return this.uuid;
}
@@ -81,13 +85,14 @@
return results;
}
- public void setResults(TupleBuffer results) {
+ public void setResults(TupleBuffer results, ProcessorPlan plan) {
this.results = results;
this.batchSize = results.getBatchSize();
this.types = TupleBuffer.getTypeNames(results.getSchema());
this.rowCount = results.getRowCount();
this.uuid = results.getId();
this.hasLobs = results.isLobs();
+ this.accessInfo.populate(plan, plan.getContext());
}
public void setCommand(Command command) {
@@ -146,10 +151,17 @@
this.results = buffer;
bufferManager.addTupleBuffer(this.results);
}
+ this.accessInfo.restore();
return true;
- } catch (TeiidComponentException e) {
- LogManager.logDetail(LogConstants.CTX_DQP, QueryPlugin.Util.getString("not_found_cache")); //$NON-NLS-1$
+ } catch (TeiidException e) {
+ LogManager.logDetail(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("not_found_cache")); //$NON-NLS-1$
}
return false;
}
+
+ @Override
+ public AccessInfo getAccessInfo() {
+ return accessInfo;
+ }
+
}
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-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -45,7 +45,6 @@
private int timeSliceInMilli = DEFAULT_PROCESSOR_TIMESLICE;
private int maxRowsFetchSize = DEFAULT_FETCH_SIZE;
private int lobChunkSizeInKB = 100;
- private int preparedPlanCacheMaxCount = SessionAwareCache.DEFAULT_MAX_SIZE_TOTAL;
private boolean useDataRoles = true;
private boolean allowCreateTemporaryTablesByDefault = true;
private int queryThresholdInSecs = DEFAULT_QUERY_THRESHOLD;
@@ -53,11 +52,12 @@
private int maxSourceRows = -1;
private int maxActivePlans = DEFAULT_MAX_ACTIVE_PLANS;
private CacheConfiguration resultsetCacheConfig;
+ private CacheConfiguration preparedPlanCacheConfig = new CacheConfiguration();
private int maxODBCLobSizeAllowed = 5*1024*1024; // 5 MB
private int userRequestSourceConcurrency = DEFAULT_USER_REQUEST_SOURCE_CONCURRENCY;
- private AuthorizationValidator authorizationValidator;
- private MetadataProvider metadataProvider;
+ private transient AuthorizationValidator authorizationValidator;
+ private transient MetadataProvider metadataProvider;
@ManagementProperty(description="Max active plans (default 20). Increase this value, and max threads, on highly concurrent systems - but ensure that the underlying pools can handle the increased load without timeouts.")
public int getMaxActivePlans() {
@@ -116,15 +116,6 @@
this.lobChunkSizeInKB = lobChunkSizeInKB;
}
- @ManagementProperty(description="The maximum number of query plans that are cached. Note: this is a memory based cache. (default 512)")
- public int getPreparedPlanCacheMaxCount() {
- return this.preparedPlanCacheMaxCount;
- }
-
- public void setPreparedPlanCacheMaxCount(int preparedPlanCacheMaxCount) {
- this.preparedPlanCacheMaxCount = preparedPlanCacheMaxCount;
- }
-
public CacheConfiguration getResultsetCacheConfig() {
return this.resultsetCacheConfig;
}
@@ -230,4 +221,14 @@
public void setMetadataProvider(MetadataProvider metadataProvider) {
this.metadataProvider = metadataProvider;
}
+
+ public CacheConfiguration getPreparedPlanCacheConfig() {
+ return preparedPlanCacheConfig;
+ }
+
+ public void setPreparedPlanCacheConfig(
+ CacheConfiguration preparedPlanCacheConfig) {
+ this.preparedPlanCacheConfig = preparedPlanCacheConfig;
+ }
+
}
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-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -73,7 +73,6 @@
import org.teiid.logging.MessageLevel;
import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.tempdata.TempTableDataManager;
import org.teiid.query.tempdata.TempTableStore;
@@ -171,7 +170,7 @@
// Resources
private BufferManager bufferManager;
- private ProcessorDataManager dataTierMgr;
+ private TempTableDataManager dataTierMgr;
private SessionAwareCache<PreparedPlan> prepPlanCache;
private SessionAwareCache<CachedResults> rsCache;
private TransactionService transactionService;
@@ -643,7 +642,7 @@
LogManager.log(MessageLevel.DETAIL, LogConstants.CTX_COMMANDLOGGING, message);
}
- ProcessorDataManager getDataTierManager() {
+ public TempTableDataManager getDataTierManager() {
return this.dataTierMgr;
}
@@ -686,7 +685,8 @@
}
//prepared plan cache
- prepPlanCache = new SessionAwareCache<PreparedPlan>(this.cacheFactory, SessionAwareCache.Type.PREPAREDPLAN, new CacheConfiguration(Policy.LRU, 60*60*8, config.getPreparedPlanCacheMaxCount(), "PreparedCache")); //$NON-NLS-1$
+ CacheConfiguration ppCacheConfig = config.getPreparedPlanCacheConfig();
+ prepPlanCache = new SessionAwareCache<PreparedPlan>(this.cacheFactory, SessionAwareCache.Type.PREPAREDPLAN, ppCacheConfig);
prepPlanCache.setBufferManager(this.bufferManager);
this.processWorkerPool = new ThreadReuseExecutor(DQPConfiguration.PROCESS_PLAN_QUEUE_NAME, config.getMaxThreads());
@@ -898,4 +898,8 @@
return maxActivePlans;
}
+ SessionAwareCache<PreparedPlan> getPrepPlanCache() {
+ return prepPlanCache;
+ }
+
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -24,18 +24,24 @@
import java.util.List;
+import org.teiid.cache.Cachable;
+import org.teiid.cache.Cache;
+import org.teiid.common.buffer.BufferManager;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.symbol.Reference;
+import org.teiid.query.util.CommandContext;
-public class PreparedPlan{
+public class PreparedPlan implements Cachable {
private ProcessorPlan plan;
private Command command;
private List<Reference> refs;
private AnalysisRecord analysisRecord;
+ private AccessInfo accessInfo = new AccessInfo();
+
/**
* Return the ProcessorPlan.
*/
@@ -66,9 +72,11 @@
/**
* Set the ProcessorPlan.
+ * @param context
*/
- public void setPlan(ProcessorPlan planValue){
+ public void setPlan(ProcessorPlan planValue, CommandContext context){
plan = planValue;
+ this.accessInfo.populate(planValue, context);
}
/**
@@ -92,4 +100,19 @@
refs = refsValue;
}
+ @Override
+ public AccessInfo getAccessInfo() {
+ return accessInfo;
+ }
+
+ @Override
+ public boolean prepare(Cache cache, BufferManager bufferManager) {
+ return true; //no remotable actions
+ }
+
+ @Override
+ public boolean restore(Cache cache, BufferManager bufferManager) {
+ return true; //no remotable actions
+ }
+
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -139,7 +139,7 @@
if (!this.addedLimit) { //TODO: this is a little problematic
prepPlan.setCommand(this.userCommand);
// Defect 13751: Clone the plan in its current state (i.e. before processing) so that it can be used for later queries
- prepPlan.setPlan(processPlan.clone());
+ prepPlan.setPlan(processPlan.clone(), this.context);
prepPlan.setAnalysisRecord(analysisRecord);
Determinism determinismLevel = this.context.getDeterminismLevel();
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/QueryProcessorFactoryImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/QueryProcessorFactoryImpl.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/QueryProcessorFactoryImpl.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -88,7 +88,7 @@
AnalysisRecord record = new AnalysisRecord(false, false);
ProcessorPlan plan = QueryOptimizer.optimizePlan(newCommand, metadata, idGenerator, finder, record, copy);
pp = new PreparedPlan();
- pp.setPlan(plan);
+ pp.setPlan(plan, copy);
pp.setReferences(references);
pp.setAnalysisRecord(record);
pp.setCommand(newCommand);
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -24,7 +24,6 @@
import java.sql.Connection;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -110,7 +109,7 @@
private final class ViewDefinitionMetadataWrapper extends
BasicQueryMetadataWrapper {
- private Map<List<String>, QueryNode> qnodes = new HashMap<List<String>, QueryNode>();
+ private Map<Object, QueryNode> qnodes = new HashMap<Object, QueryNode>();
private ViewDefinitionMetadataWrapper(
QueryMetadataInterface actualMetadata) {
@@ -125,9 +124,8 @@
String schema = getName(getModelID(groupID));
String viewName = getName(groupID);
- List<String> key = Arrays.asList(schema, viewName);
- QueryNode cached = qnodes.get(key);
+ QueryNode cached = qnodes.get(groupID);
if (cached != null) {
return cached;
}
@@ -135,14 +133,14 @@
//TODO: could just consider moving up when the context is created
throw new AssertionError("Should not attempt to resolve a view before the context has been set."); //$NON-NLS-1$
}
- ViewDefinition vd = metadataProvider.getViewDefinition(getName(getModelID(groupID)), getName(groupID), context);
+ ViewDefinition vd = metadataProvider.getViewDefinition(schema, viewName, context);
if (vd != null) {
result = new QueryNode(DataTypeManager.getCanonicalString(vd.getSql()));
if (vd.getScope() == MetadataProvider.Scope.USER) {
result.setUser(context.getUserName());
}
}
- qnodes.put(key, result);
+ qnodes.put(groupID, result);
return result;
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -480,7 +480,7 @@
CachedResults cr = new CachedResults();
cr.setCommand(originalCommand);
cr.setAnalysisRecord(analysisRecord);
- cr.setResults(resultsBuffer);
+ cr.setResults(resultsBuffer, processor.getProcessorPlan());
if (originalCommand.getCacheHint() != null) {
LogManager.logDetail(LogConstants.CTX_DQP, requestID, "Using cache hint", originalCommand.getCacheHint()); //$NON-NLS-1$
resultsBuffer.setPrefersMemory(originalCommand.getCacheHint().getPrefersMemory());
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -61,6 +61,8 @@
private Cache tupleBatchCache;
private int maxSize = DEFAULT_MAX_SIZE_TOTAL;
+ private long modTime;
+ private Type type;
private AtomicInteger cacheHit = new AtomicInteger();
private AtomicInteger totalRequests = new AtomicInteger();
@@ -95,6 +97,8 @@
this.tupleBatchCache = this.distributedCache;
}
}
+ this.modTime = config.getMaxStaleness()*1000;
+ this.type = type;
}
public T get(CacheID id){
@@ -115,7 +119,7 @@
result = distributedCache.get(id);
}
- if (result != null && result instanceof Cachable) {
+ if (result instanceof Cachable) {
Cachable c = (Cachable)result;
if (!c.restore(this.tupleBatchCache, this.bufferManager)) {
result = null;
@@ -124,6 +128,19 @@
}
if (result != null) {
+ if (result instanceof Cachable) {
+ Cachable c = (Cachable)result;
+ AccessInfo info = c.getAccessInfo();
+ if (info != null && !info.validate(type == Type.RESULTSET, modTime)) {
+ LogManager.logTrace(LogConstants.CTX_DQP, "Invalidating cache entry", id); //$NON-NLS-1$
+ if (id.getSessionId() == null) {
+ this.distributedCache.remove(id);
+ } else {
+ this.localCache.remove(id);
+ }
+ return null;
+ }
+ }
LogManager.logTrace(LogConstants.CTX_DQP, "Cache hit for", id); //$NON-NLS-1$
cacheHit.getAndIncrement();
} else {
@@ -307,4 +324,8 @@
public void setBufferManager(BufferManager bufferManager) {
this.bufferManager = bufferManager;
}
+
+ public void setModTime(long modTime) {
+ this.modTime = modTime;
+ }
}
Added: trunk/engine/src/main/java/org/teiid/events/EventDistributor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/events/EventDistributor.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/events/EventDistributor.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -0,0 +1,31 @@
+/*
+ * 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.events;
+
+import java.util.List;
+
+public interface EventDistributor {
+ 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);
+}
Property changes on: trunk/engine/src/main/java/org/teiid/events/EventDistributor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
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-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataID.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -48,7 +48,7 @@
private static final long serialVersionUID = -1879211827339120135L;
private static final int LOCAL_CACHE_SIZE = 8;
- static class TableData {
+ public static class TableData {
Collection<TempMetadataID> accessPatterns;
List<TempMetadataID> elements;
int cardinality = QueryMetadataInterface.UNKNOWN_CARDINALITY;
@@ -58,6 +58,15 @@
CacheHint cacheHint;
List<List<TempMetadataID>> keys;
List<List<TempMetadataID>> indexes;
+ long lastModified;
+
+ public long getLastModified() {
+ return lastModified;
+ }
+
+ public void setLastModified(long lastModified) {
+ this.lastModified = lastModified;
+ }
}
private static TableData DUMMY_DATA = new TableData();
@@ -336,7 +345,7 @@
this.getTableData().keys.add(key);
}
- private TableData getTableData() {
+ public TableData getTableData() {
if (data == null) {
return DUMMY_DATA;
}
@@ -373,5 +382,5 @@
}
return this.name;
}
-
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -43,7 +43,8 @@
*/
public class TempMetadataStore implements Serializable {
- // UPPER CASE TEMP GROUP NAME --> TempMetadataID for group
+ private static final long serialVersionUID = 4055072385672022478L;
+ // UPPER CASE TEMP GROUP NAME --> TempMetadataID for group
private Map<String, TempMetadataID> tempGroups;
/**
@@ -216,7 +217,7 @@
* @return Metadata ID or null if not found
*/
public List<TempMetadataID> getTempElementElementIDs(String tempGroup) {
- TempMetadataID groupID = tempGroups.get(tempGroup.toUpperCase());
+ TempMetadataID groupID = getTempGroupID(tempGroup);
if(groupID != null) {
return groupID.getElements();
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -36,6 +36,7 @@
import org.teiid.core.id.IDGenerator;
import org.teiid.core.id.IntegerIDFactory;
import org.teiid.dqp.internal.process.PreparedPlan;
+import org.teiid.metadata.Table;
import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.metadata.QueryMetadataInterface;
@@ -116,14 +117,18 @@
PreparedPlan pp = context.getPlan(fullName);
if (pp == null) {
Determinism determinismLevel = context.resetDeterminismLevel();
- ProcessorPlan plan = planProcedure(command, metadata, idGenerator, capFinder, analysisRecord, context);
+ CommandContext clone = context.clone();
+ ProcessorPlan plan = planProcedure(command, metadata, idGenerator, capFinder, analysisRecord, clone);
//note that this is not a full prepared plan. It is not usable by user queries.
pp = new PreparedPlan();
- pp.setPlan(plan);
+ pp.setPlan(plan, clone);
context.putPlan(fullName, pp, context.getDeterminismLevel());
context.setDeterminismLevel(determinismLevel);
}
result = pp.getPlan().clone();
+ for (Table t : pp.getAccessInfo().getViewsAccessed()) {
+ context.accessedView(t);
+ }
}
// propagate procedure parameters to the plan to allow runtime type checking
ProcedureContainer container = (ProcedureContainer)cupc.getUserCommand();
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -33,8 +33,6 @@
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryPlannerException;
-import org.teiid.api.exception.query.QueryResolverException;
-import org.teiid.api.exception.query.QueryValidatorException;
import org.teiid.client.plan.Annotation;
import org.teiid.client.plan.Annotation.Priority;
import org.teiid.common.buffer.LobManager;
@@ -43,13 +41,13 @@
import org.teiid.core.id.IDGenerator;
import org.teiid.dqp.internal.process.Request;
import org.teiid.language.SQLConstants;
+import org.teiid.metadata.Table;
import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataAdapter;
import org.teiid.query.metadata.TempMetadataID;
-import org.teiid.query.metadata.TempMetadataStore;
import org.teiid.query.optimizer.QueryOptimizer;
import org.teiid.query.optimizer.TriggerActionPlanner;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
@@ -1089,9 +1087,13 @@
CacheHint hint = null;
boolean isImplicitGlobal = matMetadataId == null;
if (isImplicitGlobal) {
- matTableName = MAT_PREFIX + metadata.getFullName(metadataID);
- matMetadataId = getGlobalTempTableMetadataId(virtualGroup, matTableName, context, metadata, analysisRecord);
- hint = ((TempMetadataID)matMetadataId).getCacheHint();
+ TempMetadataID tid = context.getGlobalTableStore().getGlobalTempTableMetadataId(metadataID, metadata);
+ matTableName = tid.getID();
+ hint = tid.getCacheHint();
+ if (hint != null) {
+ recordAnnotation(analysisRecord, Annotation.MATERIALIZED_VIEW, Priority.LOW, "SimpleQueryResolver.cache_hint_used", virtualGroup, matTableName, tid); //$NON-NLS-1$
+ }
+ matMetadataId = tid;
} else {
matTableName = metadata.getFullName(matMetadataId);
}
@@ -1111,7 +1113,10 @@
}
} else {
// Not a materialized view - query the primary transformation
- qnode = metadata.getVirtualPlan(metadataID);
+ qnode = metadata.getVirtualPlan(metadataID);
+ if (metadataID instanceof Table) {
+ this.context.accessedView((Table)metadataID);
+ }
}
Command result = (Command)QueryResolver.resolveView(virtualGroup, qnode, cacheString, metadata).getCommand().clone();
@@ -1128,59 +1133,6 @@
return query;
}
- public static Object getGlobalTempTableMetadataId(GroupSymbol table, String matTableName, CommandContext context, QueryMetadataInterface metadata, AnalysisRecord analysisRecord)
- throws QueryMetadataException, TeiidComponentException, QueryResolverException, QueryValidatorException {
- TempMetadataStore store = context.getGlobalTableStore().getMetadataStore();
- TempMetadataID id = store.getTempGroupID(matTableName);
- //define the table preserving the primary key
- if (id == null) {
- synchronized (table.getMetadataID()) {
- id = store.getTempGroupID(matTableName);
- if (id == null) {
- //this is really just temporary and will be replaced by the real table
- id = store.addTempGroup(matTableName, ResolverUtil.resolveElementsInGroup(table, metadata), false, true);
- id.setQueryNode(metadata.getVirtualPlan(table.getMetadataID()));
- id.setCardinality(metadata.getCardinality(table.getMetadataID()));
-
- Object pk = metadata.getPrimaryKey(table.getMetadataID());
- if (pk != null) {
- ArrayList<TempMetadataID> primaryKey = resolveIndex(metadata, id, pk);
- id.setPrimaryKey(primaryKey);
- }
- Collection keys = metadata.getUniqueKeysInGroup(table.getMetadataID());
- for (Object key : keys) {
- id.addUniqueKey(resolveIndex(metadata, id, key));
- }
- Collection indexes = metadata.getIndexesInGroup(table.getMetadataID());
- for (Object index : indexes) {
- id.addIndex(resolveIndex(metadata, id, index));
- }
- Command c = (Command)QueryResolver.resolveView(table, metadata.getVirtualPlan(table.getMetadataID()), SQLConstants.Reserved.SELECT, metadata).getCommand().clone();
- CacheHint hint = c.getCacheHint();
- if (hint != null) {
- recordAnnotation(analysisRecord, Annotation.MATERIALIZED_VIEW, Priority.LOW, "SimpleQueryResolver.cache_hint_used", table, matTableName, id.getCacheHint()); //$NON-NLS-1$
- }
- id.setCacheHint(hint);
- }
- }
- } else if (id.getCacheHint() != null) {
- recordAnnotation(analysisRecord, Annotation.MATERIALIZED_VIEW, Priority.LOW, "SimpleQueryResolver.cache_hint_used", table, matTableName, id.getCacheHint()); //$NON-NLS-1$
- }
- return id;
- }
-
- private static ArrayList<TempMetadataID> resolveIndex(
- QueryMetadataInterface metadata, TempMetadataID id, Object pk)
- throws TeiidComponentException, QueryMetadataException {
- List cols = metadata.getElementIDsInKey(pk);
- ArrayList<TempMetadataID> primaryKey = new ArrayList<TempMetadataID>(cols.size());
- for (Object coldId : cols) {
- int pos = metadata.getPosition(coldId) - 1;
- primaryKey.add(id.getElements().get(pos));
- }
- return primaryKey;
- }
-
public static boolean isNoCacheGroup(QueryMetadataInterface metadata,
Object metadataID,
Option option) throws QueryMetadataException,
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -299,7 +299,7 @@
//NOTE: we could tap into the relationalplanner at a lower level to get this in a plan node form,
//the major benefit would be to reuse the dependent join planning logic if possible.
if (analysisRecord != null && analysisRecord.recordDebug()) {
- analysisRecord.println("Attempting to plan " + crit + " as a mege join"); //$NON-NLS-1$ //$NON-NLS-2$
+ analysisRecord.println("Attempting to plan " + crit + " as a merge join"); //$NON-NLS-1$ //$NON-NLS-2$
}
RelationalPlan subPlan = (RelationalPlan)QueryOptimizer.optimizePlan(plannedResult.query, metadata, idGenerator, capFinder, analysisRecord, context);
Number planCardinality = subPlan.getRootNode().getEstimateNodeCardinality();
Modified: trunk/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -33,6 +33,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.util.VariableContext;
import org.teiid.query.util.CommandContext;
@@ -237,5 +238,12 @@
}
return true;
}
+
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ for (int i = 0; i < getPlanCount(); i++) {
+ updatePlans[i].getAccessedGroups(groups);
+ }
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -37,6 +37,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.processor.BatchCollector.BatchProducer;
+import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.util.CommandContext;
@@ -176,4 +177,6 @@
return false;
}
+ public abstract void getAccessedGroups(List<GroupSymbol> groups);
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -26,6 +26,7 @@
import static org.teiid.query.analysis.AnalysisRecord.*;
+import java.util.List;
import java.util.Map;
import org.teiid.client.plan.PlanNode;
@@ -102,5 +103,10 @@
public ProcessorPlan getCommand() { //Defect 13291 - added method to support changes to ProcedurePlan
return plan;
}
+
+ @Override
+ public void getChildPlans(List<ProcessorPlan> plans) {
+ plans.add(this.plan);
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -39,6 +39,7 @@
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
+import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.util.CommandContext;
@@ -161,5 +162,11 @@
public boolean requiresTransaction(boolean transactionalReads) {
return true;
}
+
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ this.queryPlan.getAccessedGroups(groups);
+ this.rowProcedure.getAccessedGroups(groups);
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/IfInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/IfInstruction.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/IfInstruction.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -24,11 +24,14 @@
import static org.teiid.query.analysis.AnalysisRecord.*;
+import java.util.List;
+
import org.teiid.client.plan.PlanNode;
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.logging.LogManager;
+import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Criteria;
@@ -138,4 +141,12 @@
return props;
}
+ @Override
+ public void getChildPlans(List<ProcessorPlan> plans) {
+ ifProgram.getChildPlans(plans);
+ if (elseProgram != null) {
+ elseProgram.getChildPlans(plans);
+ }
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -107,5 +107,11 @@
public void postInstruction(ProcedurePlan procEnv) throws TeiidComponentException {
procEnv.removeResults(rsName);
}
+
+ @Override
+ public void getChildPlans(List<ProcessorPlan> plans) {
+ super.getChildPlans(plans);
+ this.loopProgram.getChildPlans(plans);
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -65,6 +65,7 @@
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
+import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.util.VariableContext;
import org.teiid.query.tempdata.TempTableStore;
@@ -713,4 +714,20 @@
return requiresTransaction || transactionalReads;
}
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ ArrayList<ProcessorPlan> plans = new ArrayList<ProcessorPlan>();
+ this.originalProgram.getChildPlans(plans);
+ LinkedList<GroupSymbol> tempGroups = new LinkedList<GroupSymbol>();
+ for (ProcessorPlan processorPlan : plans) {
+ processorPlan.getAccessedGroups(tempGroups);
+ }
+ for (GroupSymbol groupSymbol : tempGroups) {
+ if (groupSymbol.isTempTable() && !groupSymbol.isGlobalTable()) {
+ continue;
+ }
+ groups.add(groupSymbol);
+ }
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -26,6 +26,7 @@
import java.util.List;
import org.teiid.client.plan.PlanNode;
+import org.teiid.query.processor.ProcessorPlan;
/**
@@ -212,5 +213,11 @@
buffer.append(counterStr + line + "\n"); //$NON-NLS-1$
}
+
+ void getChildPlans(List<ProcessorPlan> plans) {
+ for (ProgramInstruction instruction : programInstructions) {
+ instruction.getChildPlans(plans);
+ }
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/ProgramInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ProgramInstruction.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ProgramInstruction.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -59,8 +59,7 @@
* @return List of ProcessorPlan
* @since 4.2
*/
- public List<ProcessorPlan> getChildPlans() {
- return null;
+ public void getChildPlans(List<ProcessorPlan> plans) {
}
/**
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -26,9 +26,12 @@
import static org.teiid.query.analysis.AnalysisRecord.*;
+import java.util.List;
+
import org.teiid.client.plan.PlanNode;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Criteria;
@@ -89,4 +92,9 @@
public void postInstruction(ProcedurePlan procEnv) throws TeiidComponentException {
}
+ @Override
+ public void getChildPlans(List<ProcessorPlan> plans) {
+ whileProgram.getChildPlans(plans);
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -41,10 +41,13 @@
import org.teiid.query.processor.QueryProcessor;
import org.teiid.query.processor.relational.ProjectIntoNode.Mode;
import org.teiid.query.sql.LanguageObject;
+import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Create;
import org.teiid.query.sql.lang.Insert;
import org.teiid.query.sql.lang.QueryCommand;
import org.teiid.query.sql.lang.WithQueryCommand;
+import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.visitor.GroupCollectorVisitor;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.util.CommandContext;
@@ -287,7 +290,29 @@
return false;
}
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ getAccessedGroups(groups, this.root);
+ }
+ void getAccessedGroups(List<GroupSymbol> groups, RelationalNode node) {
+ if (node instanceof AccessNode) {
+ Command c = ((AccessNode)node).getCommand();
+ if (c instanceof QueryCommand) {
+ QueryCommand qc = (QueryCommand)c;
+ groups.addAll(GroupCollectorVisitor.getGroupsIgnoreInlineViews(qc, true));
+ }
+ } else if (node instanceof PlanExecutionNode) {
+ PlanExecutionNode pen = (PlanExecutionNode)node;
+ pen.getProcessorPlan().getAccessedGroups(groups);
+ }
+ for (RelationalNode child : node.getChildren()) {
+ if (child != null) {
+ getAccessedGroups(groups, child);
+ }
+ }
+ }
+
@Override
public TupleBuffer getFinalBuffer() throws BlockedException, TeiidComponentException, TeiidProcessingException {
return root.getFinalBuffer();
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -22,7 +22,7 @@
package org.teiid.query.processor.xml;
-import static org.teiid.query.analysis.AnalysisRecord.PROP_OUTPUT_COLS;
+import static org.teiid.query.analysis.AnalysisRecord.*;
import java.io.IOException;
import java.io.InputStream;
@@ -478,4 +478,9 @@
public Program getOriginalProgram() {
return this.originalProgram;
}
+
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ //TODO: add support
+ }
}
\ No newline at end of file
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-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -482,6 +482,7 @@
}
public int truncate() {
+ this.tid.getTableData().setLastModified(System.currentTimeMillis());
return tree.truncate();
}
@@ -512,6 +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());
return CollectionTupleSource.createUpdateCountTupleSource(updateCount);
}
@@ -577,6 +579,9 @@
};
int updateCount = up.process();
+ if (updateCount > 0) {
+ tid.getTableData().setLastModified(System.currentTimeMillis());
+ }
return CollectionTupleSource.createUpdateCountTupleSource(updateCount);
}
@@ -609,6 +614,9 @@
};
int updateCount = up.process();
tid.setCardinality(tree.getRowCount());
+ if (updateCount > 0) {
+ tid.getTableData().setLastModified(System.currentTimeMillis());
+ }
return CollectionTupleSource.createUpdateCountTupleSource(updateCount);
}
@@ -638,6 +646,7 @@
index.tree.remove(tuple);
}
}
+ tid.getTableData().setLastModified(System.currentTimeMillis());
return result;
}
List<?> result = tree.insert(tuple, InsertMode.UPDATE, -1);
@@ -647,6 +656,7 @@
index.tree.insert(tuple, InsertMode.UPDATE, -1);
}
}
+ tid.getTableData().setLastModified(System.currentTimeMillis());
return result;
} finally {
lock.writeLock().unlock();
@@ -699,5 +709,9 @@
STree getTree() {
return tree;
}
+
+ public TempMetadataID getMetadataId() {
+ return tid;
+ }
}
\ No newline at end of file
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-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -54,12 +54,12 @@
import org.teiid.dqp.internal.process.CachedResults;
import org.teiid.dqp.internal.process.SessionAwareCache;
import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
+import org.teiid.events.EventDistributor;
import org.teiid.language.SQLConstants.Reserved;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.metadata.QueryMetadataInterface;
@@ -144,6 +144,7 @@
private Cache<MatTableKey, MatTableEntry> tables;
private SessionAwareCache<CachedResults> distributedCache;
+ private EventDistributor eventDistributor;
public TempTableDataManager(ProcessorDataManager processorDataManager, BufferManager bufferManager,
Executor executor, SessionAwareCache<CachedResults> cache, SessionAwareCache<CachedResults> distibutedCache, CacheFactory cacheFactory){
@@ -158,6 +159,10 @@
}
}
+ public void setEventDistributor(EventDistributor eventDistributor) {
+ this.eventDistributor = eventDistributor;
+ }
+
public TupleSource registerRequest(
CommandContext context,
Command command,
@@ -283,7 +288,7 @@
BatchCollector bc = qp.createBatchCollector();
TupleBuffer tb = bc.collectTuples();
CachedResults cr = new CachedResults();
- cr.setResults(tb);
+ cr.setResults(tb, qp.getProcessorPlan());
cr.setHint(hint);
if (hint != null && hint.getDeterminism() != null) {
LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { "Cache hint modified the query determinism from ",determinismLevel, " to ", hint.getDeterminism() }); //$NON-NLS-1$ //$NON-NLS-2$
@@ -303,8 +308,9 @@
TempTableStore globalStore = context.getGlobalTableStore();
if (StringUtil.endsWithIgnoreCase(proc.getProcedureCallableName(), REFRESHMATVIEW)) {
Object groupID = validateMatView(metadata, proc);
+ Object matTableId = context.getGlobalTableStore().getGlobalTempTableMetadataId(groupID, metadata);
String matViewName = metadata.getFullName(groupID);
- String matTableName = RelationalPlanner.MAT_PREFIX+matViewName.toUpperCase();
+ String matTableName = metadata.getFullName(matTableId);
LogManager.logDetail(LogConstants.CTX_MATVIEWS, "processing refreshmatview for", matViewName); //$NON-NLS-1$
MatTableInfo info = globalStore.getMatTableInfo(matTableName);
boolean invalidate = Boolean.TRUE.equals(((Constant)proc.getParameter(1).getExpression()).getValue());
@@ -315,9 +321,6 @@
if (oldState == MatState.LOADING) {
return CollectionTupleSource.createUpdateCountTupleSource(-1);
}
- GroupSymbol group = new GroupSymbol(matViewName);
- group.setMetadataID(groupID);
- Object matTableId = RelationalPlanner.getGlobalTempTableMetadataId(group, matTableName, context, metadata, AnalysisRecord.createNonRecordingRecord());
GroupSymbol matTable = new GroupSymbol(matTableName);
matTable.setMetadataID(matTableId);
int rowCount = loadGlobalTable(context, matTable, matTableName, globalStore, info, null);
@@ -349,20 +352,28 @@
QueryProcessor qp = context.getQueryProcessorFactory().createQueryProcessor(queryString, matViewName.toUpperCase(), context, key.getValue());
qp.setNonBlocking(true);
TupleSource ts = new BatchCollector.BatchProducerTupleSource(qp);
- tempTable = globalStore.getOrCreateTempTable(matTableName, new Query(), bufferManager, false);
List<?> tuple = ts.nextTuple();
boolean delete = false;
if (tuple == null) {
delete = true;
tuple = Arrays.asList(key.getValue());
}
- List<?> result = tempTable.updateTuple(tuple, delete);
- //TODO: maintain a table log and distribute the events
+ List<?> result = updateMatViewRow(globalStore, matTableName, tuple, delete);
+ if (result != null && eventDistributor != null) {
+ this.eventDistributor.updateMatViewRow(context.getVdbName(), context.getVdbVersion(), matTableName, tuple, delete);
+ }
return CollectionTupleSource.createUpdateCountTupleSource(result != null ? 1 : 0);
}
return null;
}
+ public List<?> updateMatViewRow(TempTableStore globalStore,
+ String matTableName, List<?> tuple, boolean delete)
+ throws QueryProcessingException, TeiidComponentException {
+ TempTable tempTable = globalStore.getOrCreateTempTable(matTableName, new Query(), bufferManager, false);
+ return tempTable.updateTuple(tuple, delete);
+ }
+
private Object validateMatView(QueryMetadataInterface metadata,
StoredProcedure proc) throws TeiidComponentException,
TeiidProcessingException {
@@ -508,7 +519,7 @@
CachedResults cr = new CachedResults();
BatchCollector bc = qp.createBatchCollector();
TupleBuffer tb = bc.collectTuples();
- cr.setResults(tb);
+ cr.setResults(tb, qp.getProcessorPlan());
touchTable(context, fullName, true);
this.distributedCache.put(cid, Determinism.VDB_DETERMINISTIC, cr, info.getTtl());
ts = tb.createIndexedTupleSource();
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -23,19 +23,29 @@
package org.teiid.query.tempdata;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
+import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryProcessingException;
+import org.teiid.api.exception.query.QueryResolverException;
+import org.teiid.api.exception.query.QueryValidatorException;
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.TeiidComponentException;
+import org.teiid.language.SQLConstants;
import org.teiid.query.QueryPlugin;
+import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataID;
import org.teiid.query.metadata.TempMetadataStore;
+import org.teiid.query.optimizer.relational.RelationalPlanner;
+import org.teiid.query.resolver.QueryResolver;
import org.teiid.query.resolver.command.TempTableResolver;
+import org.teiid.query.resolver.util.ResolverUtil;
+import org.teiid.query.sql.lang.CacheHint;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Create;
import org.teiid.query.sql.lang.Insert;
@@ -235,5 +245,55 @@
public Set<String> getAllTempTables() {
return new HashSet<String>(this.groupToTupleSourceID.keySet());
}
+
+ public TempMetadataID getGlobalTempTableMetadataId(Object viewId, QueryMetadataInterface metadata)
+ throws QueryMetadataException, TeiidComponentException, QueryResolverException, QueryValidatorException {
+ String matViewName = metadata.getFullName(viewId);
+ String matTableName = RelationalPlanner.MAT_PREFIX+matViewName.toUpperCase();
+ GroupSymbol group = new GroupSymbol(matViewName);
+ group.setMetadataID(viewId);
+ TempMetadataID id = tempMetadataStore.getTempGroupID(matTableName);
+ //define the table preserving the key/index information and ensure that only a single instance exists
+ if (id == null) {
+ synchronized (viewId) {
+ id = tempMetadataStore.getTempGroupID(matTableName);
+ if (id == null) {
+ id = tempMetadataStore.addTempGroup(matTableName, ResolverUtil.resolveElementsInGroup(group, metadata), false, true);
+ id.setQueryNode(metadata.getVirtualPlan(viewId));
+ id.setCardinality(metadata.getCardinality(viewId));
+
+ Object pk = metadata.getPrimaryKey(viewId);
+ if (pk != null) {
+ ArrayList<TempMetadataID> primaryKey = resolveIndex(metadata, id, pk);
+ id.setPrimaryKey(primaryKey);
+ }
+ Collection keys = metadata.getUniqueKeysInGroup(viewId);
+ for (Object key : keys) {
+ id.addUniqueKey(resolveIndex(metadata, id, key));
+ }
+ Collection indexes = metadata.getIndexesInGroup(viewId);
+ for (Object index : indexes) {
+ id.addIndex(resolveIndex(metadata, id, index));
+ }
+ Command c = (Command)QueryResolver.resolveView(group, metadata.getVirtualPlan(viewId), SQLConstants.Reserved.SELECT, metadata).getCommand().clone();
+ CacheHint hint = c.getCacheHint();
+ id.setCacheHint(hint);
+ }
+ }
+ }
+ return id;
+ }
+
+ static ArrayList<TempMetadataID> resolveIndex(
+ QueryMetadataInterface metadata, TempMetadataID id, Object pk)
+ throws TeiidComponentException, QueryMetadataException {
+ List cols = metadata.getElementIDsInKey(pk);
+ ArrayList<TempMetadataID> primaryKey = new ArrayList<TempMetadataID>(cols.size());
+ for (Object coldId : cols) {
+ int pos = metadata.getPosition(coldId) - 1;
+ primaryKey.add(id.getElements().get(pos));
+ }
+ return primaryKey;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -23,6 +23,8 @@
package org.teiid.query.util;
import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.LinkedList;
import java.util.Properties;
import java.util.Random;
@@ -38,6 +40,7 @@
import org.teiid.dqp.internal.process.PreparedPlan;
import org.teiid.dqp.internal.process.SessionAwareCache;
import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
+import org.teiid.metadata.Table;
import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.query.QueryPlugin;
import org.teiid.query.eval.SecurityFunctionEvaluator;
@@ -122,6 +125,7 @@
private TempTableStore tempTableStore;
private LinkedList<String> recursionStack;
private boolean nonBlocking;
+ private HashSet<Table> viewsAccessed;
/**
* Construct a new context.
@@ -533,4 +537,18 @@
this.globalState.subject = subject;
}
+ public void accessedView(Table id) {
+ if (this.viewsAccessed == null) {
+ this.viewsAccessed = new HashSet<Table>();
+ }
+ this.viewsAccessed.add(id);
+ }
+
+ public Set<Table> getViewsAccessed() {
+ if (this.viewsAccessed == null) {
+ return Collections.emptySet();
+ }
+ return viewsAccessed;
+ }
+
}
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-04-12 19:35:57 UTC (rev 3083)
@@ -894,7 +894,7 @@
datasource_not_found=Data Source {0} not accessible.
RequestWorkItem.cache_nondeterministic=Caching command "{0}" at a session level, but less deterministic functions were evaluated.
-not_found_cache=Results not found in cache
+not_found_cache=Failed to restore results
failed_to_cache=Failed to store the result set contents to disk.
failed_to_unwrap_connection=Failed to unwrap the source connection.
connection_factory_not_found=Failed to find the Connection Factory with JNDI name {0}. Please check the name or deploy the Connection Factory with specified name.
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -23,10 +23,6 @@
import static org.junit.Assert.*;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.util.Arrays;
import java.util.List;
@@ -37,13 +33,19 @@
import org.teiid.common.buffer.TupleBuffer;
import org.teiid.common.buffer.TestTupleBuffer.FakeBatchManager;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.util.UnitTestUtil;
import org.teiid.dqp.service.FakeBufferService;
+import org.teiid.metadata.Table;
+import org.teiid.query.processor.FakeProcessorPlan;
+import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Query;
import org.teiid.query.sql.symbol.ElementSymbol;
+import org.teiid.query.unittest.FakeMetadataFactory;
+import org.teiid.query.unittest.RealMetadataFactory;
+import org.teiid.query.util.CommandContext;
-
+@SuppressWarnings({"nls", "unchecked"})
public class TestCachedResults {
-
@Test
public void testCaching() throws Exception {
@@ -70,10 +72,15 @@
BufferManager bm = fbs.getBufferManager();
CachedResults results = new CachedResults();
- results.setResults(tb);
+ ProcessorPlan plan = new FakeProcessorPlan(0);
+ CommandContext cc = new CommandContext();
+ Table t = RealMetadataFactory.exampleBQT().getGroupID("bqt1.smalla");
+ cc.accessedView(t);
+ plan.setContext(cc);
+ results.setResults(tb, plan);
results.setCommand(new Query());
Cache cache = new DefaultCache("dummy"); //$NON-NLS-1$
-
+ long ts = results.getAccessInfo().getCreationTime();
// simulate the jboss-cache remote transport, where the batches are remotely looked up
// in cache
for (int row=1; row<=tb.getRowCount();row+=4) {
@@ -82,14 +89,9 @@
results.prepare(cache, bm);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(results);
- oos.close();
+ CachedResults cachedResults = UnitTestUtil.helpSerialize(results);
- ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
- CachedResults cachedResults = (CachedResults)ois.readObject();
- ois.close();
+ FakeMetadataFactory.buildWorkContext(RealMetadataFactory.exampleBQT());
cachedResults.restore(cache, bm);
@@ -103,5 +105,6 @@
assertArrayEquals(tb.getBatch(1).getAllTuples(), cachedTb.getBatch(1).getAllTuples());
assertArrayEquals(tb.getBatch(9).getAllTuples(), cachedTb.getBatch(9).getAllTuples());
+ assertTrue(ts - cachedResults.getAccessInfo().getCreationTime() <= 5000);
}
}
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-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -28,6 +28,7 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
import org.junit.After;
import org.junit.Before;
@@ -39,12 +40,15 @@
import org.teiid.cache.DefaultCacheFactory;
import org.teiid.client.RequestMessage;
import org.teiid.client.ResultsMessage;
+import org.teiid.client.RequestMessage.StatementType;
+import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.BufferManagerFactory;
import org.teiid.common.buffer.impl.BufferManagerImpl;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
import org.teiid.dqp.internal.datamgr.FakeTransactionService;
import org.teiid.dqp.internal.process.AbstractWorkItem.ThreadState;
import org.teiid.dqp.service.AutoGenDataService;
-import org.teiid.dqp.service.FakeBufferService;
+import org.teiid.dqp.service.BufferService;
import org.teiid.metadata.MetadataProvider;
import org.teiid.query.optimizer.TestOptimizer;
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
@@ -70,7 +74,13 @@
Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(agds);
core = new DQPCore();
- core.setBufferService(new FakeBufferService());
+ core.setBufferService(new BufferService() {
+
+ @Override
+ public BufferManager getBufferManager() {
+ return BufferManagerFactory.createBufferManager();
+ }
+ });
core.setCacheFactory(new DefaultCacheFactory());
core.setTransactionService(new FakeTransactionService());
@@ -78,6 +88,7 @@
config.setMaxActivePlans(1);
config.setUserRequestSourceConcurrency(2);
core.start(config);
+ core.getPrepPlanCache().setModTime(1);
}
@After public void tearDown() throws Exception {
@@ -239,13 +250,13 @@
DQPWorkContext.getWorkContext().getSession().setUserName(userName);
((BufferManagerImpl)core.getBufferManager()).setProcessorBatchSize(2);
Future<ResultsMessage> message = core.executeRequest(reqMsg.getExecutionId(), reqMsg);
- ResultsMessage rm = message.get(5000, TimeUnit.MILLISECONDS);
+ ResultsMessage rm = message.get(500000, TimeUnit.MILLISECONDS);
assertNull(rm.getException());
assertEquals(2, rm.getResults().length);
RequestWorkItem item = core.getRequestWorkItem(DQPWorkContext.getWorkContext().getRequestID(reqMsg.getExecutionId()));
message = core.processCursorRequest(reqMsg.getExecutionId(), 3, 2);
- rm = message.get(5000, TimeUnit.MILLISECONDS);
+ rm = message.get(500000, TimeUnit.MILLISECONDS);
assertNull(rm.getException());
assertEquals(2, rm.getResults().length);
//ensure that we are idle
@@ -277,7 +288,7 @@
DQPWorkContext.getWorkContext().getSession().setUserName(userName);
((BufferManagerImpl)core.getBufferManager()).setProcessorBatchSize(2);
Future<ResultsMessage> message = core.executeRequest(reqMsg.getExecutionId(), reqMsg);
- ResultsMessage rm = message.get(5000, TimeUnit.MILLISECONDS);
+ ResultsMessage rm = message.get(500000, TimeUnit.MILLISECONDS);
assertNull(rm.getException());
assertEquals(2, rm.getResults().length);
RequestWorkItem item = core.getRequestWorkItem(DQPWorkContext.getWorkContext().getRequestID(reqMsg.getExecutionId()));
@@ -341,6 +352,44 @@
assertEquals("something else", rm.getResults()[0].get(0)); //$NON-NLS-1$
}
+ @Test public void testPreparedPlanInvalidation() throws Exception {
+ String sql = "insert into #temp select * FROM vqt.SmallB"; //$NON-NLS-1$
+ String userName = "1"; //$NON-NLS-1$
+ int sessionid = 1; //$NON-NLS-1$
+ RequestMessage reqMsg = exampleRequestMessage(sql);
+ ResultsMessage 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$
+
+ 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(1, this.core.getPrepPlanCache().getCacheHitCount());
+
+ Thread.sleep(100);
+
+ sql = "delete from #temp"; //$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(0, rm.getResults().length); //$NON-NLS-1$
+
+ assertEquals(1, this.core.getPrepPlanCache().getCacheHitCount());
+ }
+
public void helpTestVisibilityFails(String sql) throws Exception {
RequestMessage reqMsg = exampleRequestMessage(sql);
reqMsg.setTxnAutoWrapMode(RequestMessage.TXN_WRAP_OFF);
@@ -356,15 +405,10 @@
private ResultsMessage helpExecute(String sql, String userName, int sessionid, boolean txnAutoWrap) throws Exception {
RequestMessage reqMsg = exampleRequestMessage(sql);
- DQPWorkContext.getWorkContext().getSession().setSessionId(String.valueOf(sessionid));
- DQPWorkContext.getWorkContext().getSession().setUserName(userName);
if (txnAutoWrap) {
reqMsg.setTxnAutoWrapMode(RequestMessage.TXN_WRAP_ON);
}
-
- Future<ResultsMessage> message = core.executeRequest(reqMsg.getExecutionId(), reqMsg);
- assertNotNull(core.getClientState(String.valueOf(sessionid), false));
- ResultsMessage results = message.get(5000, TimeUnit.MILLISECONDS);
+ ResultsMessage results = execute(userName, sessionid, reqMsg);
core.terminateSession(String.valueOf(sessionid));
assertNull(core.getClientState(String.valueOf(sessionid), false));
if (results.getException() != null) {
@@ -372,4 +416,15 @@
}
return results;
}
+
+ private ResultsMessage execute(String userName, int sessionid, RequestMessage reqMsg)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ DQPWorkContext.getWorkContext().getSession().setSessionId(String.valueOf(sessionid));
+ DQPWorkContext.getWorkContext().getSession().setUserName(userName);
+
+ Future<ResultsMessage> message = core.executeRequest(reqMsg.getExecutionId(), reqMsg);
+ assertNotNull(core.getClientState(String.valueOf(sessionid), false));
+ ResultsMessage results = message.get(500000, TimeUnit.MILLISECONDS);
+ return results;
+ }
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -22,10 +22,7 @@
package org.teiid.dqp.internal.process;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import java.util.ArrayList;
@@ -40,6 +37,8 @@
import org.teiid.query.processor.relational.ProjectNode;
import org.teiid.query.processor.relational.RelationalPlan;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.symbol.Reference;
+import org.teiid.query.util.CommandContext;
public class TestPreparedPlanCache {
@@ -70,7 +69,7 @@
assertNotNull("Unable to get prepared plan from cache", cache.get(id)); //$NON-NLS-1$
}
- @Test public void testget(){
+ @Test public void testGet(){
SessionAwareCache<PreparedPlan> cache = new SessionAwareCache<PreparedPlan>();
helpPutPreparedPlans(cache, token, 0, 10);
helpPutPreparedPlans(cache, token2, 0, 15);
@@ -81,7 +80,7 @@
assertEquals("Error getting plan from cache", new RelationalPlan(new ProjectNode(12)).toString(), pPlan.getPlan().toString()); //$NON-NLS-1$
assertEquals("Error getting command from cache", EXAMPLE_QUERY + 12, pPlan.getCommand().toString()); //$NON-NLS-1$
assertNotNull("Error getting plan description from cache", pPlan.getAnalysisRecord()); //$NON-NLS-1$
- assertEquals("Error gettting reference from cache", "ref12", pPlan.getReferences().get(0)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Error gettting reference from cache", new Reference(1), pPlan.getReferences().get(0)); //$NON-NLS-1$
}
@Test public void testClearAll(){
@@ -152,11 +151,11 @@
PreparedPlan pPlan = new PreparedPlan();
cache.put(id, Determinism.SESSION_DETERMINISTIC, pPlan, null);
pPlan.setCommand(dummy);
- pPlan.setPlan(new RelationalPlan(new ProjectNode(i)));
+ pPlan.setPlan(new RelationalPlan(new ProjectNode(i)), new CommandContext());
AnalysisRecord analysisRecord = new AnalysisRecord(true, false);
pPlan.setAnalysisRecord(analysisRecord);
- ArrayList refs = new ArrayList();
- refs.add("ref"+i); //$NON-NLS-1$
+ ArrayList<Reference> refs = new ArrayList<Reference>();
+ refs.add(new Reference(1));
pPlan.setReferences(refs);
}
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -55,7 +55,7 @@
import org.teiid.query.unittest.FakeMetadataFacade;
import org.teiid.query.unittest.FakeMetadataFactory;
-@SuppressWarnings("nls")
+@SuppressWarnings({"nls", "unchecked"})
public class TestPreparedStatement {
private static final int SESSION_ID = 6;
@@ -148,8 +148,7 @@
Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
};
- List values = new ArrayList();
- values.add(new Short((short)0));
+ List<?> values = Arrays.asList((short)0);
FakeDataManager dataManager = new FakeDataManager();
TestProcessor.sampleData1(dataManager);
helpTestProcessing(preparedSql, values, expected, dataManager, FakeMetadataFactory.example1Cached(), false, FakeMetadataFactory.example1VDB());
@@ -166,8 +165,7 @@
Arrays.asList(new Object[] { "foo", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
};
- List values = new ArrayList();
- values.add(new Short((short)0));
+ List<?> values = Arrays.asList((short)0);
FakeDataManager dataManager = new FakeDataManager();
TestProcessor.sampleData1(dataManager);
helpTestProcessing(preparedSql, values, expected, dataManager, FakeMetadataFactory.example1Cached(), false, true, FakeMetadataFactory.example1VDB());
@@ -256,8 +254,7 @@
// Create query
String preparedSql = "SELECT pm1.g1.e1, e2, pm1.g1.e3 as a, e4 as b FROM pm1.g1 WHERE pm1.g1.e1=?"; //$NON-NLS-1$
- List values = new ArrayList();
- values.add("a"); //$NON-NLS-1$
+ List values = Arrays.asList("a"); //$NON-NLS-1$
//Create plan
helpGetProcessorPlan(preparedSql, values, new SessionAwareCache<PreparedPlan>());
@@ -291,8 +288,7 @@
String preparedSql = "SELECT X.e1 FROM (SELECT pm1.g2.e1 FROM pm1.g2 WHERE pm1.g2.e1 = ?) as X"; //$NON-NLS-1$
//Create Request
- List values = new ArrayList();
- values.add("d"); //$NON-NLS-1$
+ List values = Arrays.asList("d"); //$NON-NLS-1$
//Create plan
helpGetProcessorPlan(preparedSql, values, new SessionAwareCache<PreparedPlan>());
@@ -305,8 +301,7 @@
//wrong type
try{
- List values = new ArrayList();
- values.add("x"); //$NON-NLS-1$
+ List values = Arrays.asList("x"); //$NON-NLS-1$
//Create plan
helpGetProcessorPlan(preparedSql, values, prepCache, SESSION_ID);
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -153,7 +153,7 @@
CommandContext cc = new CommandContext();
cc.setGlobalTableStore(new TempTableStore("SYSTEM"));
ProcessorPlan plan = TestOptimizer.getPlan(command, metadata, getGenericFinder(), analysis, true, cc);
- TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MatView.VGroup2.x FROM #MAT_MatView.VGroup2"}, plan);
+ TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MATVIEW.VGROUP2.x FROM #MAT_MATVIEW.VGROUP2"}, plan);
Collection<Annotation> annotations = analysis.getAnnotations();
assertNotNull("Expected annotations but got none", annotations); //$NON-NLS-1$
assertEquals("Expected one annotation", 1, annotations.size()); //$NON-NLS-1$
@@ -171,7 +171,7 @@
cc.setGlobalTableStore(new TempTableStore("SYSTEM"));
RelationalPlan plan = (RelationalPlan)TestOptimizer.getPlan(command, metadata, getGenericFinder(), analysis, true, cc);
assertEquals(1f, plan.getRootNode().getEstimateNodeCardinality());
- TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MatView.VGroup3.x, #MAT_MatView.VGroup3.y FROM #MAT_MatView.VGroup3 WHERE #MAT_MatView.VGroup3.x = 'foo'"}, plan);
+ TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MATVIEW.VGROUP3.x, #MAT_MATVIEW.VGROUP3.y FROM #MAT_MATVIEW.VGROUP3 WHERE #MAT_MATVIEW.VGROUP3.x = 'foo'"}, plan);
Collection<Annotation> annotations = analysis.getAnnotations();
assertNotNull("Expected annotations but got none", annotations); //$NON-NLS-1$
assertEquals("Expected one annotation", 1, annotations.size()); //$NON-NLS-1$
@@ -188,7 +188,7 @@
CommandContext cc = new CommandContext();
cc.setGlobalTableStore(new TempTableStore("SYSTEM"));
ProcessorPlan plan = TestOptimizer.getPlan(command, metadata, getGenericFinder(), analysis, true, cc);
- TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MatView.VGroup4.x FROM #MAT_MatView.VGroup4"}, plan);
+ TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MATVIEW.VGROUP4.x FROM #MAT_MATVIEW.VGROUP4"}, plan);
Collection<Annotation> annotations = analysis.getAnnotations();
assertNotNull("Expected annotations but got none", annotations); //$NON-NLS-1$
assertEquals("Expected one annotation", 2, annotations.size()); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -32,9 +32,8 @@
import org.teiid.common.buffer.BufferManager;
import org.teiid.common.buffer.TupleBatch;
import org.teiid.core.TeiidComponentException;
-import org.teiid.query.processor.ProcessorDataManager;
-import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.util.CommandContext;
@@ -141,5 +140,9 @@
public List getSchema() {
return this.outputElements;
}
+
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ }
}
Modified: trunk/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -97,6 +97,9 @@
session.setUserName("foo"); //$NON-NLS-1$
session.setVdb(vdb);
workContext.getVDB().addAttchment(QueryMetadataInterface.class, metadata);
+ if (metadata instanceof TransformationMetadata) {
+ workContext.getVDB().addAttchment(TransformationMetadata.class, (TransformationMetadata)metadata);
+ }
DQPWorkContext.setWorkContext(workContext);
return workContext;
}
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-11 15:36:29 UTC (rev 3082)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -67,6 +67,7 @@
import org.teiid.adminapi.impl.DQPManagement;
import org.teiid.adminapi.impl.RequestMetadata;
import org.teiid.adminapi.impl.SessionMetadata;
+import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
import org.teiid.adminapi.jboss.AdminProvider;
import org.teiid.cache.CacheFactory;
@@ -79,6 +80,7 @@
import org.teiid.client.util.ResultsFuture;
import org.teiid.core.ComponentNotFoundException;
import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.LRUCache;
import org.teiid.deployers.VDBLifeCycleListener;
@@ -92,12 +94,17 @@
import org.teiid.dqp.service.SessionService;
import org.teiid.dqp.service.SessionServiceException;
import org.teiid.dqp.service.TransactionService;
+import org.teiid.events.EventDistributor;
import org.teiid.jboss.IntegrationPlugin;
import org.teiid.logging.Log4jListener;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
+import org.teiid.metadata.Table;
import org.teiid.net.TeiidURL;
+import org.teiid.query.QueryPlugin;
+import org.teiid.query.metadata.TransformationMetadata;
+import org.teiid.query.tempdata.TempTableStore;
import org.teiid.security.SecurityHelper;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.ClientServiceRegistryImpl;
@@ -109,7 +116,7 @@
@ManagementObject(name="RuntimeEngineDeployer", isRuntime=true, componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
-public class RuntimeEngineDeployer extends DQPConfiguration implements DQPManagement, Serializable , ClientServiceRegistry {
+public class RuntimeEngineDeployer extends DQPConfiguration implements DQPManagement, Serializable , ClientServiceRegistry, EventDistributor {
private static final long serialVersionUID = -4676205340262775388L;
private transient SocketConfiguration jdbcSocketConfiguration;
@@ -130,6 +137,9 @@
private transient ProfileService profileService;
private transient String jndiName;
+
+ private String eventDistributorName;
+ private transient EventDistributor eventDistributor;
public RuntimeEngineDeployer() {
// TODO: this does not belong here
@@ -150,6 +160,17 @@
public void start() {
dqpCore.setTransactionService((TransactionService)LogManager.createLoggingProxy(LogConstants.CTX_TXN_LOG, transactionServerImpl, new Class[] {TransactionService.class}, MessageLevel.DETAIL));
+ if (this.eventDistributorName != null) {
+ try {
+ InitialContext ic = new InitialContext();
+ this.eventDistributor = (EventDistributor) ic.lookup(this.eventDistributorName);
+ } catch (NamingException ne) {
+ //log at a detail level since we may not be in the all profile
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, ne, IntegrationPlugin.Util.getString("jndi_failed", new Date(System.currentTimeMillis()).toString())); //$NON-NLS-1$
+ }
+ }
+ this.dqpCore.start(this);
+ this.dqpCore.getDataTierManager().setEventDistributor(this.eventDistributor);
// create the necessary services
createClientServices();
@@ -285,9 +306,6 @@
}
private void createClientServices() {
-
- this.dqpCore.start(this);
-
this.logon = new LogonImpl(this.sessionService, "teiid-cluster"); //$NON-NLS-1$
if (profileService != null) {
this.admin = AdminProvider.getLocal(profileService, vdbStatusChecker);
@@ -585,7 +603,7 @@
for(int i = 0; i < rows.length; i++) {
List row = rows[i];
- ArrayList newRow = new ArrayList();
+ ArrayList<Object> newRow = new ArrayList<Object>();
for (Object col:row) {
if (col == null) {
newRow.add("null"); //$NON-NLS-1$
@@ -613,4 +631,66 @@
}
return newResults;
}
+
+ public String getEventDistributorName() {
+ return eventDistributorName;
+ }
+
+ public void setEventDistributorName(String eventDistributorName) {
+ this.eventDistributorName = eventDistributorName;
+ }
+
+ @Override
+ public void updateMatViewRow(String vdbName, int vdbVersion, String matViewFqn, List<?> tuple,
+ boolean delete) {
+ VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
+ if (vdb == null) {
+ return;
+ }
+ TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
+ if (globalStore == null) {
+ return;
+ }
+ try {
+ this.dqpCore.getDataTierManager().updateMatViewRow(globalStore, matViewFqn, tuple, delete);
+ } catch (TeiidException e) {
+ LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ public void dataModification(String vdbName, int vdbVersion, String tableFqn) {
+ VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
+ if (vdb == null) {
+ return;
+ }
+ TransformationMetadata tm = vdb.getAttachment(TransformationMetadata.class);
+ 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$
+ }
+ }
+
+ @Override
+ public void schemaModification(String vdbName, int vdbVersion, String fqn) {
+ VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
+ if (vdb == null) {
+ return;
+ }
+ TransformationMetadata tm = vdb.getAttachment(TransformationMetadata.class);
+ 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$
+ }
+ }
}
Modified: trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-04-12 19:35:57 UTC (rev 3083)
@@ -46,3 +46,5 @@
distribute_failed=Deploy of the archive failed {0}
template_not_found=Template not found for {0}
admin_executing=JOPR admin {0} is executing command {1}
+
+DQPCore.unable_to_process_event=Unable to process event.
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/pom.xml 2011-04-12 19:35:57 UTC (rev 3083)
@@ -360,12 +360,13 @@
<dependency>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
- <version>2.6.10.GA</version>
+ <version>2.6.15.GA</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.2.5.GA</version>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
@@ -379,7 +380,8 @@
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
</exclusion>
- </exclusions>
+ </exclusions>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.man</groupId>
13 years, 9 months
teiid SVN: r3082 - in trunk/documentation/quick-start-example/src/main/docbook/en-US: content and 1 other directory.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2011-04-11 11:36:29 -0400 (Mon, 11 Apr 2011)
New Revision: 3082
Added:
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/datasources.xml
Modified:
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/download.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/example-explained.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/preface.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/quick_start_example.xml
Log:
TEIID-1519 - updated the quick-start and how it uses the dynamicvdb-portfolio and the HSQL database, instead of Derby.
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -1,36 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="step-3">
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="buildVDB">
<title>Building a VDB</title>
- <para>A VDB can be built with either the <ulink url="http://www.jboss.org/teiiddesigner.html">Designer</ulink> tool or through a
- simple XML file called a dynamic VDB. See the "dyanmicvdb-portolio" for an example dynamic VDB.
- for this example purpose we will use the a dynamic VDB. If you would like to use the
- Designer to build your VDB, check out the Designer examples. If you need to build any view layers using your source,
- you must use Designer based approach to building the VDB. A sample Designer based VDB is
- available in the "teiid-examples/dynamicvdb-portfolio/PortfolioModel" directory.</para>
-
+
+ <para>A VDB can be built with either the <ulink
+ url="http://www.jboss.org/teiiddesigner.html">Designer</ulink> tool or
+ through a simple XML file called a dynamic VDB. See the
+ "dyanmicvdb-portolio" for an example dynamic VDB. For this example we will
+ use the dynamic VDB. If you would like to use the Designer to build your
+ VDB, check out the Designer examples. If you need to build any view layers
+ using your source, you must use the Designer based approach to building the
+ VDB. A sample Designer based VDB is available in the
+ "teiid-examples/dynamicvdb-portfolio/PortfolioModel" directory.</para>
+
<section id="dynamic_vdb">
- <title>Building Dynamic VDB</title>
- <para>This XML file is defines a set of sources that need to treated as single source by the client application.
- Dynamic VDB does not yet allow for the creation of view layers. Below XML file defines "dynamicvdb-portfolio" example
- vdb.</para>
- <para>portfolio-vdb.xml (copy available in "teiid-examples/dynamicvdb-portfolio" directory)</para>
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<vdb name="DynamicPortfolio" version="1">
+ <title>Building Dynamic VDB</title>
- <description>A Dynamic VDB</description>
+ <para>This XML file defines a set of sources that can be accessed by the
+ client application. A dynamic VDB does not yet allow for the creation of
+ view layers. Below is the "dynamicvdb-portfolio" example vdb.</para>
+
+ <para>portfolio-vdb.xml (copy available in
+ "teiid-examples/dynamicvdb-portfolio" directory)</para>
+
+ <programlisting>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<vdb name="DynamicPortfolio" version="1">
+
+ <description>A Dynamic VDB</description>
- <!--
+ <!--
Setting to use connector supplied metadata. Can be "true" or "cached".
"true" will obtain metadata once for every launch of Teiid.
"cached" will save a file containing the metadata into
- the deploy/<vdb name>/<vdb version/META-INF directory
- -->
- <property name="UseConnectorMetadata" value="cached" />
+ the deploy/<vdb name>/<vdb version/META-INF directory
+ -->
+ <property name="UseConnectorMetadata" value="true" />
- <!--
+ <!--
Each model represents a access to one or more sources.
The name of the model will be used as a top level schema name
for all of the metadata imported from the connector.
@@ -38,50 +47,74 @@
NOTE: Multiple model, with different import settings, can be bound to
the same connector binding and will be treated as the same source at
runtime.
- -->
- <model name="MarketData">
- <!--
+ -->
+ <model name="MarketData">
+ <!--
Each source represents a translator and data source. There are
pre-defined translators, or you can create one. ConnectionFactories
or DataSources in JBoss AS they are typically defined using "xxx-ds.xml" files.
- -->
- <source name="text-connector" translator-name="file" connection-jndi-name="java:marketdata-file"/>
- </model>
+ -->
+ <source name="text-connector" translator-name="file" connection-jndi-name="java:marketdata-file"/>
+ </model>
- <model name="Accounts">
- <!--
+ <model name="Accounts">
+ <!--
JDBC Import settings
importer.useFullSchemaName directs the importer to drop the source
schema from the Teiid object name, so that the Teiid fully qualified name
- will be in the form of <model name>.<table name>
- -->
- <property name="importer.useFullSchemaName" value="false"/>
+ will be in the form of <model name>.<table name>
+ -->
+ <property name="importer.useFullSchemaName" value="false"/>
- <!--
- This connector is defined in the "derby-connector-ds.xml"
- -->
- <source name="derby-connector" translator-name="derby" connection-jndi-name="java:PortfolioDS"/>
- </model>
+ <!--
+ This connector is defined in the "portfoio-ds.xml"
+ -->
+ <source name="hsql-connector" translator-name="hsql" connection-jndi-name="java:PortfolioDS"/>
+ </model>
-</vdb>
- ]]></programlisting>
-
- <para>The XML file is explained below.</para>
+</vdb>
+ </programlisting>
+ </section>
+
+ <section>
+ <title>Dynamic VDB XML Structure</title>
+
+ <para>The above vdb XML structure is explained.</para>
+
<orderedlist>
- <listitem><para>The above XML file defines a "vdb" with name "DynamicPortfolio" with version "1"</para></listitem>
- <listitem><para>A "model" XML element represents a schema that being integrated. This sample
- defines two sources, "MarketData" that represents the schema for the text file that has the
- stock price information and "Accounts" that represents the "portfolio" schema in the Derby database.
- </para></listitem>
- <listitem><para>The "source" element inside the "model" element defines name of the source (can be any name), and
- name of the translator (defines the type of the source like oracle, db2, mysql, h2, file, ws etc..) and the
- "connection-jndi-name" defines the source's JNDI name in the JBoss AS container.</para></listitem>
- <listitem><para>Also note that inside the "model" elements, some "property" elements are used to define how
- metadata can be imported from source. For more information check out the Reference Guide's Dynamic VDB section.</para></listitem>
- <listitem><para>Note that you need to also create the necessary deployment
- files for the data sources (Connection Factories) too.</para></listitem>
+ <listitem>
+ <para>The "vdb" element defines the virtualdatase that has a name of
+ "DynamicPortfolio" with version "1"</para>
+ </listitem>
+
+ <listitem>
+ <para>A "model" element represents a schema that being integrated.
+ This sample defines two sources, "MarketData" that represents the
+ schema for the text file that has the stock price information and
+ "Accounts" that represents the "portfolio" schema in the HSQL
+ database.</para>
+ </listitem>
+
+ <listitem>
+ <para>The "source" element inside the "model" element defines name of
+ the source (can be any name), and name of the translator (defines the
+ type of the source like oracle, db2, mysql, h2, file, ws etc..) and
+ the "connection-jndi-name" defines the source's JNDI name in the JBoss
+ AS container.</para>
+ </listitem>
+
+ <listitem>
+ <para>Also note that inside the "model" elements, some "property"
+ elements are used to define how metadata can be imported from source.
+ For more information check out the Reference Guide's Dynamic VDB
+ section.</para>
+ </listitem>
+
+ <listitem>
+ <para>Note that you need to also create the necessary deployment files
+ for the data sources (Connection Factories) too.</para>
+ </listitem>
</orderedlist>
-
</section>
-</chapter>
\ No newline at end of file
+</chapter>
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -83,7 +83,6 @@
<para>The Teiid installation includes a simple Java class which demonstrates JDBC access of the deployed VDB.
To execute this demonstration, follow these steps:</para>
<orderedlist numeration="arabic">
- <listitem><para>Ensure Derby is running</para></listitem>
<listitem><para>Change to the ${jboss-install}/server/profile/teiid-examples/simpleclient directory</para></listitem>
<listitem><para>Execute the run script (either for Linux or Windows)</para></listitem>
</orderedlist>
@@ -92,7 +91,7 @@
VDB, but also the SYS schema tables.
</para>
- <para>If your application is Web based, you can create data source for your VDB using the above and treat it as any other JDBC source using
+ <para>If your application is Web based, you can create data source for your VDB using the above and treat it as any other JDBC source using
<code>org.teiid.jdbc.TeiidDataSource</code> and assigning it a JNDI name.
Refer to Client Developer's Guide deployment for more information on creating a DataSource.
</para>
Added: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/datasources.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/datasources.xml (rev 0)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/datasources.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % CustomDTD SYSTEM "../../../../../../docbook/custom.dtd">
+%CustomDTD;
+]>
+<chapter id="setupDS">
+ <title>Setup Data Sources / Connection Factories</title>
+
+ <section id="setup-1">
+ <title>Install Data Sources / Connection Factories</title>
+
+ <para>This examples uses two data sources, a relational database and a
+ text file. An HSQL database is used here since it is Open Source, comes
+ with JBoss AS and is light-weight. This section will describe how to setup
+ the data sources in order to run the example.</para>
+
+ <para>We need to create and deploy the required Connection Factories for
+ HSQL database and File sources. Connection Factories are sources that
+ provide the data when their data is integrated through Teiid. If you are
+ familiar with creating data sources or connection factories in JBoss AS,
+ then this is exactly the same operation</para>
+
+ <para>Perform the following steps to install and setup the data
+ sources:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Copy the following files from
+ "teiid-examples/dynamicvdb-portfolio" directory to the
+ "<jboss-install>/server/default/deploy" directory</para>
+
+ <para>(1) portfolio-ds.xml</para>
+
+ <para>(2) marketdata-file-ds.xml</para>
+ </listitem>
+
+ <listitem>
+ <para>If the server has not been started, start it</para>
+ </listitem>
+
+ <listitem>
+ <para>Using a web browser, goto the JMX console
+ (http://localhost:8080/jmx-console/) and select:
+ <emphasis>database-portfolioDB,service=PortfolioService</emphasis> to
+ present the bean options.</para>
+ </listitem>
+
+ <listitem>
+ <para>Now click invoke "startDatabaseManager" to bring up HSQL
+ Database Manager</para>
+ </listitem>
+
+ <listitem>
+ <para>Use the File/Open Script menu option to load the
+ customer-schema.sql script located in
+ "teiid-examples/dynamicvdb-portfolio"</para>
+ </listitem>
+
+ <listitem>
+ <para>Click the Execute SQL button to create the required tables and
+ insert the example data</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Make sure you did not have any issues when creating the schema as it
+ is needed for going forward in this example.</para>
+ </section>
+
+ <section id="setup-2">
+ <title>Describe the CSV file and its contents</title>
+
+ <para>In order to use a Text file as the source, we need a data file which
+ defines the data in the table</para>
+
+ <orderedlist>
+ <listitem>
+ <para>Data File: Each data file contains column information for the
+ table. The column information is typically defined on line 1 as header
+ line in the file, and all the following lines contain the actual rows
+ of data. Each single line corresponds to single row. A portion of the
+ sample file is shown below. The complete sample file is
+ "teiid-examples/dynamicvdb-portfolio/data/marketdata-price.txt".</para>
+
+ <programlisting>
+ SYMBOL,PRICE
+ IBM,83.46
+ RHT,11.84
+ BA, 44.58
+ ORCL,17.37
+
+ </programlisting>
+ </listitem>
+ </orderedlist>
+
+ <para>You can use the provide data files or create your own data
+ files.</para>
+
+ <para>At this point, both data sources are ready to access.</para>
+ </section>
+</chapter>
Property changes on: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/datasources.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Id Revision
Added: svn:eol-style
+ LF
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -1,43 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="deployment">
- <title>Deployment</title>
- <para> Having built the VDB, it must be deployed into Teiid server, so it can be accessed through a JDBC connection.</para>
+ <title>VDB Deployment</title>
- <para />
- <para>This example deploys Teiid within a JBoss AS. The sample deployment is shown below.
- You can find more details about deploying to application servers on the Teiid web-site</para>
- <para />
- <section id="teiid-runtime">
- <title>JBoss AS Application Deployment</title>
-
- <orderedlist>
- <listitem>
- <para>
- Before we can deploy the VDB to the server, we need to create and deploy the required Connection Factories for Derby
- and File sources. Connection Factories are sources that provide the data then their data is integrated through Teiid. If you are
- familiar with creating data sources or connection factories in JBoss AS, then this is exactly the same operation.
- </para>
-
- <para>Access to Derby first requires that the the Derby client jar (${derby-install}/lib/derbyclient.jar) be placed in the ${jboss-install}/server/{profile}/lib directory.</para>
-
- <para>See or copy the following:</para>
- <programlisting><![CDATA[${teiid-examples}/dynamicvdb-portfolio/portfolio-ds.xml
-${teiid-examples}/dynamicvdb-portfolio/marketdata-file-ds.xml]]> </programlisting>
- <para>files into "${jboss-install}/server/{profile}/deploy" directory to create the Derby and File data sources respectively.</para>
- </listitem>
- <listitem>
- <para>The above data sources provide the data to your VDB. Now to deploy your VDBl place your VDB file (either the dynamicvdb-portfolio/portfolio-vdb.xml file or the full .vdb file) in a the "${jboss-install}/server/{profile}/deploy" directory.
- If the JBoss AS is not already started, start by running the "${jboss-install}/bin/run.sh" or "${jboss-install}/bin/run.bat" scripts.
- Check the logs or the console to make sure there were no errors during the deployment of the VDB.
- </para>
- </listitem>
- <listitem>
- <para>
- Now, go to the next section to learn how to
- <link linkend="OpenConnection">connect to the VDB</link>
- </para>
- </listitem>
- </orderedlist>
- </section>
-</chapter>
\ No newline at end of file
+ <para>Having built the VDB or using the example dynamic vdb, it must be
+ deployed into the JBoss AS server so it can be accessed using a Teiid JDBC
+ connection.</para>
+
+ <para></para>
+
+ <para>This example is using the dynamic vdb and requires that it be deployed
+ into the JBoss AS server. To deploy the vdb, copy the following file into
+ "<emphasis><jboss-install>/server/default/deploy</emphasis>"
+ directory:</para>
+
+ <para></para>
+
+ <itemizedlist>
+ <listitem>
+ <para>teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml</para>
+ </listitem>
+ </itemizedlist>
+
+ <para></para>
+
+ <para>Now, go to the next section to learn how to <link
+ linkend="OpenConnection">connect to the VDB.</link></para>
+
+ <para></para>
+</chapter>
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/download.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/download.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/download.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -1,41 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % CustomDTD SYSTEM "../../../../../../docbook/custom.dtd">
%CustomDTD;
]>
<chapter id="download">
<title>Download</title>
- <para>
- You need to download the binaries for
- <ulink url="http://www.jboss.org/teiid/downloads.html">Teiid</ulink>
- . Note that there are three different artifacts are available for download.
- </para>
+
+ <para>You need to download the binaries for <ulink
+ url="http://www.jboss.org/teiid/downloads.html">Teiid</ulink> . Note that
+ there are three different artifacts are available for download.</para>
+
<orderedlist>
<listitem>
<para>Teiid Source - contains all of the source code</para>
</listitem>
+
<listitem>
<para>Teiid AdminShell - contains the admin client</para>
</listitem>
+
<listitem>
<para>Teiid Runtime - contains the Teiid engine and required 3rd party
- dependencies</para>
+ dependencies</para>
</listitem>
</orderedlist>
- <para>
- For this Quick Start, download and install <ulink url="http://www.jboss.org/jbossas/downloads.html">JBoss AS 5.1.0</ulink>.
- Then download the Teiid runtime and unzip the contents under any of the JBoss AS profiles, such as "default" or "all".
- The default profile is the typical installation location, for example "<jboss-install>/server/default". The Teiid runtime directory structure matches JBoss profiles directly - it is just an overlay.
- </para>
- <para>In the "<jboss-install>/server/<profile>/lib" directory, you will find "teiid-&versionNumber;-client.jar", which
- is the main client binary jar file for Teiid. This jar file contains the Teiid's JDBC driver and data source classes. </para>
+
+ <para>For this Quick Start, download and install <ulink
+ url="http://www.jboss.org/jbossas/downloads.html">JBoss AS 5.1.0</ulink>.
+ Then download the Teiid runtime and unzip the contents under any of the
+ JBoss AS profiles, such as "default" or "all". The default profile is the
+ typical installation location, for example
+ "<jboss-install>/server/default". The Teiid runtime directory
+ structure matches JBoss profiles directly - it is just an overlay.</para>
+
+ <para>In the "<jboss-install>/server/<profile>/lib" directory,
+ you will find "teiid-&versionNumber;-client.jar", which is the main client
+ binary jar file for Teiid. This jar file contains the Teiid's JDBC driver
+ and data source driver jar's.</para>
+
<note>
- <para>JBoss AS 5.1 requires <ulink url="http://java.sun.com/javase/downloads">Java 6</ulink> to run.
- </para>
- <para>
- Access to physical data sources such as Oracle, MS-SQL Server, DB2, and Sybase through Teiid relies upon
- the user supplying their own JDBC drivers in the deployment. Copy the JDBC driver files into
- "<jboss-install>/server/<profile>/lib" before you create any data sources.
- </para>
+ <para>JBoss AS 5.1 requires <ulink
+ url="http://java.sun.com/javase/downloads">Java 6</ulink> to run.</para>
+
+ <para>Access to physical data sources such as Oracle, MS-SQL Server, DB2,
+ and Sybase through Teiid relies upon the user supplying their own JDBC
+ drivers in the deployment. Copy the JDBC driver files into
+ "<jboss-install>/server/<profile>/lib" before you create any
+ data sources.</para>
</note>
-</chapter>
\ No newline at end of file
+</chapter>
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/example-explained.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/example-explained.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/example-explained.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -1,123 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="example-explained">
- <title>Example Explained</title>
+ <title>Portfolio Example Explained</title>
+
<section>
- <title>Portfolio Application Explained</title>
- <para>
- The investor's portfolio information is stored in a Derby database and
- "current" stock prices are stored in a delimited text file. When the VDB is completed, a single query will cause
- Teiid to access the relational and non-relational sources, calculate the portfolio values, and
- return the results.
- </para>
+ <para>The investor's portfolio example information is stored in a HSQL
+ database and "current" stock prices are stored in a delimited text file.
+ When the VDB is completed, a single query will cause Teiid to access the
+ relational and non-relational sources, calculate the portfolio values, and
+ return the results.</para>
+
<figure id="steps">
<title>Various Steps involved in creating the example</title>
- <graphic align="center" scale="100" fileref="../images/steps-defined.png" />
+
+ <graphic align="center" fileref="../images/steps-defined.png"
+ scale="100" />
</figure>
+
<itemizedlist>
<listitem>
<para>
- <link linkend="step-1">Step-1: Create the Relational Database's schema and load the sample data</link>
+ <link linkend="setupDS">Step-1: Setup Data Sources /
+ ConnectionFactories</link>
</para>
</listitem>
+
<listitem>
<para>
- <link linkend="step-2">Step-2: Describe the CSV file and its contents</link>
+ <link linkend="buildVDB">Step-3: Build a VDB</link>
</para>
</listitem>
+
<listitem>
<para>
- <link linkend="step-3">Step-3: Build a VDB</link>
+ <link linkend="deployment">Step-4: Deploy the VDB in JBoss AS</link>
</para>
</listitem>
+
<listitem>
<para>
- <link linkend="deployment">Step-4: Deploy the VDB in Teiid</link>
+ <link linkend="OpenConnection">Step-5: Access the VDB using the JDBC
+ API</link>
</para>
</listitem>
- <listitem>
- <para>
- <link linkend="OpenConnection">Step-5: Access the VDB using the JDBC API</link>
- </para>
- </listitem>
</itemizedlist>
</section>
+
<note>
- <para>
- <ulink url="http://db.apache.org/derby/">Derby</ulink>
- is used here since it is Open Source, easily obtained, and light-weight. You can substitute any other relational
- database, as long as you have a suitable JDBC driver. The schema file provided, and described below, is
- specific to Derby, but can be easily converted for use with other databases.
- </para>
+ <para>HSQL database is used here since it is Open Source and comes with
+ JBoss AS and is light-weight. You can substitute any other relational
+ database, as long as you have a suitable JDBC driver. The schema file
+ provided, and described below, is specific to HSQL, but can be easily
+ converted for use with other databases.</para>
</note>
- <section id="step-1">
- <title>Create the Relational Database's schema and load the sample data</title>
- <para>
- This example is written using
- <ulink url="http://db.apache.org/derby/">"Derby"</ulink>
- as the relational database.
- <ulink url="http://db.apache.org/derby/derby_downloads.html">Download</ulink>
- and install Derby on your machine. An existing local or remote instance can be used if it exists.
- </para>
- <para>We need to start the Derby RDBMS and create the "accounts" database with the below schema. These
- commands are intended for a Linux environment. For starting the Derby instance on another platform, you will need to use
- commands appropriate to that platform.</para>
- <para>Start a terminal session, and change directory to where
- Derby is installed and execute following commands</para>
- <programlisting><![CDATA[export DERBY_HOME=`pwd`
-./bin/startNetworkServer]]>
- </programlisting>
- <para>This starts the Derby in network mode. Now, start another terminal and we will use Derby''s 'ij' tool
- (like SQL*PLus for Oracle) to create the schema, using the "customer-schema.sql" file in
- "examples/dynamicvdb-portfolio" directory</para>
- <programlisting><![CDATA[export DERBY_HOME=`pwd`
-./bin/ij /path/to/customer-schema.sql]]>
- </programlisting>
- <para>This will create the accounts schema. It's abbreviated ddl is shown below. </para>
- <programlisting><![CDATA[--Contains the name and address of a Customer who owns portfolio account
-CREATE TABLE CUSTOMER
-...
-
---Contains Customer's account number and its current status
-CREATE TABLE ACCOUNT
-...
-
---Contains information about stock symbol, company name etc.
-CREATE TABLE PRODUCT
-...
-
---Contains each Account's holdings of Stocks
-CREATE TABLE HOLDINGS
-...]]></programlisting>
-
- <para>
- Make sure you did not have any issues when creating the schema as it is needed for going forward in this example.
- You can use 'ij' tool to verify the tables were created. As an alternative, you may use other tools like
- <ulink url="http://www.squirrelsql.org/">SQuirreL</ulink>
- , or
- <ulink url="http://www.eclipse.org/datatools/">Eclipse's Data Tools</ulink>
- plugin to connect to the Derby instance to check the schema and sample data.
- </para>
- </section>
- <section id="step-2">
- <title>Describe the CSV file and its contents</title>
- <para>In order to use a Text file as the source, we need a data file defines data inside a table</para>
- <orderedlist>
- <listitem>
- <para>Data File: Each data file contains column information for the table. The
- column information is typically defined on line 1 as header line in the file, and all the following lines
- contain the actual rows of data. Each single line corresponds to single row. A portion of the sample file
- is shown below. The complete sample file is "examples/dynamicvdb-portfolio/marketdata-price.txt".</para>
- <programlisting><![CDATA[
- SYMBOL,PRICE
- IBM,83.46
- RHT,11.84
- BA, 44.58
- ORCL,17.37
- ]]>
- </programlisting>
- </listitem>
- </orderedlist>
- <para>Just locate the sample data files provided or create your own data files. Now, both our sources are ready.</para>
- </section>
-</chapter>
\ No newline at end of file
+</chapter>
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/preface.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/preface.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/preface.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -1,47 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<preface>
<title>Preface</title>
- <section>
+
+ <section>
<title>What is Teiid?</title>
- <para>Teiid is runtime for executing queries against a Virtual Database or VDB. Before you can access your data in a federated
- manner, use can use Teiid Designer or the Dynamic VDB feature to build a VDB. This picture shows the relationship between the tools
- involved.</para>
+
+ <para>Teiid is runtime for executing queries against a Virtual Database or
+ VDB. Before you can access your data in a federated manner, user can use
+ Teiid Designer or the Dynamic VDB feature to build a VDB. This picture
+ shows the relationship between the tools involved.</para>
+
<figure id="lifecycle">
<title>Lifecycle of Events</title>
- <graphic align="center" scale="100" fileref="../images/steps.png" />
+
+ <graphic align="center" fileref="../images/steps.png" scale="100" />
</figure>
+
<section>
- <title>What is a Virtual Database?</title>
- <para> A Virtual Database (VDB) is an artifact that combines one or more
- physical data sources to provide for easy data integration. Integration is encapsulated through view and procedures that Teiid will process in an optimized way against their respective sources.
- The physical sources can be JDBC sources, delimited text files, spreadsheets, or even Web services.</para>
- </section>
-
- <para>The Teiid Designer tool lets you define physical data sources by importing the required metadata
- (schema) from these sources. Once the metadata is imported, Designer can assist in building additional view layers.
- The collection of physical and view models will form a VDB.</para>
+ <title>What is a Virtual Database?</title>
+
+ <para>A Virtual Database (VDB) is an artifact that combines one or more
+ physical data sources to provide for easy data integration. Integration
+ is encapsulated through view and procedures that Teiid will process in
+ an optimized way against their respective sources. The physical sources
+ can be JDBC sources, delimited text files, spreadsheets, or even Web
+ services.</para>
+ </section>
+
+ <para>The Teiid Designer tool lets you define physical data sources by
+ importing the required metadata (schema) from these sources. Once the
+ metadata is imported, Designer can assist in building additional view
+ layers. The collection of physical and view models will form a VDB.</para>
</section>
-
+
<section>
<title>What is This Guide About?</title>
- <para>This guide takes you through an introduction to the concepts important to Teiid,
- downloading the software, and building and deploying a virtual database in 60 minutes.
- There is a lot to cover, so let's begin!</para>
+
+ <para>This guide takes you through an introduction to the concepts
+ important to Teiid, downloading the software, and building and deploying a
+ virtual database in 60 minutes. There is a lot to cover, so let's
+ begin!</para>
</section>
-
+
<note>
- <para>
- Please read
- <ulink url="http://www.jboss.org/teiid/basics.html">Federation Basics</ulink>
- to understand different terminologies used, resources needed, and artifacts to be generated before
- developing a successful application. This example takes advantage of only a minimal set of features from
- Teiid for the sake of simplicity and time.
- </para>
+ <para>Please read <ulink
+ url="http://www.jboss.org/teiid/basics.html">Federation Basics</ulink> to
+ understand different terminologies used, resources needed, and artifacts
+ to be generated before developing a successful application. This example
+ takes advantage of only a minimal set of features from Teiid for the sake
+ of simplicity and time.</para>
</note>
-
- <para>Commercial development support, production support, and training for Teiid is available through JBoss.
- Teiid is a Professional Open Source project and a critical component of the JBoss Enterprise Data Services
- Platform.</para>
-
-</preface>
\ No newline at end of file
+
+ <para>Commercial development support, production support, and training for
+ Teiid is available through JBoss. Teiid is a Professional Open Source
+ project and a critical component of the JBoss Enterprise Data Services
+ Platform.</para>
+</preface>
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/quick_start_example.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/quick_start_example.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/quick_start_example.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -49,6 +49,7 @@
<xi:include href="content/preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/download.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/example-explained.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="content/datasources.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/buildvdb.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/deployment.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/connect-vdb.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
13 years, 9 months
teiid SVN: r3081 - trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2011-04-11 11:34:06 -0400 (Mon, 11 Apr 2011)
New Revision: 3081
Added:
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema-drop.sql
Removed:
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-ds.xml
Modified:
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema.sql
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml
Log:
TEIID-1519 - changed the dynamicvdb-portfolio example to use the HSQL database provided by jboss as.
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt 2011-04-08 19:27:28 UTC (rev 3080)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt 2011-04-11 15:34:06 UTC (rev 3081)
@@ -1,27 +1,50 @@
-Demonstrates how to use the File Translator to integrate text resources with
-a database. This example assumes the use of Derby, but the creation SQL could be
-adapted to another database if you choose.
+Dynamicvdb-portfolio demonstrates how to federate data from a relational data source with a
+text file-based data source. This example uses the HSQL database which is referenced as
+the PortfolioDS data source in the server, but the creation SQL could be adapted to another
+database if you choose.
-Install a recent version of Derby - see http://db.apache.org/derby/derby_downloads.html
-Create the example dataset in Derby by running <derby home>/bin/ij customer-schema.sql
+Data Source(s) setup:
-Put the <derby home>/lib/derbyclient.jar to the "<jboss home>/server/default/lib" directory.
+- Start the server (if not already started)
+- go to the JMX console (http://localhost:8080/jmx-console/) and select: database=localDB,service=Hypersonic
+to present bean options. Now invoke "startDatabaseManager" to bring up HSQL Database Manager.
+- Use the File/Open Script menu option to load the teiid-examples/dynamicvdb-portfolio/customer-schema.sql script and and then click Execute SQL to create the required tables and insert the example data.
+
+Teiid Deployment:
+
+
Copy the following files to the <jboss.home>/server/default/deploy directory.
- - portfolio-vdb.xml
- - marketdata-file-ds.xml
- - portfolio-ds.xml
-Start the JBoss Container
+ (1) portfolio-vdb.xml
+ (2) marketdata-file-ds.xml
+
+
+Query Demonstrations:
-Use the simple client example run script, or another client, to execute a query, e.g.
+==== Using the simpleclient example ====
-$./run.sh localhost 31000 dynamicportfolio "select stock.* from product, (call MarketData.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) stock where product.symbol=stock.symbol"
+1) Change your working directory to teiid-examples/simpleclient
-This example will execute the query against both Derby and the text files. The
-files returned from the getTextFiles procedure are passed to the TEXTTABLE table
-function (via the nested table correlated reference f.file). The TEXTTABLE
-function expects a text file with a HEADER containing entries for at least symbol
-and price columns.
+2) Use the simpleclient example run script, using the following format
+$./run.sh localhost 31000 dynamicportfolio "example query"
+
+
+example queries:
+
+1 select * from product
+2 select stock.* from (call MarketData.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) stock
+3. select product.symbol, stock.price, company_name from product, (call MarketData.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) stock where product.symbol=stock.symbol
+
+Example 1 queries the relational source
+
+Example 2 queries the text file-based
+ source
+
+Example 3 queries both the relational and the text file-based sources. The files returned from the getTextFiles procedure are
+passed to the TEXTTABLE table function (via the nested table correlated reference f.file). The TEXTTABLE function expects a
+text file with a HEADER containing entries for at least symbol and price columns.
+
+
Added: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema-drop.sql
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema-drop.sql (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema-drop.sql 2011-04-11 15:34:06 UTC (rev 3081)
@@ -0,0 +1,21 @@
+
+DROP TABLE HOLDINGS
+;
+
+DROP TABLE PRODUCT
+;
+
+DROP TABLE ACCOUNT
+;
+
+DROP TABLE CUSTOMER
+;
+
+
+
+
+
+
+
+
+
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema.sql
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema.sql 2011-04-08 19:27:28 UTC (rev 3080)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema.sql 2011-04-11 15:34:06 UTC (rev 3081)
@@ -1,6 +1,6 @@
-CONNECT 'jdbc:derby://localhost:1527/teiid/accounts;create=true;';
-DROP TABLE CUSTOMER;
+
+
CREATE TABLE CUSTOMER
(
SSN char(10),
@@ -15,7 +15,7 @@
CONSTRAINT CUSTOMER_PK PRIMARY KEY(SSN)
);
-DROP TABLE ACCOUNT;
+
CREATE TABLE ACCOUNT
(
ACCOUNT_ID integer,
@@ -28,7 +28,7 @@
CONSTRAINT CUSTOMER_FK FOREIGN KEY (SSN) REFERENCES CUSTOMER (SSN)
);
-DROP TABLE PRODUCT;
+
CREATE TABLE PRODUCT (
ID integer,
SYMBOL varchar(16),
@@ -36,10 +36,10 @@
CONSTRAINT PRODUCT_PK PRIMARY KEY(ID)
);
-DROP TABLE HOLDINGS;
+
CREATE TABLE HOLDINGS
(
- TRANSACTION_ID integer GENERATED ALWAYS AS IDENTITY (start with 2000, increment by 1),
+ TRANSACTION_ID integer IDENTITY,
ACCOUNT_ID integer,
PRODUCT_ID integer,
PURCHASE_DATE timestamp,
@@ -49,6 +49,8 @@
CONSTRAINT PRODUCT_FK FOREIGN KEY (PRODUCT_ID) REFERENCES PRODUCT (ID)
);
+
+
INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01002','Joseph','Smith','1234 Main Street','Apartment 56','New York','New York','10174','(646)555-1776');
INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01003','Nicholas','Ferguson','202 Palomino Drive',null,'Pittsburgh','Pennsylvania','15071','(412)555-4327');
INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01004','Jane','Aire','15 State Street',null,'Philadelphia','Pennsylvania','19154','(814)555-6789');
@@ -125,6 +127,7 @@
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990007,1008,{ts '1999-05-11 00:00:00.000'},85);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990008,1005,{ts '1999-05-21 00:00:00.000'},105);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990009,1004,{ts '1999-06-25 00:00:00.000'},120);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980003,1024,{ts '1999-07-22 00:00:00.000'},150);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000015,1018,{ts '2000-04-20 00:00:00.000'},135);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980006,1030,{ts '2000-06-12 00:00:00.000'},91);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000019,1029,{ts '2000-10-08 00:00:00.000'},351);
@@ -135,12 +138,13 @@
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010022,1006,{ts '2001-01-05 00:00:00.000'},237);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990008,1015,{ts '2001-01-23 00:00:00.000'},180);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980005,1025,{ts '2001-03-23 00:00:00.000'},125);
-INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010027,1020,{ts '2001-08-22 00:00:00.000'},70);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010027,1024,{ts '2001-08-22 00:00:00.000'},70);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000020,1006,{ts '2001-11-14 00:00:00.000'},125);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980003,1029,{ts '2001-11-15 00:00:00.000'},100);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000021,1011,{ts '2001-12-18 00:00:00.000'},44);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010027,1028,{ts '2001-12-19 00:00:00.000'},115);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020034,1024,{ts '2002-01-22 00:00:00.000'},189);
-INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990009,1022,{ts '2002-01-24 00:00:00.000'},30);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990009,1029,{ts '2002-01-24 00:00:00.000'},30);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020035,1013,{ts '2002-02-12 00:00:00.000'},110);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020035,1034,{ts '2002-02-13 00:00:00.000'},70);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020034,1003,{ts '2002-02-22 00:00:00.000'},25);
@@ -153,7 +157,4 @@
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980005,1010,{ts '2002-04-01 00:00:00.000'},26);
-COMMIT;
-DISCONNECT CURRENT;
-
Deleted: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-ds.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-ds.xml 2011-04-08 19:27:28 UTC (rev 3080)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-ds.xml 2011-04-11 15:34:06 UTC (rev 3081)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <xa-datasource>
- <jndi-name>PortfolioDS</jndi-name>
- <isSameRM-override-value>false</isSameRM-override-value>
- <xa-datasource-class>org.apache.derby.jdbc.ClientXADataSource</xa-datasource-class>
- <xa-datasource-property name="DatabaseName">teiid/accounts</xa-datasource-property>
- <xa-datasource-property name="PortNumber">1527</xa-datasource-property>
- <xa-datasource-property name="ServerName">localhost</xa-datasource-property>
-
- <track-connection-by-tx>true</track-connection-by-tx>
- <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
-
- <max-pool-size>5</max-pool-size>
- <min-pool-size>1</min-pool-size>
- <metadata>
- <type-mapping>Derby</type-mapping>
- </metadata>
- </xa-datasource>
-</datasources>
-
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml 2011-04-08 19:27:28 UTC (rev 3080)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml 2011-04-11 15:34:06 UTC (rev 3081)
@@ -9,7 +9,7 @@
"cached" will save a file containing the metadata into
the deploy/<vdb name>/<vdb version/META-INF directory
-->
- <property name="UseConnectorMetadata" value="cached" />
+ <property name="UseConnectorMetadata" value="true" />
<!--
@@ -41,9 +41,9 @@
<property name="importer.useFullSchemaName" value="false"/>
<!--
- This connector is defined in the "derby-connector-ds.xml"
+ This connector is defined to reference the HSQL localDS"
-->
- <source name="derby-connector" translator-name="derby" connection-jndi-name="java:PortfolioDS"/>
+ <source name="hsql-connector" translator-name="hsql" connection-jndi-name="java:DefaultDS"/>
</model>
</vdb>
\ No newline at end of file
13 years, 9 months
teiid SVN: r3080 - in trunk: build and 4 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-04-08 15:27:28 -0400 (Fri, 08 Apr 2011)
New Revision: 3080
Removed:
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/
Modified:
trunk/build/pom.xml
trunk/client-jdk15/
trunk/pom.xml
Log:
TEIID-1491: removing the usage of the retrotranslator from the build. It is proven to be not embedding the runtime jar, and was in alpha state for for 3 years and very poor docs and unusable. I replaced with java execute process that directly uses the Retrotranslator library.
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-04-08 19:21:21 UTC (rev 3079)
+++ trunk/build/pom.xml 2011-04-08 19:27:28 UTC (rev 3080)
@@ -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,32 +104,31 @@
</descriptors>
</configuration>
</plugin>
+
<plugin>
<groupId>org.codehaus.mojo</groupId>
- <artifactId>retrotranslator-maven-plugin</artifactId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
- <goal>translate</goal>
+ <goal>java</goal>
</goals>
<configuration>
- <attach>true</attach>
- <target>1.5</target>
- <embed>org.teiid.retroruntime</embed>
- <destjar>target/teiid-${pom.version}-client-jdk15.jar</destjar>
- <verify>false</verify>
- <failonwarning>true</failonwarning>
- <includes>
- <include>
- <directory>target</directory>
- <pattern>teiid-${pom.version}-client.jar</pattern>
- </include>
- </includes>
+ <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>
+ </plugin>
</plugins>
</build>
</profile>
Property changes on: trunk/client-jdk15
___________________________________________________________________
Added: svn:ignore
+ target
.classpath
.settings
.project
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-04-08 19:21:21 UTC (rev 3079)
+++ trunk/pom.xml 2011-04-08 19:27:28 UTC (rev 3080)
@@ -477,6 +477,7 @@
<module>hibernate-dialect</module>
<module>jboss-integration</module>
<module>test-integration</module>
+ <module>client-jdk15</module>
</modules>
<distributionManagement>
<repository>
13 years, 9 months
teiid SVN: r3079 - in trunk: client-jdk15 and 19 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-04-08 15:21:21 -0400 (Fri, 08 Apr 2011)
New Revision: 3079
Added:
trunk/client-jdk15/
trunk/client-jdk15/pom.xml
trunk/client-jdk15/src/
trunk/client-jdk15/src/main/
trunk/client-jdk15/src/main/java/
trunk/client-jdk15/src/main/java/net/
trunk/client-jdk15/src/main/java/net/sf/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
Log:
TEIID_1491: adding retrotranslator classes as separate module to escape the processing of it by retrotranslator
Added: trunk/client-jdk15/pom.xml
===================================================================
--- trunk/client-jdk15/pom.xml (rev 0)
+++ trunk/client-jdk15/pom.xml 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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.4.0.Beta3-SNAPSHOT</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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -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;
+ }
+}
13 years, 9 months
teiid SVN: r3078 - in trunk/engine/src/main/java/org/teiid: query/tempdata and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-04-08 14:29:53 -0400 (Fri, 08 Apr 2011)
New Revision: 3078
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
Log:
TEIID-1473 fixing the limit compensation
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-07 20:21:17 UTC (rev 3077)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2011-04-08 18:29:53 UTC (rev 3078)
@@ -126,7 +126,6 @@
AtomicRequestMessage aqr = createRequest(context.getProcessorID(), command, modelName, connectorBindingId, nodeID);
if (limit > 0) {
aqr.setFetchSize(Math.min(limit, aqr.getFetchSize()));
- throw new AssertionError();
}
ConnectorManagerRepository cmr = workItem.getDqpWorkContext().getVDB().getAttachment(ConnectorManagerRepository.class);
ConnectorWork work = cmr.getConnectorManager(aqr.getConnectorName()).registerRequest(aqr);
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-07 20:21:17 UTC (rev 3077)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-04-08 18:29:53 UTC (rev 3078)
@@ -172,7 +172,7 @@
return result;
}
}
- return this.processorDataManager.registerRequest(context, command, modelName, connectorBindingId, nodeID, -1);
+ return this.processorDataManager.registerRequest(context, command, modelName, connectorBindingId, nodeID, limit);
}
TupleSource registerRequest(CommandContext context, String modelName, Command command) throws TeiidComponentException, TeiidProcessingException {
13 years, 9 months
teiid SVN: r3077 - in trunk: build/kits/jboss-container and 17 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-04-07 16:21:17 -0400 (Thu, 07 Apr 2011)
New Revision: 3077
Added:
trunk/client/src/main/java/net/
trunk/client/src/main/java/net/sf/
trunk/client/src/main/java/net/sf/retrotranslator/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
Modified:
trunk/build/kits/jboss-container/teiid-releasenotes.html
trunk/build/pom.xml
Log:
TEIID-1491: Adding support for building retro translated JDBC driver for JDK1.5
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-04-07 15:23:10 UTC (rev 3076)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-04-07 20:21:17 UTC (rev 3077)
@@ -50,7 +50,8 @@
<LI><B>Dependent query parallization</B> - when multiple dependent queries are still required, then they will be run in parallel (up to MaxUserSourceRequestConcurrency), rather than sequentially.
<LI><B>Cost based back-off</B> - for cost based dependent joins if the number of independent values is too large, then the join will be performed as normal.
</UL>
- <LI><B>Enhanced Sort Join</B> - the partitioned merge join was replaced with an enhanced sort join. The enhanced sort join will use the actual row counts from each side of the relation to perform a index based join if one side is small enough, a partial sort of the larger side and a repeated merge join if the tuples are unbalanced but one side is not small enough to form an index, or a standard sort merge join if the tuples are balanced.
+ <LI><B>Enhanced Sort Join</B> - the partitioned merge join was replaced with an enhanced sort join. The enhanced sort join will use the actual row counts from each side of the relation to perform a index based join if one side is small enough, a partial sort of the larger side and a repeated merge join if the tuples are unbalanced but one side is not small enough to form an index, or a standard sort merge join if the tuples are balanced.
+ <LI><B>JDK1.5 JDBC Client JAR</B> - A retro-translated Teiid client JDBC jar now available to use with JDK 1.5 VM. Note only JDBC API supported, not Admin API.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-04-07 15:23:10 UTC (rev 3076)
+++ trunk/build/pom.xml 2011-04-07 20:21:17 UTC (rev 3077)
@@ -62,7 +62,7 @@
</goals>
</execution>
</executions>
- </plugin>
+ </plugin>
</plugins>
</build>
@@ -86,6 +86,32 @@
</descriptors>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>retrotranslator-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>translate</goal>
+ </goals>
+ <configuration>
+ <attach>true</attach>
+ <target>1.5</target>
+ <embed>org.teiid.retroruntime</embed>
+ <destjar>target/teiid-${pom.version}-client-jdk15.jar</destjar>
+ <verify>false</verify>
+ <failonwarning>true</failonwarning>
+ <includes>
+ <include>
+ <directory>target</directory>
+ <pattern>teiid-${pom.version}-client.jar</pattern>
+ </include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</profile>
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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;
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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);
+ }
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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();
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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 {
+
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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 {
+
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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;
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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;
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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;
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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()));
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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$
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -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;
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 9 months
teiid SVN: r3076 - trunk/engine/src/test/java/org/teiid/dqp/internal/process.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-04-07 11:23:10 -0400 (Thu, 07 Apr 2011)
New Revision: 3076
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
Log:
fix to ensure that timing issues should not cause test failure
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-07 15:22:24 UTC (rev 3075)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2011-04-07 15:23:10 UTC (rev 3076)
@@ -304,7 +304,8 @@
core.setUserRequestSourceConcurrency(20);
agds.getExecuteCount().set(0);
helpExecute(sql.toString(), "a");
- assertEquals(20, agds.getExecuteCount().get());
+ assertTrue(agds.getExecuteCount().get() <= 20);
+ assertTrue(agds.getExecuteCount().get() > 10);
//serial
core.setUserRequestSourceConcurrency(1);
13 years, 9 months