teiid SVN: r3731 - trunk/build/kits/jboss-as7/domain/configuration.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-12-12 15:50:34 -0500 (Mon, 12 Dec 2011)
New Revision: 3731
Modified:
trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml
Log:
TEIID-1720
Modified: trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml
===================================================================
--- trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml 2011-12-12 19:32:04 UTC (rev 3730)
+++ trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml 2011-12-12 20:50:34 UTC (rev 3731)
@@ -385,7 +385,7 @@
</subsystem>
<subsystem xmlns="urn:jboss:domain:teiid:1.0">
<async-thread-pool>teiid-async</async-thread-pool>
- <object-replicator stack="udp" cluster-name="teiid-rep"/>
+ <distributed-cache jgroups-stack="udp" channel="teiid-rep"/>
<resultset-cache container-name="teiid" name="resultset"/>
<transport name="embedded"/>
13 years
teiid SVN: r3730 - in branches/7.4.x/runtime/src: test/java/org/teiid/transport and 1 other directory.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2011-12-12 14:32:04 -0500 (Mon, 12 Dec 2011)
New Revision: 3730
Modified:
branches/7.4.x/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java
branches/7.4.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
Log:
SOA-3621 Support Patch for SOA-3620 EDS 5.2 enabledCipherSuites property gives error on startup of server
Modified: branches/7.4.x/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java
===================================================================
--- branches/7.4.x/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java 2011-12-09 21:44:19 UTC (rev 3729)
+++ branches/7.4.x/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java 2011-12-12 19:32:04 UTC (rev 3730)
@@ -151,7 +151,7 @@
this.enabledCipherSuites = enabledCipherSuites.split(","); //$NON-NLS-1$
}
- public String[] getEnabledCipherSuites() {
+ public String[] getEnabledCipherSuitesAsArray() {
return enabledCipherSuites;
}
}
Modified: branches/7.4.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
===================================================================
--- branches/7.4.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2011-12-09 21:44:19 UTC (rev 3729)
+++ branches/7.4.x/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2011-12-12 19:32:04 UTC (rev 3730)
@@ -259,7 +259,7 @@
@Test public void testEnableCipherSuites() throws Exception {
SSLConfiguration config = new SSLConfiguration();
config.setEnabledCipherSuites("x,y,z");
- assertArrayEquals(new String[] {"x","y","z"}, config.getEnabledCipherSuites());
+ assertArrayEquals(new String[] {"x","y","z"}, config.getEnabledCipherSuitesAsArray());
}
}
13 years
teiid SVN: r3729 - in trunk: jboss-integration and 3 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-12-09 16:44:19 -0500 (Fri, 09 Dec 2011)
New Revision: 3729
Added:
trunk/settings.xml
trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java
Removed:
trunk/test-integration/common/src/test/java/org/teiid/arquillian/TestDeployment.java
Modified:
trunk/jboss-integration/pom.xml
trunk/pom.xml
trunk/test-integration/common/pom.xml
trunk/test-integration/common/src/test/resources/arquillian.xml
Log:
TEIID-1809, TEIID-1720: making the arquillian tests execute based on given profile. This will download AS7 and install and overlay teiid binaries and execute any integration tests. Also, partially upgraded the build to use jboss-parent pom
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2011-12-08 19:19:34 UTC (rev 3728)
+++ trunk/jboss-integration/pom.xml 2011-12-09 21:44:19 UTC (rev 3729)
@@ -88,15 +88,9 @@
<artifactId>jbosssx-client</artifactId>
<scope>provided</scope>
</dependency>
-
+
<dependency>
<groupId>org.jboss.as</groupId>
- <artifactId>jboss-as-security</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.as</groupId>
<artifactId>jboss-as-subsystem-test</artifactId>
<scope>test</scope>
</dependency>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-12-08 19:19:34 UTC (rev 3728)
+++ trunk/pom.xml 2011-12-09 21:44:19 UTC (rev 3729)
@@ -1,6 +1,11 @@
<?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">
- <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-parent</artifactId>
+ <version>7</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-parent</artifactId>
<packaging>pom</packaging>
@@ -106,7 +111,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.8</version>
+ <version>${version.javadoc.plugin}</version>
<configuration>
<maxmemory>512m</maxmemory>
<excludePackageNames>*.internal,com.*,net.*,org.teiid.cache,org.teiid.common.*,org.teiid.core,org.teiid.deployers,org.teiid.dqp.*,org.teiid.jboss,org.teiid.netty.*,org.teiid.odbc,org.teiid.query,org.teiid.resource.*,org.teiid.rhq.*,org.teiid.runtime,org.teiid.security,org.teiid.services,org.teiid.templates,org.teiid.test.*,org.teiid.transport,org.teiid.vdb.*</excludePackageNames>
@@ -123,30 +128,14 @@
</build>
</profile>
<profile>
- <!--
+ <!--
This is to enable faster build for development time.
-->
<id>dev</id>
<modules>
<module>build</module>
</modules>
- </profile>
- <profile>
- <id>arquillian-tests</id>
- <dependencies>
- <dependency>
- <groupId>org.jboss.spec</groupId>
- <artifactId>jboss-javaee-6.0</artifactId>
- <version>1.0.0.Final</version>
- <type>pom</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.as</groupId>
- <artifactId>jboss-as-arquillian-container-managed</artifactId>
- </dependency>
- </dependencies>
- </profile>
+ </profile>
</profiles>
<build>
<!-- This section defines the default plugin settings inherited by child projects. -->
@@ -156,7 +145,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
+ <version>${version.jar.plugin}</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
@@ -169,17 +158,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
+ <version>${version.compiler.plugin}</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.target}</target>
<showDeprecation>false</showDeprecation>
<showWarnings>false</showWarnings>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.9</version>
+ <version>${version.surefire.plugin}</version>
<configuration>
<includes>
<include>**/*TestCase.java</include>
@@ -191,16 +180,10 @@
<!-- hack to prevent anonymous inner classes in Tests from being run as tests -->
<include>**/Test*$*.java</include>
</excludes>
- <systemProperties>
- <property>
- <name>user.dir</name>
- <value>${basedir}/target</value>
- </property>
- <property>
- <name>java.io.tmpdir</name>
- <value>${basedir}/target</value>
- </property>
- </systemProperties>
+ <systemPropertyVariables>
+ <user.dir>${basedir}/target</user.dir>
+ <java.io.tmpdir>${basedir}/target</java.io.tmpdir>
+ </systemPropertyVariables>
</configuration>
</plugin>
<!--
@@ -232,7 +215,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
- <version>2.1.2</version>
+ <version>${version.source.plugin}</version>
<executions>
<execution>
<id>attach-sources</id>
@@ -244,13 +227,6 @@
</plugin>
</plugins>
</build>
- <repositories>
- <repository>
- <id>jboss-public-repository</id>
- <name>JBoss Public Maven Repository Group</name>
- <url>http://repository.jboss.org/nexus/content/groups/public/</url>
- </repository>
- </repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
@@ -610,17 +586,6 @@
<version>${version.javax.enterprise.cdi-api}</version>
</dependency>
<dependency>
- <groupId>org.jboss.arquillian.junit</groupId>
- <artifactId>arquillian-junit-container</artifactId>
- <version>${version.org.jboss.arquillian.core}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>${version.sun.jaxb}</version>
@@ -657,16 +622,4 @@
<module>client-jdk15</module>
<module>admin</module>
</modules>
- <distributionManagement>
- <repository>
- <id>jboss-releases-repository</id>
- <name>JBoss Releases Repository</name>
- <url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
- </repository>
- <snapshotRepository>
- <id>jboss-snapshots-repository</id>
- <name>JBoss Snapshots Repository</name>
- <url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
- </snapshotRepository>
- </distributionManagement>
</project>
Added: trunk/settings.xml
===================================================================
--- trunk/settings.xml (rev 0)
+++ trunk/settings.xml 2011-12-09 21:44:19 UTC (rev 3729)
@@ -0,0 +1,47 @@
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
+http://maven.apache.org/xsd/settings-1.0.0.xsd">
+ <profiles>
+ <profile>
+ <id>jboss-public-repository</id>
+ <repositories>
+ <repository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>http://repository.jboss.org/nexus/content/groups/public/</url>
+ <layout>default</layout>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>jboss-public-repository-group</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>http://repository.jboss.org/nexus/content/groups/public/</url>
+ <layout>default</layout>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+
+ <activeProfiles>
+ <activeProfile>jboss-public-repository</activeProfile>
+ </activeProfiles>
+
+</settings>
Property changes on: trunk/settings.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2011-12-08 19:19:34 UTC (rev 3728)
+++ trunk/test-integration/common/pom.xml 2011-12-09 21:44:19 UTC (rev 3729)
@@ -50,4 +50,94 @@
<scope>provided</scope>
</dependency>
</dependencies>
+
+ <profiles>
+ <profile>
+ <id>arquillian-tests</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.spec</groupId>
+ <artifactId>jboss-javaee-6.0</artifactId>
+ <version>1.0.0.Final</version>
+ <type>pom</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-managed</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-dist</artifactId>
+ <version>${jbossas-version}</version>
+ <type>zip</type>
+ <overWrite>false</overWrite>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ <execution>
+ <id>unpack2</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid</artifactId>
+ <version>${project.version}</version>
+ <classifier>jboss-dist</classifier>
+ <type>zip</type>
+ <overWrite>false</overWrite>
+ <outputDirectory>${project.build.directory}/jboss-as-${jbossas-version}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-test</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemPropertyVariables>
+ <jbossHome>${project.build.directory}/jboss-as-${jbossas-version}</jbossHome>
+ <serverConfig>standalone-teiid.xml</serverConfig>
+ </systemPropertyVariables>
+ <includes>
+ <include>**/IntegrationTest*</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
\ No newline at end of file
Copied: trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java (from rev 3725, trunk/test-integration/common/src/test/java/org/teiid/arquillian/TestDeployment.java)
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java (rev 0)
+++ trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java 2011-12-09 21:44:19 UTC (rev 3729)
@@ -0,0 +1,452 @@
+package org.teiid.arquillian;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.sql.Connection;
+import java.sql.Statement;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.teiid.adminapi.Admin;
+import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.AdminFactory;
+import org.teiid.adminapi.DataPolicy;
+import org.teiid.adminapi.Model;
+import org.teiid.adminapi.PropertyDefinition;
+import org.teiid.adminapi.Request;
+import org.teiid.adminapi.Session;
+import org.teiid.adminapi.Translator;
+import org.teiid.adminapi.VDB;
+import org.teiid.adminapi.VDB.ConnectionType;
+import org.teiid.adminapi.VDB.Status;
+import org.teiid.adminapi.impl.VDBTranslatorMetaData;
+import org.teiid.core.util.UnitTestUtil;
+import org.teiid.jdbc.TeiidDriver;
+
+(a)RunWith(Arquillian.class)
+@SuppressWarnings("nls")
+public class IntegrationTestDeployment {
+
+ private Admin admin;
+
+ @Before
+ public void setup() throws Exception {
+ admin = AdminFactory.getInstance().createAdmin("localhost", 9999, "admin", "admin".toCharArray());
+ }
+
+ @After
+ public void teardown() {
+ admin.close();
+ }
+
+ @Test
+ public void testVDBDeployment() throws Exception {
+ boolean deployed = false;
+ try {
+ Set<?> vdbs = admin.getVDBs();
+ assertTrue(vdbs.isEmpty());
+
+ Collection<String> dsNames = admin.getDataSourceNames();
+ if (dsNames.contains("Oracle11_PushDS")) {
+ admin.deleteDataSource("Oracle11_PushDS");
+ }
+
+ admin.deploy("bqt.vdb",new FileInputStream(UnitTestUtil.getTestDataFile("bqt.vdb")));
+ deployed = true;
+
+ vdbs = admin.getVDBs();
+ assertFalse(vdbs.isEmpty());
+
+ VDB vdb = admin.getVDB("bqt", 1);
+ assertFalse(vdb.isValid());
+ assertTrue(vdb.getStatus().equals(Status.INACTIVE));
+
+ Properties props = new Properties();
+ props.setProperty("connection-url","jdbc:h2:mem:test;DB_CLOSE_DELAY=-1");
+ props.setProperty("user-name", "sa");
+ props.setProperty("password", "sa");
+
+ admin.createDataSource("Oracle11_PushDS", "h2", props);
+ Thread.sleep(2000);
+ vdb = admin.getVDB("bqt", 1);
+ assertTrue(vdb.isValid());
+ assertTrue(vdb.getStatus().equals(Status.ACTIVE));
+
+ dsNames = admin.getDataSourceNames();
+ assertTrue(dsNames.contains("Oracle11_PushDS"));
+
+ admin.deleteDataSource("Oracle11_PushDS");
+ vdb = admin.getVDB("bqt", 1);
+ assertFalse(vdb.isValid());
+ assertTrue(vdb.getStatus().equals(Status.INACTIVE));
+ } finally {
+ if (deployed) {
+ admin.undeploy("bqt.vdb");
+ }
+ }
+ }
+
+ @Test
+ public void testTraslators() throws Exception {
+ Collection<? extends Translator> translators = admin.getTranslators();
+ System.out.println(translators);
+ assertEquals(29, translators.size());
+
+ JavaArchive jar = getLoopyArchive();
+
+ try {
+ admin.deploy("loopy.jar", jar.as(ZipExporter.class).exportAsInputStream());
+
+ VDBTranslatorMetaData t = (VDBTranslatorMetaData)admin.getTranslator("loopy");
+ assertNotNull(t);
+ assertEquals("ANY", t.getPropertyValue("SupportedJoinCriteria"));
+ assertEquals("true", t.getPropertyValue("supportsSelectDistinct"));
+ } finally {
+ admin.undeploy("loopy.jar");
+ }
+
+ VDBTranslatorMetaData t = (VDBTranslatorMetaData)admin.getTranslator("orcl");
+ assertNull(t);
+ }
+
+ private JavaArchive getLoopyArchive() {
+ JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "loopy.jar")
+ .addClasses(SampleExecutionFactory.class)
+ .addAsManifestResource(new ByteArrayAsset(SampleExecutionFactory.class.getName().getBytes()),
+ ArchivePaths.create("services/org.teiid.translator.ExecutionFactory"));
+ jar.addAsManifestResource(new ByteArrayAsset("Dependencies: org.jboss.teiid.translator.loopback\n".getBytes()),
+ ArchivePaths.create("MANIFEST.MF"));
+ return jar;
+ }
+
+ @Test
+ public void testVDBConnectionType() throws Exception {
+ boolean vdbOneDeployed = false;
+ boolean vdbTwoDeployed = false;
+ try {
+
+ admin.deploy("bqt.vdb", new FileInputStream(UnitTestUtil.getTestDataFile("bqt.vdb")));
+ vdbOneDeployed = true;
+
+ VDB vdb = admin.getVDB("bqt", 1);
+ Model model = vdb.getModels().get(0);
+ admin.assignToModel("bqt", 1, model.getName(), "Source", "h2", "java:jboss/datasources/ExampleDS");
+ assertEquals(ConnectionType.BY_VERSION, vdb.getConnectionType());
+
+ try {
+ Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user", null);
+ conn.close();
+ } catch (Exception e) {
+ fail("must have succeeded in connection");
+ }
+
+ admin.changeVDBConnectionType("bqt", 1, ConnectionType.NONE);
+
+ try {
+ TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user", null);
+ fail("should have failed to connect as no new connections allowed");
+ } catch (Exception e) {
+ //pass
+ }
+
+ admin.deploy("bqt2.vdb", new FileInputStream(UnitTestUtil.getTestDataFile("bqt2.vdb")));
+ admin.assignToModel("bqt", 2, model.getName(), "Source", "h2", "java:jboss/datasources/ExampleDS");
+
+ vdbTwoDeployed = true;
+
+ try {
+ Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user", null);
+ conn.close();
+ } catch (Exception e) {
+ fail("should not have failed to connect");
+ }
+
+ admin.changeVDBConnectionType("bqt", 2, ConnectionType.ANY);
+ try {
+ Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user", null);
+ conn.close();
+ } catch (Exception e) {
+ fail("should have connected to the second vdb");
+ }
+
+ vdb = admin.getVDB("bqt", 2);
+ model = vdb.getModels().get(0);
+ assertEquals(model.getSourceConnectionJndiName("Source"), "java:jboss/datasources/ExampleDS");
+ assertEquals(model.getSourceTranslatorName("Source"), "h2");
+ assertEquals(ConnectionType.ANY, vdb.getConnectionType());
+
+ } finally {
+ if (vdbOneDeployed) {
+ admin.undeploy("bqt.vdb");
+ }
+ if (vdbTwoDeployed) {
+ admin.undeploy("bqt2.vdb");
+ }
+ }
+ }
+
+ @Test
+ public void testCacheTypes() throws Exception {
+ String[] array = {Admin.Cache.PREPARED_PLAN_CACHE.toString(), Admin.Cache.QUERY_SERVICE_RESULT_SET_CACHE.toString()};
+ Collection<String> types = admin.getCacheTypes();
+ System.out.println(types);
+ assertArrayEquals(array, types.toArray());
+ }
+
+ @Test
+ public void testSessions() throws Exception {
+ boolean vdbOneDeployed = false;
+ try {
+ vdbOneDeployed = deployVdb();
+
+ Collection<? extends Session> sessions = admin.getSessions();
+ assertEquals (0, sessions.size());
+
+ try {
+ Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user;ApplicationName=test", null);
+ sessions = admin.getSessions();
+ assertEquals (1, sessions.size());
+ Session s = sessions.iterator().next();
+
+ assertEquals("user@teiid-security", s.getUserName());
+ assertEquals("test", s.getApplicationName());
+ assertEquals("bqt", s.getVDBName());
+ assertEquals(1, s.getVDBVersion());
+ assertNotNull(s.getSessionId());
+
+ conn.close();
+ } catch (Exception e) {
+ fail("should have connected to the vdb");
+ }
+
+ try {
+ Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user;ApplicationName=test", null);
+ sessions = admin.getSessions();
+ assertEquals (1, sessions.size());
+ Session s = sessions.iterator().next();
+
+ admin.terminateSession(s.getSessionId());
+ sessions = admin.getSessions();
+ assertEquals (0, sessions.size());
+ conn.close();
+ } catch (Exception e) {
+ fail("should have connected to the vdb");
+ }
+
+ } finally {
+ if (vdbOneDeployed) {
+ admin.undeploy("bqt.vdb");
+ }
+
+ }
+ }
+
+ private boolean deployVdb() throws AdminException, FileNotFoundException {
+ boolean vdbOneDeployed;
+ admin.deploy("bqt.vdb", new FileInputStream(UnitTestUtil.getTestDataFile("bqt.vdb")));
+ vdbOneDeployed = true;
+
+ VDB vdb = admin.getVDB("bqt", 1);
+ Model model = vdb.getModels().get(0);
+ admin.assignToModel("bqt", 1, model.getName(), "Source", "h2", "java:jboss/datasources/ExampleDS");
+ return vdbOneDeployed;
+ }
+
+ @Test
+ public void testGetRequests() throws Exception {
+ boolean vdbOneDeployed = false;
+ JavaArchive jar = getLoopyArchive();
+
+ try {
+ admin.deploy("loopy.jar", jar.as(ZipExporter.class).exportAsInputStream());
+ vdbOneDeployed = deployVdb();
+ VDB vdb = admin.getVDB("bqt", 1);
+ Model model = vdb.getModels().get(0);
+ Translator t = admin.getTranslator("loopy");
+ assertNotNull(t);
+
+ admin.assignToModel("bqt", 1, model.getName(), "Source", "loopy", "java:jboss/datasources/ExampleDS");
+ Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user", null);
+ Collection<? extends Session> sessions = admin.getSessions();
+ assertEquals (1, sessions.size());
+ Session s = sessions.iterator().next();
+
+ Statement stmt = conn.createStatement();
+
+ Collection<? extends Request> requests = admin.getRequests();
+
+ assertEquals(0, requests.size());
+
+ stmt.execute("select * from source.smalla");
+
+ requests = admin.getRequests();
+ assertEquals(1, requests.size());
+
+ Request r = requests.iterator().next();
+ assertEquals("select * from source.smalla", r.getCommand());
+ assertNotNull(r.getExecutionId());
+ assertNotNull(r.getSessionId());
+
+ stmt.execute("select * from source.smalla");
+ Collection<? extends Request> requests2 = admin.getRequestsForSession(s.getSessionId());
+ assertEquals(1, requests2.size());
+
+ Request r2 = requests.iterator().next();
+ assertEquals("select * from source.smalla", r2.getCommand());
+ assertEquals(s.getSessionId(), r2.getSessionId());
+
+ stmt.close();
+ conn.close();
+
+ requests = admin.getRequests();
+ assertEquals(0, requests.size());
+
+ } finally {
+ admin.undeploy("loopy.jar");
+ if (vdbOneDeployed) {
+ admin.undeploy("bqt.vdb");
+ }
+ }
+ }
+
+ @Test
+ public void getDatasourceTemplateNames() throws Exception {
+ String[] array = {"teiid-connector-file.rar", "teiid-connector-salesforce.rar", "teiid-connector-ldap.rar", "teiid-connector-ws.rar", "h2"};
+ boolean vdbOneDeployed = false;
+ try {
+ vdbOneDeployed = deployVdb();
+ Set<String> templates = admin.getDataSourceTemplateNames();
+ assertArrayEquals(array, templates.toArray());
+ } finally {
+ if (vdbOneDeployed) {
+ admin.undeploy("bqt.vdb");
+ }
+ }
+ }
+
+ @Test
+ public void getTemplatePropertyDefinitions() throws Exception{
+ boolean vdbOneDeployed = false;
+ try {
+ HashSet<String> props = new HashSet<String>();
+ vdbOneDeployed = deployVdb();
+ Collection<? extends PropertyDefinition> pds = admin.getTemplatePropertyDefinitions("h2");
+ for(PropertyDefinition pd:pds) {
+ props.add(pd.getName());
+ }
+ assertTrue(props.contains("connection-url"));
+ assertTrue(props.contains("user-name"));
+ assertTrue(props.contains("password"));
+ assertTrue(props.contains("check-valid-connection-sql"));
+
+
+ HashSet<String> rar_props = new HashSet<String>();
+ pds = admin.getTemplatePropertyDefinitions("teiid-connector-file.rar");
+ for(PropertyDefinition pd:pds) {
+ rar_props.add(pd.getName());
+ }
+
+ assertTrue(rar_props.contains("ParentDirectory"));
+ assertTrue(rar_props.contains("FileMapping"));
+ assertTrue(rar_props.contains("AllowParentPaths"));
+
+ } finally {
+ if (vdbOneDeployed) {
+ admin.undeploy("bqt.vdb");
+ }
+ }
+ }
+
+ @Test
+ public void getWorkerPoolStats() throws Exception{
+ boolean vdbOneDeployed = false;
+ try {
+ vdbOneDeployed = deployVdb();
+ assertNotNull(admin.getWorkerPoolStats());
+ } finally {
+ if (vdbOneDeployed) {
+ admin.undeploy("bqt.vdb");
+ }
+ }
+ }
+
+ @Test
+ public void testDataRoleMapping() throws Exception{
+ boolean vdbOneDeployed = false;
+ try {
+ admin.deploy("bqt2.vdb", new FileInputStream(UnitTestUtil.getTestDataFile("bqt2.vdb")));
+ vdbOneDeployed = true;
+
+ VDB vdb = admin.getVDB("bqt", 2);
+ Model model = vdb.getModels().get(0);
+ admin.assignToModel("bqt", 2, model.getName(), "Source", "h2", "java:jboss/datasources/ExampleDS");
+
+ vdb = admin.getVDB("bqt", 2);
+ assertTrue(vdb.isValid());
+ List<DataPolicy> policies = vdb.getDataPolicies();
+ assertEquals(1, policies.size());
+
+ DataPolicy dp = policies.get(0);
+ assertEquals("roleOne", dp.getName());
+ assertEquals(2, dp.getPermissions().size());
+ assertTrue(dp.isAllowCreateTemporaryTables());
+ assertTrue(dp.isAnyAuthenticated());
+
+ List<String> roleNames = dp.getMappedRoleNames();
+ assertArrayEquals(new String[]{"ROLE1", "ROLE2"}, roleNames.toArray());
+
+ admin.removeDataRoleMapping("bqt", 2, "roleOne", "ROLE1");
+
+ vdb = admin.getVDB("bqt", 2);
+ policies = vdb.getDataPolicies();
+ dp = policies.get(0);
+
+ roleNames = dp.getMappedRoleNames();
+ assertArrayEquals(new String[]{"ROLE2"}, roleNames.toArray());
+
+ admin.addDataRoleMapping("bqt", 2, "roleOne", "ROLE3");
+
+ vdb = admin.getVDB("bqt", 2);
+ policies = vdb.getDataPolicies();
+ dp = policies.get(0);
+
+ roleNames = dp.getMappedRoleNames();
+ assertArrayEquals(new String[]{"ROLE2", "ROLE3"}, roleNames.toArray());
+
+ admin.setAnyAuthenticatedForDataRole("bqt", 2, "roleOne", false);
+
+ vdb = admin.getVDB("bqt", 2);
+ policies = vdb.getDataPolicies();
+ dp = policies.get(0);
+
+ assertFalse(dp.isAnyAuthenticated());
+ } finally {
+ if (vdbOneDeployed) {
+ admin.undeploy("bqt2.vdb");
+ }
+ }
+ }
+
+
+}
Property changes on: trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/test-integration/common/src/test/java/org/teiid/arquillian/TestDeployment.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/arquillian/TestDeployment.java 2011-12-08 19:19:34 UTC (rev 3728)
+++ trunk/test-integration/common/src/test/java/org/teiid/arquillian/TestDeployment.java 2011-12-09 21:44:19 UTC (rev 3729)
@@ -1,454 +0,0 @@
-package org.teiid.arquillian;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.sql.Connection;
-import java.sql.Statement;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
-import org.jboss.shrinkwrap.api.exporter.ZipExporter;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.teiid.adminapi.Admin;
-import org.teiid.adminapi.AdminException;
-import org.teiid.adminapi.AdminFactory;
-import org.teiid.adminapi.DataPolicy;
-import org.teiid.adminapi.Model;
-import org.teiid.adminapi.PropertyDefinition;
-import org.teiid.adminapi.Request;
-import org.teiid.adminapi.Session;
-import org.teiid.adminapi.Translator;
-import org.teiid.adminapi.VDB;
-import org.teiid.adminapi.VDB.ConnectionType;
-import org.teiid.adminapi.VDB.Status;
-import org.teiid.adminapi.impl.VDBTranslatorMetaData;
-import org.teiid.core.util.UnitTestUtil;
-import org.teiid.jdbc.TeiidDriver;
-
-(a)RunWith(Arquillian.class)
-@SuppressWarnings("nls")
-@Ignore
-public class TestDeployment {
-
- private Admin admin;
-
- @Before
- public void setup() throws Exception {
- admin = AdminFactory.getInstance().createAdmin("localhost", 9999, "admin", "admin".toCharArray());
- }
-
- @After
- public void teardown() {
- admin.close();
- }
-
- @Test
- public void testVDBDeployment() throws Exception {
- boolean deployed = false;
- try {
- Set<?> vdbs = admin.getVDBs();
- assertTrue(vdbs.isEmpty());
-
- Collection<String> dsNames = admin.getDataSourceNames();
- if (dsNames.contains("Oracle11_PushDS")) {
- admin.deleteDataSource("Oracle11_PushDS");
- }
-
- admin.deploy("bqt.vdb",new FileInputStream(UnitTestUtil.getTestDataFile("bqt.vdb")));
- deployed = true;
-
- vdbs = admin.getVDBs();
- assertFalse(vdbs.isEmpty());
-
- VDB vdb = admin.getVDB("bqt", 1);
- assertFalse(vdb.isValid());
- assertTrue(vdb.getStatus().equals(Status.INACTIVE));
-
- Properties props = new Properties();
- props.setProperty("connection-url","jdbc:h2:mem:test;DB_CLOSE_DELAY=-1");
- props.setProperty("user-name", "sa");
- props.setProperty("password", "sa");
-
- admin.createDataSource("Oracle11_PushDS", "h2", props);
- Thread.sleep(2000);
- vdb = admin.getVDB("bqt", 1);
- assertTrue(vdb.isValid());
- assertTrue(vdb.getStatus().equals(Status.ACTIVE));
-
- dsNames = admin.getDataSourceNames();
- assertTrue(dsNames.contains("Oracle11_PushDS"));
-
- admin.deleteDataSource("Oracle11_PushDS");
- vdb = admin.getVDB("bqt", 1);
- assertFalse(vdb.isValid());
- assertTrue(vdb.getStatus().equals(Status.INACTIVE));
- } finally {
- if (deployed) {
- admin.undeploy("bqt.vdb");
- }
- }
- }
-
- @Test
- public void testTraslators() throws Exception {
- Collection<? extends Translator> translators = admin.getTranslators();
- System.out.println(translators);
- assertEquals(29, translators.size());
-
- JavaArchive jar = getLoopyArchive();
-
- try {
- admin.deploy("loopy.jar", jar.as(ZipExporter.class).exportAsInputStream());
-
- VDBTranslatorMetaData t = (VDBTranslatorMetaData)admin.getTranslator("loopy");
- assertNotNull(t);
- assertEquals("ANY", t.getPropertyValue("SupportedJoinCriteria"));
- assertEquals("true", t.getPropertyValue("supportsSelectDistinct"));
- } finally {
- admin.undeploy("loopy.jar");
- }
-
- VDBTranslatorMetaData t = (VDBTranslatorMetaData)admin.getTranslator("orcl");
- assertNull(t);
- }
-
- private JavaArchive getLoopyArchive() {
- JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "loopy.jar")
- .addClasses(SampleExecutionFactory.class)
- .addAsManifestResource(new ByteArrayAsset(SampleExecutionFactory.class.getName().getBytes()),
- ArchivePaths.create("services/org.teiid.translator.ExecutionFactory"));
- jar.addAsManifestResource(new ByteArrayAsset("Dependencies: org.jboss.teiid.translator.loopback\n".getBytes()),
- ArchivePaths.create("MANIFEST.MF"));
- return jar;
- }
-
- @Test
- public void testVDBConnectionType() throws Exception {
- boolean vdbOneDeployed = false;
- boolean vdbTwoDeployed = false;
- try {
-
- admin.deploy("bqt.vdb", new FileInputStream(UnitTestUtil.getTestDataFile("bqt.vdb")));
- vdbOneDeployed = true;
-
- VDB vdb = admin.getVDB("bqt", 1);
- Model model = vdb.getModels().get(0);
- admin.assignToModel("bqt", 1, model.getName(), "Source", "h2", "java:jboss/datasources/ExampleDS");
- assertEquals(ConnectionType.BY_VERSION, vdb.getConnectionType());
-
- try {
- Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user", null);
- conn.close();
- } catch (Exception e) {
- fail("must have succeeded in connection");
- }
-
- admin.changeVDBConnectionType("bqt", 1, ConnectionType.NONE);
-
- try {
- TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user", null);
- fail("should have failed to connect as no new connections allowed");
- } catch (Exception e) {
- //pass
- }
-
- admin.deploy("bqt2.vdb", new FileInputStream(UnitTestUtil.getTestDataFile("bqt2.vdb")));
- admin.assignToModel("bqt", 2, model.getName(), "Source", "h2", "java:jboss/datasources/ExampleDS");
-
- vdbTwoDeployed = true;
-
- try {
- Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user", null);
- conn.close();
- } catch (Exception e) {
- fail("should not have failed to connect");
- }
-
- admin.changeVDBConnectionType("bqt", 2, ConnectionType.ANY);
- try {
- Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user", null);
- conn.close();
- } catch (Exception e) {
- fail("should have connected to the second vdb");
- }
-
- vdb = admin.getVDB("bqt", 2);
- model = vdb.getModels().get(0);
- assertEquals(model.getSourceConnectionJndiName("Source"), "java:jboss/datasources/ExampleDS");
- assertEquals(model.getSourceTranslatorName("Source"), "h2");
- assertEquals(ConnectionType.ANY, vdb.getConnectionType());
-
- } finally {
- if (vdbOneDeployed) {
- admin.undeploy("bqt.vdb");
- }
- if (vdbTwoDeployed) {
- admin.undeploy("bqt2.vdb");
- }
- }
- }
-
- @Test
- public void testCacheTypes() throws Exception {
- String[] array = {Admin.Cache.PREPARED_PLAN_CACHE.toString(), Admin.Cache.QUERY_SERVICE_RESULT_SET_CACHE.toString()};
- Collection<String> types = admin.getCacheTypes();
- System.out.println(types);
- assertArrayEquals(array, types.toArray());
- }
-
- @Test
- public void testSessions() throws Exception {
- boolean vdbOneDeployed = false;
- try {
- vdbOneDeployed = deployVdb();
-
- Collection<? extends Session> sessions = admin.getSessions();
- assertEquals (0, sessions.size());
-
- try {
- Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user;ApplicationName=test", null);
- sessions = admin.getSessions();
- assertEquals (1, sessions.size());
- Session s = sessions.iterator().next();
-
- assertEquals("user@teiid-security", s.getUserName());
- assertEquals("test", s.getApplicationName());
- assertEquals("bqt", s.getVDBName());
- assertEquals(1, s.getVDBVersion());
- assertNotNull(s.getSessionId());
-
- conn.close();
- } catch (Exception e) {
- fail("should have connected to the vdb");
- }
-
- try {
- Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user;ApplicationName=test", null);
- sessions = admin.getSessions();
- assertEquals (1, sessions.size());
- Session s = sessions.iterator().next();
-
- admin.terminateSession(s.getSessionId());
- sessions = admin.getSessions();
- assertEquals (0, sessions.size());
- conn.close();
- } catch (Exception e) {
- fail("should have connected to the vdb");
- }
-
- } finally {
- if (vdbOneDeployed) {
- admin.undeploy("bqt.vdb");
- }
-
- }
- }
-
- private boolean deployVdb() throws AdminException, FileNotFoundException {
- boolean vdbOneDeployed;
- admin.deploy("bqt.vdb", new FileInputStream(UnitTestUtil.getTestDataFile("bqt.vdb")));
- vdbOneDeployed = true;
-
- VDB vdb = admin.getVDB("bqt", 1);
- Model model = vdb.getModels().get(0);
- admin.assignToModel("bqt", 1, model.getName(), "Source", "h2", "java:jboss/datasources/ExampleDS");
- return vdbOneDeployed;
- }
-
- @Test
- public void testGetRequests() throws Exception {
- boolean vdbOneDeployed = false;
- JavaArchive jar = getLoopyArchive();
-
- try {
- admin.deploy("loopy.jar", jar.as(ZipExporter.class).exportAsInputStream());
- vdbOneDeployed = deployVdb();
- VDB vdb = admin.getVDB("bqt", 1);
- Model model = vdb.getModels().get(0);
- Translator t = admin.getTranslator("loopy");
- assertNotNull(t);
-
- admin.assignToModel("bqt", 1, model.getName(), "Source", "loopy", "java:jboss/datasources/ExampleDS");
- Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:bqt@mm://localhost:31000;user=user;password=user", null);
- Collection<? extends Session> sessions = admin.getSessions();
- assertEquals (1, sessions.size());
- Session s = sessions.iterator().next();
-
- Statement stmt = conn.createStatement();
-
- Collection<? extends Request> requests = admin.getRequests();
-
- assertEquals(0, requests.size());
-
- stmt.execute("select * from source.smalla");
-
- requests = admin.getRequests();
- assertEquals(1, requests.size());
-
- Request r = requests.iterator().next();
- assertEquals("select * from source.smalla", r.getCommand());
- assertNotNull(r.getExecutionId());
- assertNotNull(r.getSessionId());
-
- stmt.execute("select * from source.smalla");
- Collection<? extends Request> requests2 = admin.getRequestsForSession(s.getSessionId());
- assertEquals(1, requests2.size());
-
- Request r2 = requests.iterator().next();
- assertEquals("select * from source.smalla", r2.getCommand());
- assertEquals(s.getSessionId(), r2.getSessionId());
-
- stmt.close();
- conn.close();
-
- requests = admin.getRequests();
- assertEquals(0, requests.size());
-
- } finally {
- admin.undeploy("loopy.jar");
- if (vdbOneDeployed) {
- admin.undeploy("bqt.vdb");
- }
- }
- }
-
- @Test
- public void getDatasourceTemplateNames() throws Exception {
- String[] array = {"teiid-connector-file.rar", "teiid-connector-salesforce.rar", "teiid-connector-ldap.rar", "teiid-connector-ws.rar", "h2"};
- boolean vdbOneDeployed = false;
- try {
- vdbOneDeployed = deployVdb();
- Set<String> templates = admin.getDataSourceTemplateNames();
- assertArrayEquals(array, templates.toArray());
- } finally {
- if (vdbOneDeployed) {
- admin.undeploy("bqt.vdb");
- }
- }
- }
-
- @Test
- public void getTemplatePropertyDefinitions() throws Exception{
- boolean vdbOneDeployed = false;
- try {
- HashSet<String> props = new HashSet<String>();
- vdbOneDeployed = deployVdb();
- Collection<? extends PropertyDefinition> pds = admin.getTemplatePropertyDefinitions("h2");
- for(PropertyDefinition pd:pds) {
- props.add(pd.getName());
- }
- assertTrue(props.contains("connection-url"));
- assertTrue(props.contains("user-name"));
- assertTrue(props.contains("password"));
- assertTrue(props.contains("check-valid-connection-sql"));
-
-
- HashSet<String> rar_props = new HashSet<String>();
- pds = admin.getTemplatePropertyDefinitions("teiid-connector-file.rar");
- for(PropertyDefinition pd:pds) {
- rar_props.add(pd.getName());
- }
-
- assertTrue(rar_props.contains("ParentDirectory"));
- assertTrue(rar_props.contains("FileMapping"));
- assertTrue(rar_props.contains("AllowParentPaths"));
-
- } finally {
- if (vdbOneDeployed) {
- admin.undeploy("bqt.vdb");
- }
- }
- }
-
- @Test
- public void getWorkerPoolStats() throws Exception{
- boolean vdbOneDeployed = false;
- try {
- vdbOneDeployed = deployVdb();
- assertNotNull(admin.getWorkerPoolStats());
- } finally {
- if (vdbOneDeployed) {
- admin.undeploy("bqt.vdb");
- }
- }
- }
-
- @Test
- public void testDataRoleMapping() throws Exception{
- boolean vdbOneDeployed = false;
- try {
- admin.deploy("bqt2.vdb", new FileInputStream(UnitTestUtil.getTestDataFile("bqt2.vdb")));
- vdbOneDeployed = true;
-
- VDB vdb = admin.getVDB("bqt", 2);
- Model model = vdb.getModels().get(0);
- admin.assignToModel("bqt", 2, model.getName(), "Source", "h2", "java:jboss/datasources/ExampleDS");
-
- vdb = admin.getVDB("bqt", 2);
- assertTrue(vdb.isValid());
- List<DataPolicy> policies = vdb.getDataPolicies();
- assertEquals(1, policies.size());
-
- DataPolicy dp = policies.get(0);
- assertEquals("roleOne", dp.getName());
- assertEquals(2, dp.getPermissions().size());
- assertTrue(dp.isAllowCreateTemporaryTables());
- assertTrue(dp.isAnyAuthenticated());
-
- List<String> roleNames = dp.getMappedRoleNames();
- assertArrayEquals(new String[]{"ROLE1", "ROLE2"}, roleNames.toArray());
-
- admin.removeDataRoleMapping("bqt", 2, "roleOne", "ROLE1");
-
- vdb = admin.getVDB("bqt", 2);
- policies = vdb.getDataPolicies();
- dp = policies.get(0);
-
- roleNames = dp.getMappedRoleNames();
- assertArrayEquals(new String[]{"ROLE2"}, roleNames.toArray());
-
- admin.addDataRoleMapping("bqt", 2, "roleOne", "ROLE3");
-
- vdb = admin.getVDB("bqt", 2);
- policies = vdb.getDataPolicies();
- dp = policies.get(0);
-
- roleNames = dp.getMappedRoleNames();
- assertArrayEquals(new String[]{"ROLE2", "ROLE3"}, roleNames.toArray());
-
- admin.setAnyAuthenticatedForDataRole("bqt", 2, "roleOne", false);
-
- vdb = admin.getVDB("bqt", 2);
- policies = vdb.getDataPolicies();
- dp = policies.get(0);
-
- assertFalse(dp.isAnyAuthenticated());
- } finally {
- if (vdbOneDeployed) {
- admin.undeploy("bqt2.vdb");
- }
- }
- }
-
-
-}
Modified: trunk/test-integration/common/src/test/resources/arquillian.xml
===================================================================
--- trunk/test-integration/common/src/test/resources/arquillian.xml 2011-12-08 19:19:34 UTC (rev 3728)
+++ trunk/test-integration/common/src/test/resources/arquillian.xml 2011-12-09 21:44:19 UTC (rev 3729)
@@ -8,10 +8,8 @@
<property name="executionType">REMOTE</property>
</protocol>
<configuration>
- <property name="jbossHome">/home/rareddy/testing/jboss-as-7.1.0.Beta1</property>
- <property name="serverConfig">standalone-teiid.xml</property>
- <property name="managementAddress">127.0.0.1</property>
- <property name="managementPort">9999</property>
+ <property name="jbossHome">${jbossHome}</property>
+ <property name="serverConfig">${serverConfig}</property>
<property name="javaVmArguments">-Xmx512m -XX:MaxPermSize=128m -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n</property>
</configuration>
</container>
13 years
teiid SVN: r3728 - in trunk: documentation/developer-guide/src/main/docbook/en-US/content and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-12-08 14:19:34 -0500 (Thu, 08 Dec 2011)
New Revision: 3728
Modified:
trunk/api/src/main/java/org/teiid/CommandListener.java
trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
Log:
TEIID-1604 cleaning up methods/javadoc and adding a commandlistener for close events.
Modified: trunk/api/src/main/java/org/teiid/CommandListener.java
===================================================================
--- trunk/api/src/main/java/org/teiid/CommandListener.java 2011-12-08 18:54:42 UTC (rev 3727)
+++ trunk/api/src/main/java/org/teiid/CommandListener.java 2011-12-08 19:19:34 UTC (rev 3728)
@@ -22,6 +22,9 @@
package org.teiid;
+/**
+ * Listener for command events.
+ */
public interface CommandListener {
void commandClosed(CommandContext context);
Modified: trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
===================================================================
--- trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2011-12-08 18:54:42 UTC (rev 3727)
+++ trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2011-12-08 19:19:34 UTC (rev 3728)
@@ -268,7 +268,7 @@
<title>ExecutionContext</title>
<para>The <code>org.teiid.translator.ExecutionContext</code> provides a considerable amount of information related to the current execution.
An <code>ExecutionContext</code> instance is made available to each <code>Execution</code>. Specific usage is highlighted in this guide where applicable, but you may use any informational getter method as desired.
- Example usage would include calling <code>ExecutionContext.getRequestIdentifier()</code>, <code>ExecutionContext.getSession()</code>, etc. for logging purposes.</para>
+ Example usage would include calling <code>ExecutionContext.getRequestId()</code>, <code>ExecutionContext.getSession()</code>, etc. for logging purposes.</para>
<section>
<title>Source Hints</title>
13 years
teiid SVN: r3727 - in trunk: api/src/main/java/org/teiid/translator and 15 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-12-08 13:54:42 -0500 (Thu, 08 Dec 2011)
New Revision: 3727
Added:
trunk/api/src/main/java/org/teiid/CommandListener.java
Modified:
trunk/api/src/main/java/org/teiid/CommandContext.java
trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
trunk/engine/src/main/java/org/teiid/query/processor/BatchCollector.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.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/TempTableDataManager.java
trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/FakeExecutionContextImpl.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java
trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
Log:
TEIID-1604 cleaning up methods/javadoc and adding a commandlistener for close events.
Modified: trunk/api/src/main/java/org/teiid/CommandContext.java
===================================================================
--- trunk/api/src/main/java/org/teiid/CommandContext.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/api/src/main/java/org/teiid/CommandContext.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -60,6 +60,13 @@
* Get the connection id
* @return
*/
+ String getConnectionId();
+
+ /**
+ * Get the connection id
+ * @return
+ * @deprecated see {@link #getConnectionId()}
+ */
String getConnectionID();
/**
@@ -124,5 +131,17 @@
* @return
*/
VDB getVdb();
+
+ /**
+ * Add a listener for command events
+ * @param listener
+ */
+ void addListener(CommandListener listener);
+
+ /**
+ * Add a listener for command events
+ * @param listener
+ */
+ void removeListener(CommandListener listener);
}
Added: trunk/api/src/main/java/org/teiid/CommandListener.java
===================================================================
--- trunk/api/src/main/java/org/teiid/CommandListener.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/CommandListener.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -0,0 +1,29 @@
+/*
+ * 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;
+
+public interface CommandListener {
+
+ void commandClosed(CommandContext context);
+
+}
Property changes on: trunk/api/src/main/java/org/teiid/CommandListener.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -53,13 +53,19 @@
/**
* Get the identifier for the command being executed. This can be
* correlated back to identifiers exposed in other parts of the system.
+ * shortcut for {@link #getCommandContext()}.getRequestId()
* @return command identifier
*/
- String getRequestIdentifier();
+ String getRequestId();
/**
+ * @deprecated see {@link #getRequestId()}
+ * @return
+ */
+ String getRequestID();
+
+ /**
* This specifies the node id for the atomic request in the relational plan of query.
- * when combined with the request identifier, uniquely identifies a command sent to a connector.
*/
String getPartIdentifier();
@@ -73,14 +79,28 @@
/**
* Get the name of the VDB this query is being run against.
+ * shortcut for {@link #getCommandContext()}.getVdbName()
* @return VDB name, never null
*/
+ String getVdbName();
+
+ /**
+ * @deprecated see {@link #getVdbName()}
+ * @return
+ */
String getVirtualDatabaseName();
/**
* Get the version of the VDB this query is being run against.
- * @return VDB version, never null
+ * shortcut for {@link #getCommandContext()}.getVdbVersion()
+ * @return VDB version
*/
+ int getVdbVersion();
+
+ /**
+ * @deprecated see {@link #getVdbVersion()}
+ * @return
+ */
int getVirtualDatabaseVersion();
/**
@@ -88,18 +108,17 @@
* @return User, never null
*/
Subject getSubject();
+
+ /**
+ * Get the command payload
+ * shortcut for {@link #getCommandContext()}.getCommandPayload()
+ * @return the payload or null if one was not set by the client
+ */
+ Serializable getCommandPayload();
/**
- * Get the trusted payload passed when the user statement was executed.
- * Teiid has no knowledge about what the payload contains - it is merely
- * passed through the system. It is most often used to pass security
- * information such as credentials.
- *
- * <p>Given that the Execution Payload is not authenticated by the Teiid
- * system, connector writers are responsible for ensuring its validity. </p>
- *
- * @return Trusted execution payload if one exists, otherwise null
- * @since 4.2
+ * @deprecated see {@link #getCommandPayload()
+ * @return
*/
Serializable getExecutionPayload();
@@ -117,13 +136,20 @@
/**
* Get the identifier for the connection through which
- * the command is being executed. This represents the original JDBC user
+ * the command is being executed. This represents the original user
* connection to the Teiid system
+ * shortcut for {@link #getCommandContext()}.getConnectionId()
* @return Connection identifier
*/
- String getConnectionIdentifier();
+ String getConnectionId();
/**
+ * @deprecated see {@link #getConnectionId()}
+ * @return
+ */
+ String getConnectionID();
+
+ /**
* When the execution is turned on with "alive=true", the execution object will not
* be implicitly closed at the end of the last batch. It will only be closed at end
* of the user query.
@@ -159,6 +185,7 @@
/**
* Get the current session.
+ * shortcut for {@link #getCommandContext()}.getSession()
* @return
*/
Session getSession();
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -139,7 +139,7 @@
statement.setFetchSize(fetchSize);
} catch (SQLException e) {
if (LogManager.isMessageToBeRecorded(LogConstants.CTX_CONNECTOR, MessageLevel.DETAIL)) {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, context.getRequestIdentifier(), " could not set fetch size: ", fetchSize); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, context.getRequestId(), " could not set fetch size: ", fetchSize); //$NON-NLS-1$
}
}
}
@@ -191,7 +191,7 @@
warning = toAdd.getNextWarning();
toAdd.setNextException(null);
if (LogManager.isMessageToBeRecorded(LogConstants.CTX_CONNECTOR, MessageLevel.DETAIL)) {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, context.getRequestIdentifier() + " Warning: ", warning); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, context.getRequestId() + " Warning: ", warning); //$NON-NLS-1$
}
context.addWarning(toAdd);
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -722,7 +722,7 @@
*/
public String getSourceComment(ExecutionContext context, Command command) {
if (addSourceComment() && context != null) {
- return COMMENT.get().format(new Object[] {context.getConnectionIdentifier(), context.getRequestIdentifier(), context.getPartIdentifier()});
+ return COMMENT.get().format(new Object[] {context.getConnectionId(), context.getRequestId(), context.getPartIdentifier()});
}
return ""; //$NON-NLS-1$
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -353,7 +353,7 @@
boolean usingPayloadComment = false;
if (context != null) {
// Check for db hints
- Object payload = context.getExecutionPayload();
+ Object payload = context.getCommandPayload();
if (payload instanceof String) {
String payloadString = (String)payload;
if (payloadString.startsWith(HINT_PREFIX)) {
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -116,9 +116,9 @@
this.context = context;
this.query = command;
- connectionIdentifier = context.getConnectionIdentifier();
+ connectionIdentifier = context.getConnectionId();
connectorIdentifier = context.getConnectorIdentifier();
- requestIdentifier = context.getRequestIdentifier();
+ requestIdentifier = context.getRequestId();
partIdentifier = context.getPartIdentifier();
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -93,7 +93,7 @@
}
@Override
- public String getRequestIdentifier() {
+ public String getRequestId() {
return this.commandContext.getRequestId();
}
@@ -107,11 +107,11 @@
return this.executeCount;
}
@Override
- public String getVirtualDatabaseName() {
+ public String getVdbName() {
return this.commandContext.getVdbName();
}
@Override
- public int getVirtualDatabaseVersion() {
+ public int getVdbVersion() {
return this.commandContext.getVdbVersion();
}
@Override
@@ -120,13 +120,13 @@
}
@Override
- public Serializable getExecutionPayload() {
+ public Serializable getCommandPayload() {
return this.commandContext.getCommandPayload();
}
@Override
- public String getConnectionIdentifier() {
- return this.commandContext.getConnectionID();
+ public String getConnectionId() {
+ return this.commandContext.getConnectionId();
}
@Override
public void keepExecutionAlive(boolean alive) {
@@ -145,7 +145,7 @@
return false;
}
ExecutionContext other = (ExecutionContext) obj;
- return compareWithNull(this.getRequestIdentifier(), other.getRequestIdentifier()) &&
+ return compareWithNull(this.getRequestId(), other.getRequestId()) &&
compareWithNull(this.getPartIdentifier(), other.getPartIdentifier());
}
@@ -163,7 +163,7 @@
}
public int hashCode() {
- return HashCodeUtil.hashCode(HashCodeUtil.hashCode(0, getRequestIdentifier()), partID);
+ return HashCodeUtil.hashCode(HashCodeUtil.hashCode(0, getRequestId()), partID);
}
public String toString() {
@@ -173,7 +173,7 @@
userName = p.getName();
}
}
- return "ExecutionContext<vdb=" + this.getVirtualDatabaseName() + ", version=" + this.getVirtualDatabaseVersion() + ", user=" + userName + ">"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ return "ExecutionContext<vdb=" + this.getVdbName() + ", version=" + this.getVdbVersion() + ", user=" + userName + ">"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
@Override
@@ -256,4 +256,30 @@
public void setHint(String hint) {
this.hint = hint;
}
+
+ @Override
+ public String getConnectionID() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Serializable getExecutionPayload() {
+ return getCommandPayload();
+ }
+
+ @Override
+ public String getRequestID() {
+ return getRequestId();
+ }
+
+ @Override
+ public String getVirtualDatabaseName() {
+ return getVdbName();
+ }
+
+ @Override
+ public int getVirtualDatabaseVersion() {
+ return getVdbVersion();
+ }
}
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-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -564,7 +564,7 @@
this.resultsBuffer = collector.getTupleBuffer();
if (this.resultsBuffer == null) {
//This is just a dummy result it will get replaced by collector source
- resultsBuffer = this.processor.getBufferManager().createTupleBuffer(this.originalCommand.getProjectedSymbols(), this.request.context.getConnectionID(), TupleSourceType.FINAL);
+ resultsBuffer = this.processor.getBufferManager().createTupleBuffer(this.originalCommand.getProjectedSymbols(), this.request.context.getConnectionId(), TupleSourceType.FINAL);
}
analysisRecord = request.analysisRecord;
transactionContext = request.transactionContext;
Modified: trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -1277,7 +1277,7 @@
}
public static Object session_id(CommandContext context) {
- return context.getConnectionID();
+ return context.getConnectionId();
}
// ================= Function - MODIFYTIMEZONE ========================
Modified: trunk/engine/src/main/java/org/teiid/query/processor/BatchCollector.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/BatchCollector.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/main/java/org/teiid/query/processor/BatchCollector.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -124,7 +124,7 @@
this.sourceNode = sourceNode;
this.forwardOnly = forwardOnly;
if (!this.sourceNode.hasFinalBuffer()) {
- this.buffer = bm.createTupleBuffer(sourceNode.getOutputElements(), context.getConnectionID(), TupleSourceType.PROCESSOR);
+ this.buffer = bm.createTupleBuffer(sourceNode.getOutputElements(), context.getConnectionId(), TupleSourceType.PROCESSOR);
this.buffer.setForwardOnly(forwardOnly);
}
}
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-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -505,9 +505,9 @@
state.processor = new QueryProcessor(command, subContext, this.bufferMgr, this.dataMgr);
state.ts = new BatchIterator(state.processor);
if (procAssignments != null && state.processor.getOutputElements().size() - procAssignments.size() > 0) {
- state.resultsBuffer = bufferMgr.createTupleBuffer(state.processor.getOutputElements().subList(0, state.processor.getOutputElements().size() - procAssignments.size()), getContext().getConnectionID(), TupleSourceType.PROCESSOR);
+ state.resultsBuffer = bufferMgr.createTupleBuffer(state.processor.getOutputElements().subList(0, state.processor.getOutputElements().size() - procAssignments.size()), getContext().getConnectionId(), TupleSourceType.PROCESSOR);
} else if (this.blockContext != null) {
- state.resultsBuffer = bufferMgr.createTupleBuffer(state.processor.getOutputElements(), getContext().getConnectionID(), TupleSourceType.PROCESSOR);
+ state.resultsBuffer = bufferMgr.createTupleBuffer(state.processor.getOutputElements(), getContext().getConnectionId(), TupleSourceType.PROCESSOR);
}
this.currentState = state;
}
@@ -595,7 +595,7 @@
}
public void push(Program program) throws XATransactionException {
- program.reset(this.getContext().getConnectionID());
+ program.reset(this.getContext().getConnectionId());
TempTableStore tts = getTempTableStore();
getContext().setTempTableStore(program.getTempTableStore());
program.getTempTableStore().setParentTempTableStore(tts);
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -146,7 +146,7 @@
}
protected String getConnectionID() {
- return this.getProcessingState().context.getConnectionID();
+ return this.getProcessingState().context.getConnectionId();
}
protected int getBatchSize() {
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-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -101,7 +101,7 @@
}
if (this.with != null) {
context = context.clone();
- tempTableStore = new TempTableStore(context.getConnectionID(), TransactionMode.NONE);
+ tempTableStore = new TempTableStore(context.getConnectionId(), TransactionMode.NONE);
tempTableStore.setParentTempTableStore(context.getTempTableStore());
context.setTempTableStore(tempTableStore);
for (WithQueryCommand withCommand : this.with) {
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-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -111,7 +111,7 @@
public void initialize(CommandContext context, ProcessorDataManager dataMgr, BufferManager bufferMgr) {
context = context.clone();
setContext(context);
- TempTableStore tempTableStore = new TempTableStore(context.getConnectionID(), TransactionMode.NONE);
+ TempTableStore tempTableStore = new TempTableStore(context.getConnectionId(), TransactionMode.NONE);
tempTableStore.setParentTempTableStore(context.getTempTableStore());
context.setTempTableStore(tempTableStore);
this.dataMgr = dataMgr;
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -223,7 +223,7 @@
hash |= (hash >>> 8);
hash &= 0x000000ff;
CacheID cid = new CacheID(new ParseInfo(), fullName + hash, context.getVdbName(),
- context.getVdbVersion(), context.getConnectionID(), context.getUserName());
+ context.getVdbVersion(), context.getConnectionId(), context.getUserName());
cid.setParameters(vals);
CachedResults results = cache.get(cid);
if (results != null) {
Modified: trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -25,6 +25,7 @@
import java.io.Serializable;
import java.util.Collections;
import java.util.HashSet;
+import java.util.IdentityHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -36,6 +37,7 @@
import javax.security.auth.Subject;
+import org.teiid.CommandListener;
import org.teiid.adminapi.DataPolicy;
import org.teiid.adminapi.Session;
import org.teiid.adminapi.VDB;
@@ -140,6 +142,7 @@
private SourceHint sourceHint;
private Executor executor = ExecutorUtils.getDirectExecutor();
Map<String, ReusableExecution<?>> reusableExecutions;
+ Set<CommandListener> commandListeners = null;
}
private GlobalState globalState = new GlobalState();
@@ -229,31 +232,23 @@
public String toString() {
return "CommandContext: " + globalState.processorID; //$NON-NLS-1$
}
-
- /**
- * @return String
- */
+
+ public String getConnectionId() {
+ return globalState.connectionID;
+ }
+
public String getConnectionID() {
return globalState.connectionID;
}
- /**
- * @return String
- */
public String getUserName() {
return globalState.userName;
}
- /**
- * @return String
- */
public String getVdbName() {
return globalState.vdbName;
}
- /**
- * @return String
- */
public int getVdbVersion() {
return globalState.vdbVersion;
}
@@ -501,7 +496,7 @@
if (this.globalState.planCache == null) {
return null;
}
- CacheID id = new CacheID(new ParseInfo(), key, getVdbName(), getVdbVersion(), getConnectionID(), getUserName());
+ CacheID id = new CacheID(new ParseInfo(), key, getVdbName(), getVdbVersion(), getConnectionId(), getUserName());
PreparedPlan pp = this.globalState.planCache.get(id);
if (pp != null) {
if (id.getSessionId() != null) {
@@ -518,7 +513,7 @@
if (this.globalState.planCache == null) {
return;
}
- CacheID id = new CacheID(new ParseInfo(), key, getVdbName(), getVdbVersion(), getConnectionID(), getUserName());
+ CacheID id = new CacheID(new ParseInfo(), key, getVdbName(), getVdbVersion(), getConnectionId(), getUserName());
this.globalState.planCache.put(id, determinismLevel, plan, null);
}
@@ -644,29 +639,69 @@
}
public ReusableExecution<?> getReusableExecution(String nodeId) {
- if (this.globalState.reusableExecutions == null) {
- return null;
+ synchronized (this.globalState) {
+ if (this.globalState.reusableExecutions == null) {
+ return null;
+ }
+ return this.globalState.reusableExecutions.get(nodeId);
}
- return this.globalState.reusableExecutions.get(nodeId);
}
public void putReusableExecution(String nodeId, ReusableExecution<?> execution) {
- if (this.globalState.reusableExecutions == null) {
- this.globalState.reusableExecutions = new ConcurrentHashMap<String, ReusableExecution<?>>();
+ synchronized (this.globalState) {
+ if (this.globalState.reusableExecutions == null) {
+ this.globalState.reusableExecutions = new ConcurrentHashMap<String, ReusableExecution<?>>();
+ }
+ this.globalState.reusableExecutions.put(nodeId, execution);
}
- this.globalState.reusableExecutions.put(nodeId, execution);
}
public void close() {
- if (this.globalState.reusableExecutions != null) {
- for (ReusableExecution<?> reusableExecution : this.globalState.reusableExecutions.values()) {
- try {
- reusableExecution.dispose();
- } catch (Exception e) {
- LogManager.logWarning(LogConstants.CTX_DQP, e, "Unhandled exception disposing reusable execution"); //$NON-NLS-1$
+ synchronized (this.globalState) {
+ if (this.globalState.reusableExecutions != null) {
+ for (ReusableExecution<?> reusableExecution : this.globalState.reusableExecutions.values()) {
+ try {
+ reusableExecution.dispose();
+ } catch (Exception e) {
+ LogManager.logWarning(LogConstants.CTX_DQP, e, "Unhandled exception disposing reusable execution"); //$NON-NLS-1$
+ }
}
+ this.globalState.reusableExecutions.clear();
}
+ if (this.globalState.commandListeners != null) {
+ for (CommandListener listener : this.globalState.commandListeners) {
+ try {
+ listener.commandClosed(this);
+ } catch (Exception e) {
+ LogManager.logWarning(LogConstants.CTX_DQP, e, "Unhandled exception calling CommandListener"); //$NON-NLS-1$
+ }
+ }
+ this.globalState.commandListeners.clear();
+ }
}
}
+
+ @Override
+ public void addListener(CommandListener listener) {
+ if (listener != null) {
+ synchronized (this.globalState) {
+ if (this.globalState.commandListeners == null) {
+ this.globalState.commandListeners = Collections.newSetFromMap(new IdentityHashMap<CommandListener, Boolean>());
+ }
+ this.globalState.commandListeners.add(listener);
+ }
+ }
+ }
+
+ @Override
+ public void removeListener(CommandListener listener) {
+ if (listener != null) {
+ synchronized (this.globalState) {
+ if (this.globalState.commandListeners != null) {
+ this.globalState.commandListeners.remove(listener);
+ }
+ }
+ }
+ }
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/FakeExecutionContextImpl.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/FakeExecutionContextImpl.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/FakeExecutionContextImpl.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -48,9 +48,9 @@
}
public FakeExecutionContextImpl(ExecutionContext c) {
- super(c.getVirtualDatabaseName(), c.getVirtualDatabaseVersion(), c.getExecutionPayload(), c
- .getConnectionIdentifier(), c.getConnectorIdentifier(), Long.valueOf(c
- .getRequestIdentifier()), c.getPartIdentifier(), c
+ super(c.getVdbName(), c.getVdbVersion(), c.getCommandPayload(), c
+ .getConnectionId(), c.getConnectorIdentifier(), Long.valueOf(c
+ .getRequestId()), c.getPartIdentifier(), c
.getExecutionCountIdentifier());
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -124,7 +124,7 @@
DQPWorkContext workContext = RealMetadataFactory.buildWorkContext(metadata, RealMetadataFactory.example1VDB());
Request request = helpProcessMessage(message, null, workContext);
- assertEquals("1", request.context.getConnectionID()); //$NON-NLS-1$
+ assertEquals("1", request.context.getConnectionId()); //$NON-NLS-1$
}
private Request helpProcessMessage(RequestMessage message, SessionAwareCache<PreparedPlan> cache, DQPWorkContext workContext) throws TeiidComponentException,
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-12-08 17:13:56 UTC (rev 3726)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-12-08 18:54:42 UTC (rev 3727)
@@ -237,7 +237,7 @@
}
context.getNextRand(0);
if (context.getTempTableStore() == null) {
- context.setTempTableStore(new TempTableStore(context.getConnectionID(), TransactionMode.ISOLATE_WRITES));
+ context.setTempTableStore(new TempTableStore(context.getConnectionId(), TransactionMode.ISOLATE_WRITES));
}
if (context.getGlobalTableStore() == null) {
GlobalTableStoreImpl gts = new GlobalTableStoreImpl(bufferMgr, context.getMetadata());
13 years
teiid SVN: r3726 - in trunk/build: kits and 70 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-12-08 12:13:56 -0500 (Thu, 08 Dec 2011)
New Revision: 3726
Added:
trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/
trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/db2-xa.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/db2.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/modules/
trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/modules/com/
trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/modules/com/ibm/
trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/modules/com/ibm/db2/
trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/modules/com/ibm/db2/main/
trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/modules/com/ibm/db2/main/module.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/
trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/derby-xa.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/derby.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/modules/
trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/modules/org/
trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/modules/org/apache/
trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/modules/org/apache/derby/
trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/modules/org/apache/derby/main/
trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/modules/org/apache/derby/main/module.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/file/
trunk/build/kits/jboss-as7/docs/teiid/datasources/file/file.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/file/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/h2/
trunk/build/kits/jboss-as7/docs/teiid/datasources/h2/h2.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/h2/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/
trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/hive.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/modules/
trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/modules/org/
trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/modules/org/apache/
trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/modules/org/apache/hadoop/
trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/modules/org/apache/hadoop/hive/
trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/modules/org/apache/hadoop/hive/main/
trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/modules/org/apache/hadoop/hive/main/module.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/
trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/ingres-xa.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/ingres.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/modules/
trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/modules/com/
trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/modules/com/ingres/
trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/modules/com/ingres/main/
trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/modules/com/ingres/main/module.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/
trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/intersystems-cache.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/modules/
trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/modules/com/
trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/modules/com/intersys/
trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/modules/com/intersys/main/
trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/modules/com/intersys/main/module.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/ldap/
trunk/build/kits/jboss-as7/docs/teiid/datasources/ldap/ldap.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/ldap/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/
trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/modules/
trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/modules/com/
trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/modules/com/mysql/
trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/modules/com/mysql/main/
trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/modules/com/mysql/main/module.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/mysql-xa.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/mysql.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/odbc/
trunk/build/kits/jboss-as7/docs/teiid/datasources/odbc/odbc.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/odbc/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/
trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/modules/
trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/modules/org/
trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/modules/org/olap4j/
trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/modules/org/olap4j/main/
trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/modules/org/olap4j/main/module.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/mondrian.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/olap-xmla.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/
trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/modules/
trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/modules/com/
trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/modules/com/oracle/
trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/modules/com/oracle/main/
trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/modules/com/oracle/main/module.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/oracle-xa.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/oracle.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/
trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/modules/
trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/modules/org/
trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/modules/org/postgresql/
trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/modules/org/postgresql/main/
trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/modules/org/postgresql/main/module.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/postgresql-xa.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/postgresql.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce/
trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce/salesforce.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/modules/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/modules/net/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/modules/net/sourceforge/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/modules/net/sourceforge/jtds/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/modules/net/sourceforge/jtds/main/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/modules/net/sourceforge/jtds/main/module.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/sqlserver-xa.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/sqlserver.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/modules/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/modules/com/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/modules/com/microsoft/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/modules/com/microsoft/sqlserver/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/modules/com/microsoft/sqlserver/main/
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/modules/com/microsoft/sqlserver/main/module.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/sqlserver-xa.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/sqlserver.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/
trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid-local.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid-xa.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/web-service/
trunk/build/kits/jboss-as7/docs/teiid/datasources/web-service/readme.txt
trunk/build/kits/jboss-as7/docs/teiid/datasources/web-service/ws.xml
Removed:
trunk/build/assembly/jboss-container/
trunk/build/kits/jboss-as7/docs/teiid/datasources/file.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/h2.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce.xml
trunk/build/kits/jboss-as7/docs/teiid/datasources/ws.xml
trunk/build/kits/jboss-container/
Log:
TEIID-1720: Adding the examples document section on how to create data sources under AS7 for Teiid 8.
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/db2-xa.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/db2-xa.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/db2-xa.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,48 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <xa-datasource jndi-name="java:/db2DS" pool-name="db2DS" enabled="true" use-java-context="true" use-ccm="true">
+
+ <xa-datasource-property name="PortNumber">3306</xa-datasource-property>
+ <xa-datasource-property name="DatabaseName">{db-name}</xa-datasource-property>
+ <xa-datasource-property name="ServerName">{host}</xa-datasource-property>
+
+ <driver>db2</driver>
+
+ <!--
+ <new-connection-sql>select 1/new-connection-sql>
+ <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
+ -->
+
+ <xa-pool>
+ <min-pool-size>10</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <is-same-rm-override>true</is-same-rm-override>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ <no-tx-separate-pools/>
+ </xa-pool>
+
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ <!--
+ <security-domain>mysecurity-realm</security-domain>
+ -->
+ </security>
+
+ <!--
+ <validation>
+ <check-valid-connection-sql>select 1</check-valid-connection-sql>
+ </validation>
+ -->
+ </xa-datasource>
+ <drivers>
+ <driver name="db2" module="com.ibm.db2">
+ <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
+ <xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/db2-xa.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/db2.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/db2.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/db2.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,24 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/db2DS" pool-name="db2DS">
+ <connection-url>jdbc:db2://{host}:{port}/{database_name}</connection-url>
+ <driver>db2</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="db2" module="com.ibm.db2">
+ <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
+ <xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/db2.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/modules/com/ibm/db2/main/module.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/modules/com/ibm/db2/main/module.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/modules/com/ibm/db2/main/module.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="com.ibm.db2">
+ <resources>
+ <resource-root path="db2jcc4.jar"/>
+ </resources>
+ <dependencies>
+ <module name="javax.api"/>
+ </dependencies>
+</module>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/modules/com/ibm/db2/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,31 @@
+There are two parts to creating a datasource, depending upon whether this is the first time you are doing this,
+you can skip the deploying JDBC driver for the database, if you have previously already done this.
+
+Step 1: Deploying the JDBC Driver
+
+ Option 1: use the JBoss CLI tool, and deploy the "db2jcc4.jar" or later jar by issuing the command
+ deploy db2jcc4.jar
+
+ Note: when you use CLI based deployment, the <driver> element in the <datasources> xml fragment, must
+ be the name of the jar file deployed, and no need for adding <drivers> element in standalone-teiid.xml
+ or domain-teiid.xml file
+
+ Option 2:
+ 1) Stop the server if it is running.
+
+ 2) Overlay the "modules" directory on the "<jboss-as>/modules" directory
+
+ 3) Then copy the db2 database JDBC driver jar file "db2jcc4.jar" into
+ "<jboss-as>/modules/com/ibm/db2/main" directory.
+ 4) start server
+
+Step 2: Creating the datasource
+
+ Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "db2.xml"
+ or "db2-xa.xml" file under the "datasources" subsystem. You may have to edit contents according
+ to where your db2 server is located and credentials you need to use to access it.
+
+ Option 2: Take a look at create-ds.cli script, and modify and execute using JBoss CLI tool as below
+
+ ./Jboss-admin.sh --file create-ds.cli
+
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/db2/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/derby-xa.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/derby-xa.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/derby-xa.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,48 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <xa-datasource jndi-name="java:/derbyDS" pool-name="derbyDS" enabled="true" use-java-context="true" use-ccm="true">
+
+ <xa-datasource-property name="PortNumber">1527</xa-datasource-property>
+ <xa-datasource-property name="DatabaseName">{db-name}</xa-datasource-property>
+ <xa-datasource-property name="ServerName">{host}</xa-datasource-property>
+
+ <driver>derby</driver>
+
+ <!--
+ <new-connection-sql>select 1/new-connection-sql>
+ <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
+ -->
+
+ <xa-pool>
+ <min-pool-size>10</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <is-same-rm-override>true</is-same-rm-override>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ <no-tx-separate-pools/>
+ </xa-pool>
+
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ <!--
+ <security-domain>mysecurity-realm</security-domain>
+ -->
+ </security>
+
+ <!--
+ <validation>
+ <check-valid-connection-sql>select 1</check-valid-connection-sql>
+ </validation>
+ -->
+ </xa-datasource>
+ <drivers>
+ <driver name="derby" module="org.apache.derby">
+ <driver-class>org.apache.derby.jdbc.ClientDriver</driver-class>
+ <xa-datasource-class>org.apache.derby.jdbc.ClientXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/derby-xa.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/derby.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/derby.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/derby.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,24 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/derbyDS" pool-name="derbyDS">
+ <connection-url>jdbc:derby://{host}:1527/{db-name}</connection-url>
+ <driver>derby</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="derby" module="org.apache.derby">
+ <driver-class>org.apache.derby.jdbc.ClientDriver</driver-class>
+ <xa-datasource-class>org.apache.derby.jdbc.ClientXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/derby.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/modules/org/apache/derby/main/module.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/modules/org/apache/derby/main/module.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/modules/org/apache/derby/main/module.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="org.apache.derby">
+ <resources>
+ <resource-root path="derbyclient.jar"/>
+ </resources>
+ <dependencies>
+ <module name="javax.api"/>
+ </dependencies>
+</module>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/modules/org/apache/derby/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,31 @@
+There are two parts to creating a datasource, depending upon whether this is the first time you are doing this,
+you can skip the deploying JDBC driver for the database, if you have previously already done this.
+
+Step 1: Deploying the JDBC Driver
+
+ Option 1: use the JBoss CLI tool, and deploy the "derbyclient.jar" or later jar by issuing the command
+ deploy derbyclient.jar
+
+ Note: when you use CLI based deployment, the <driver> element in the <datasources> xml fragment, must
+ be the name of the jar file deployed, and no need for adding <drivers> element in standalone-teiid.xml
+ or domain-teiid.xml file
+
+ Option 2:
+ 1) Stop the server if it is running.
+
+ 2) Overlay the "modules" directory on the "<jboss-as>/modules" directory
+
+ 3) Then copy the derby database JDBC driver jar file "derbyclient.jar" into
+ "<jboss-as>/modules/com/apache/derby/main" directory.
+ 4) start server
+
+Step 2: Creating the datasource
+
+ Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "derby.xml"
+ or "derby-xa.xml" file under the "datasources" subsystem. You may have to edit contents according
+ to where your derby server is located and credentials you need to use to access it.
+
+ Option 2: Take a look at create-ds.cli script, and modify and execute using JBoss CLI tool as below
+
+ ./Jboss-admin.sh --file create-ds.cli
+
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/derby/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/file/file.xml (from rev 3720, trunk/build/kits/jboss-as7/docs/teiid/datasources/file.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/file/file.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/file/file.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,31 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
+ <resource-adapters>
+ <resource-adapter>
+ <archive>teiid-connector-file.rar</archive>
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="org.teiid.resource.adapter.file.FileManagedConnectionFactory"
+ jndi-name="java:/fileDS"
+ enabled="true"
+ use-java-context="true"
+ pool-name="teiid-file-ds">
+
+ <!-- Directory where the data files are stored -->
+ <config-property name="ParentDirectory">/home/rareddy/testing/</config-property>
+
+ <!-- Optional properties -->
+
+ <!-- Set FileMapping to redirect specific relative paths (case sensitive) to alternative locations.
+ The string value specifies a map in the format key=value(,key=value)*
+ -->
+ <!-- <config-property name="FileMapping">file1.txt=fileX.txt,file2.txt=fileY.txt</config-property> -->
+
+ <!-- Set AllowParentPaths to false to disallow .. in paths.
+ This prevent requesting files that are not contained in the parent directory -->
+ <config-property name="AllowParentPaths">true</config-property>
+ </connection-definition>
+ </connection-definitions>
+ </resource-adapter>
+ </resource-adapters>
+</subsystem>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/file/file.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/file/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/file/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/file/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,3 @@
+In Teiid, for File datasource a JCA connector is provided and deployed at the install time. To create
+file datasource connection edit the "standalone-teiid.xml" file or "doamin-teiid.xml" file and add
+the contents of the file.xml under "resource-adapters" subsystem section.
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/file/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/build/kits/jboss-as7/docs/teiid/datasources/file.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/file.xml 2011-12-08 16:14:29 UTC (rev 3725)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/file.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -1,31 +0,0 @@
-<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
-<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
- <resource-adapters>
- <resource-adapter>
- <archive>teiid-connector-file.rar</archive>
- <transaction-support>NoTransaction</transaction-support>
- <connection-definitions>
- <connection-definition class-name="org.teiid.resource.adapter.file.FileManagedConnectionFactory"
- jndi-name="java:/fileDS"
- enabled="true"
- use-java-context="true"
- pool-name="teiid-file-ds">
-
- <!-- Directory where the data files are stored -->
- <config-property name="ParentDirectory">/home/rareddy/testing/</config-property>
-
- <!-- Optional properties -->
-
- <!-- Set FileMapping to redirect specific relative paths (case sensitive) to alternative locations.
- The string value specifies a map in the format key=value(,key=value)*
- -->
- <!-- <config-property name="FileMapping">file1.txt=fileX.txt,file2.txt=fileY.txt</config-property> -->
-
- <!-- Set AllowParentPaths to false to disallow .. in paths.
- This prevent requesting files that are not contained in the parent directory -->
- <config-property name="AllowParentPaths">true</config-property>
- </connection-definition>
- </connection-definitions>
- </resource-adapter>
- </resource-adapters>
-</subsystem>
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/h2/h2.xml (from rev 3720, trunk/build/kits/jboss-as7/docs/teiid/datasources/h2.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/h2/h2.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/h2/h2.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,21 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:jboss/datasources/ExampleDS" enabled="true" use-java-context="true" pool-name="H2DS">
+ <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
+ <driver>h2</driver>
+ <pool></pool>
+ <security>
+ <user-name>sa</user-name>
+ <password>sa</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="h2" module="com.h2database.h2">
+ <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
+
+
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/h2/h2.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/h2/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/h2/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/h2/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,4 @@
+H2 driver is already pre-intalled in the JBoss AS, so deploy a data soruce
+
+1) edit standalone-teiid.xml or domain-teiid.xml file, under "datasources" subsystem copy the contents of h2.xml file
+and modify it according to your h2 server details.
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/h2/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/build/kits/jboss-as7/docs/teiid/datasources/h2.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/h2.xml 2011-12-08 16:14:29 UTC (rev 3725)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/h2.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -1,21 +0,0 @@
-<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
-<subsystem xmlns="urn:jboss:domain:datasources:1.0">
- <datasources>
- <datasource jndi-name="java:jboss/datasources/ExampleDS" enabled="true" use-java-context="true" pool-name="H2DS">
- <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
- <driver>h2</driver>
- <pool></pool>
- <security>
- <user-name>sa</user-name>
- <password>sa</password>
- </security>
- </datasource>
- <drivers>
- <driver name="h2" module="com.h2database.h2">
- <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
- </driver>
- </drivers>
- </datasources>
-</subsystem>
-
-
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/hive.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/hive.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/hive.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,19 @@
+<!-- If susbsytem "datasources" is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/hive" pool-name="hive-ds">
+ <connection-url>jdbc:hive://localhost:10000/default</connection-url>
+ <driver>hive</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ </datasource>
+ <drivers>
+ <driver name="hive" module="org.apache.hadoop.hive">
+ <driver-class>org.apache.hadoop.hive.jdbc.HiveDriver</driver-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/hive.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/modules/org/apache/hadoop/hive/main/module.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/modules/org/apache/hadoop/hive/main/module.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/modules/org/apache/hadoop/hive/main/module.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="org.apache.hadoop.hive">
+ <resources>
+ <resource-root path="hadoop-core-0.20.203.0.jar"/>
+ <resource-root path="hive-exec-0.7.1.jar"/>
+ <resource-root path="hive-jdbc-0.7.1.jar"/>
+ <resource-root path="hive-metastore-0.7.1.jar"/>
+ <resource-root path="hive-service-0.7.1.jar"/>
+ <resource-root path="libfb303.jar"/>
+ </resources>
+
+ <dependencies>
+ <module name="javax.api"/>
+ <module name="javax.resource.api"/>
+ </dependencies>
+</
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/modules/org/apache/hadoop/hive/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,13 @@
+To configure the hive as datasource,
+
+1) Stop the server if it is running.
+
+2) Overlay the "modules" directory on the "<jboss-as>/modules" directory
+
+3) Then copy need hive jar files defined in the "<jboss-as>/modules/org/apache/hadoop/hive/main/modules.xml" file into
+"<jboss-as>/modules/org/apache/hadoop/hive/main" directory.
+
+4) Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "hive.xml" file under the "datasources" subsystem.
+you may have edit these contents according to where your hadoop/hive server is located.
+
+5) restart
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/hive/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/ingres-xa.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/ingres-xa.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/ingres-xa.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,50 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <xa-datasource jndi-name="java:/ingresDS" pool-name="ingresDS" enabled="true" use-java-context="true" use-ccm="true">
+
+ <xa-datasource-property name="DatabaseName">{database}</xa-datasource-property>
+ <xa-datasource-property name="PortNumber">21071</xa-datasource-property>
+ <xa-datasource-property name="ServerName">{host}</xa-datasource-property>
+ <xa-datasource-property name="timeZone">GMT</xa-datasource-property>
+
+
+ <driver>ingres</driver>
+
+ <!--
+ <new-connection-sql>select 1/new-connection-sql>
+ <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
+ -->
+
+ <xa-pool>
+ <min-pool-size>10</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <is-same-rm-override>true</is-same-rm-override>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ <no-tx-separate-pools/>
+ </xa-pool>
+
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ <!--
+ <security-domain>mysecurity-realm</security-domain>
+ -->
+ </security>
+
+ <!--
+ <validation>
+ <check-valid-connection-sql>select 1</check-valid-connection-sql>
+ </validation>
+ -->
+ </xa-datasource>
+ <drivers>
+ <driver name="ingres" module="com.ingres">
+ <driver-class>com.ingres.jdbc.IngresDriver</driver-class>
+ <xa-datasource-class>com.ingres.jdbc.IngresXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/ingres-xa.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/ingres.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/ingres.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/ingres.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,24 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/ingresDS" pool-name="ingresDS">
+ <connection-url>jdbc:ingres://{host}:{port:21071}/{database_name}</connection-url>
+ <driver>ingres</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="ingres" module="com.ingres">
+ <driver-class>com.ingres.jdbc.IngresDriver</driver-class>
+ <xa-datasource-class>com.ingres.jdbc.IngresXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/ingres.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/modules/com/ingres/main/module.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/modules/com/ingres/main/module.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/modules/com/ingres/main/module.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="com.ingres">
+ <resources>
+ <resource-root path="iijdbc.jar"/>
+ </resources>
+ <dependencies>
+ <module name="javax.api"/>
+ </dependencies>
+</module>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/modules/com/ingres/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,31 @@
+There are two parts to creating a datasource, depending upon whether this is the first time you are doing this,
+you can skip the deploying JDBC driver for the database, if you have previously already done this.
+
+Step 1: Deploying the JDBC Driver
+
+ Option 1: use the JBoss CLI tool, and deploy the "iijdbc.jar " or later jar by issuing the command
+ deploy iijdbc.jar
+
+ Note: when you use CLI based deployment, the <driver> element in the <datasources> xml fragment, must
+ be the name of the jar file deployed, and no need for adding <drivers> element in standalone-teiid.xml
+ or domain-teiid.xml file
+
+ Option 2:
+ 1) Stop the server if it is running.
+
+ 2) Overlay the "modules" directory on the "<jboss-as>/modules" directory
+
+ 3) Then copy the ingres database JDBC driver jar file "iijdbc.jar " into
+ "<jboss-as>/modules/com/ingres/main" directory.
+ 4) start server
+
+Step 2: Creating the datasource
+
+ Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "ingres.xml"
+ or "ingres-xa.xml" file under the "datasources" subsystem. You may have to edit contents according
+ to where your ingres server is located and credentials you need to use to access it.
+
+ Option 2: Take a look at create-ds.cli script, and modify and execute using JBoss CLI tool as below
+
+ ./Jboss-admin.sh --file create-ds.cli
+
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/ingres/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/intersystems-cache.xml (from rev 3720, trunk/build/kits/jboss-container/teiid-examples/jca/intersystems-cache-ds.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/intersystems-cache.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/intersystems-cache.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,23 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/cacheDS" pool-name="cacheDS">
+ <connection-url>jdbc:Cache://{host}:1972/{database}</connection-url>
+ <driver>mysql</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="intersys" module="com.intersys">
+ <driver-class>com.intersys.jdbc.CacheDriver</driver-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/intersystems-cache.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/modules/com/intersys/main/module.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/modules/com/intersys/main/module.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/modules/com/intersys/main/module.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="com.intersys">
+ <resources>
+ <resource-root path="CacheDB.jar"/>
+ </resources>
+ <dependencies>
+ <module name="javax.api"/>
+ </dependencies>
+</module>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/modules/com/intersys/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,30 @@
+There are two parts to creating a datasource, depending upon whether this is the first time you are doing this,
+you can skip the deploying JDBC driver for the database, if you have previously already done this.
+
+Step 1: Deploying the JDBC Driver
+
+ Option 1: use the JBoss CLI tool, and deploy the "CacheDB.jar" or later jar by issuing the command
+ deploy CacheDB.jar
+
+ Note: when you use CLI based deployment, the <driver> element in the <datasources> xml fragment, must
+ be the name of the jar file deployed, and no need for adding <drivers> element in standalone-teiid.xml
+ or domain-teiid.xml file
+
+ Option 2:
+ 1) Stop the server if it is running.
+
+ 2) Overlay the "modules" directory on the "<jboss-as>/modules" directory
+
+ 3) Then copy the mysql database JDBC driver jar file "CacheDB.jar" into
+ "<jboss-as>/modules/com/intersys/main" directory.
+ 4) start server
+
+Step 2: Creating the datasource
+
+ Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "intersystems-cache.xml"
+ file under the "datasources" subsystem. You may have to edit contents according
+ to where your intersystems server is located and credentials you need to use to access it.
+
+ Option 2: Take a look at create-ds.cli script, and modify and execute using JBoss CLI tool as below
+
+ ./Jboss-admin.sh --file create-ds.cli
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/intersystems-cache/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/ldap/ldap.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/ldap/ldap.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/ldap/ldap.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,30 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
+ <resource-adapters>
+ <resource-adapter>
+ <archive>teiid-connector-ldap.rar</archive>
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="org.teiid.resource.adapter.ldap.LDAPManagedConnectionFactory"
+ jndi-name="java:/ldapDS"
+ enabled="true"
+ use-java-context="true"
+ pool-name="ldap-ds">
+
+ <!-- LDAP Directroy URL (required)-->
+ <config-property name="LdapUrl">ldap://ldapServer:389</config-property>
+
+ <!-- Ldap Admin User DN (required)-->
+ <config-property name="LdapAdminUserDN">cn=???,ou=???,dc=???</config-property>
+
+ <!-- Ldap Admin Password (required)-->
+ <config-property name="LdapAdminUserPassword">pass</config-property>
+
+ <!-- Ldap Transaction Timeout (ms) -1 = no time out (optional) -->
+ <config-property name="LdapTxnTimeoutInMillis">-1</config-property>
+
+ </connection-definition>
+ </connection-definitions>
+ </resource-adapter>
+ </resource-adapters>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/ldap/ldap.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/ldap/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/ldap/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/ldap/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,3 @@
+In Teiid, for LDAP datasource a JCA connector is provided and deployed at the install time. To create
+ldap datasource connection edit the "standalone-teiid.xml" file or "doamin-teiid.xml" file and add
+the contents of the ldap.xml under "resource-adapters" subsystem section.
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/ldap/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/modules/com/mysql/main/module.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/modules/com/mysql/main/module.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/modules/com/mysql/main/module.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="com.mysql">
+ <resources>
+ <resource-root path="mysql-connector-java-5.1.5.jar"/>
+ </resources>
+ <dependencies>
+ <module name="javax.api"/>
+ </dependencies>
+</module>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/modules/com/mysql/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/mysql-xa.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/mysql-xa.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/mysql-xa.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,48 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <xa-datasource jndi-name="java:/mysqlDS" pool-name="mySQlDS" enabled="true" use-java-context="true" use-ccm="true">
+
+ <xa-datasource-property name="PortNumber">3306</xa-datasource-property>
+ <xa-datasource-property name="DatabaseName">{db-name}</xa-datasource-property>
+ <xa-datasource-property name="ServerName">{host}</xa-datasource-property>
+
+ <driver>mysql</driver>
+
+ <!--
+ <new-connection-sql>select 1/new-connection-sql>
+ <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
+ -->
+
+ <xa-pool>
+ <min-pool-size>10</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <is-same-rm-override>true</is-same-rm-override>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ <no-tx-separate-pools/>
+ </xa-pool>
+
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ <!--
+ <security-domain>mysecurity-realm</security-domain>
+ -->
+ </security>
+
+ <!--
+ <validation>
+ <check-valid-connection-sql>select 1</check-valid-connection-sql>
+ </validation>
+ -->
+ </xa-datasource>
+ <drivers>
+ <driver name="mysql" module="com.mysql">
+ <driver-class>com.mysql.jdbc.Driver</driver-class>
+ <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/mysql-xa.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/mysql.xml (from rev 3720, trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/mysql.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/mysql.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,24 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/mysql-ds" pool-name="mysqlDS">
+ <connection-url>jdbc:mysql://{host}:3306/{database}</connection-url>
+ <driver>mysql</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="mysql" module="com.mysql">
+ <driver-class>com.mysql.jdbc.Driver</driver-class>
+ <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/mysql.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,36 @@
+There are two parts to creating a datasource, depending upon whether this is the first time you are doing this,
+you can skip the deploying JDBC driver for the database, if you have previously already done this.
+
+Step 1: Deploying the JDBC Driver
+
+ Option 1: use the JBoss CLI tool, and deploy the "mysql-connector-java-5.1.5.jar" or later jar by issuing the command
+ deploy mysql-connector-java-5.1.5.jar
+
+ Note: when you use CLI based deployment, the <driver> element in the <datasources> xml fragment, must
+ be the name of the jar file deployed, and no need for adding <drivers> element in standalone-teiid.xml
+ or domain-teiid.xml file
+
+ Option 2:
+ 1) Stop the server if it is running.
+
+ 2) Overlay the "modules" directory on the "<jboss-as>/modules" directory
+
+ 3) Then copy the mysql database JDBC driver jar file "mysql-connector-java-5.1.5.jar" into
+ "<jboss-as>/modules/com/mysql/main" directory.
+ 4) start server
+
+Step 2: Creating the datasource
+
+ Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "mysql.xml"
+ or "mysql-xa.xml" file under the "datasources" subsystem. You may have to edit contents according
+ to where your mysql server is located and credentials you need to use to access it.
+
+ Option 2: Take a look at create-ds.cli script, and modify and execute using JBoss CLI tool as below
+
+ ./Jboss-admin.sh --file create-ds.cli
+
+**************************************************************************************************************
+NOTE: MySQL JDBC driver does not include the Driver file name as the service loader mechanism as of
+version 5.1.5, so as is Step 1, Option 1 will not work. However you if you can manually fix jar to include
+service definitions as described here http://community.jboss.org/docs/DOC-16657 then you can use it.
+***************************************************************************************************************
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql.xml 2011-12-08 16:14:29 UTC (rev 3725)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/mysql.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -1,23 +0,0 @@
-<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
-<subsystem xmlns="urn:jboss:domain:datasources:1.0">
- <datasources>
- <datasource jndi-name="java:/mysql-ds" pool-name="mysqlDS">
- <connection-url>jdbc:mysql://{host}:3306/{database}</connection-url>
- <driver>mysql</driver>
- <pool>
- <prefill>false</prefill>
- <use-strict-min>false</use-strict-min>
- <flush-strategy>FailingConnectionOnly</flush-strategy>
- </pool>
- <security>
- <user-name>user</user-name>
- <password>password</password>
- </security>
- </datasource>
- <drivers>
- <driver name="mysql" module="com.mysql">
- <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
- </driver>
- </drivers>
- </datasources>
-</subsystem>
\ No newline at end of file
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/odbc/odbc.xml (from rev 3720, trunk/build/kits/jboss-container/teiid-examples/jca/odbc-ds.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/odbc/odbc.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/odbc/odbc.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,25 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/odbcDS" pool-name="odbcDS">
+ <!-- Create a DSN using ODBC driver manager, and replace {DSN} below with your DSN name -->
+ <connection-url>jdbc:odbc:{DSN}</connection-url>
+
+ <!-- For DSN less connection URL use the below form to connect to a Excel Sheet
+ <connection-url>jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};Dbq=c:\ODBC\ExcelData.xls</connection-url>
+ -->
+ <driver-class>sun.jdbc.odbc.JdbcOdbcDriver</driver-class>
+ <transaction-isolation>TRANSACTION_NONE</transaction-isolation>
+
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/odbc/odbc.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/odbc/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/odbc/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/odbc/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,10 @@
+For ODBC datasource, we use JDBC <--> ODBC bridge driver provided by Oracle that comes with Sun JDK. So, the driver
+is already installed and available.
+
+1) First create DSN to the data source you are trying to connect.
+2) if you want to create DSN-less connection then use the following connection URL format in the odbc.xml file
+<connection-url>jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};Dbq=c:\ODBC\ExcelData.xls</connection-url>
+
+3) Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "odbc.xml"
+file under the "datasources" subsystem. You may have to edit contents according
+to where your odbc server is located and credentials you need to use to access it.
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/odbc/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/modules/org/olap4j/main/module.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/modules/org/olap4j/main/module.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/modules/org/olap4j/main/module.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="org.olap4j">
+ <resources>
+ <resource-root path="olap4j.jar"/>
+ <!-- below jar files needed only for the direct connection to mondrian. For XMLA, only olap4j.jar is required -->
+ <resource-root path="commons-math-1.0.jar"/>
+ <resource-root path="commons-vfs-1.0.jar"/>
+ <resource-root path="eigenbase-properties.jar"/>
+ <resource-root path="eigenbase-resgen.jar"/>
+ <resource-root path="eigenbase-xom.jar"/>
+ <resource-root path="javacup.jar"/>
+ <resource-root path="mondrian.jar"/>
+ </resources>
+
+ <dependencies>
+ <module name="javax.api"/>
+ </dependencies>
+</module>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/modules/org/olap4j/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/mondrian.xml (from rev 3720, trunk/build/kits/jboss-container/teiid-examples/jca/mondrian-ds.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/mondrian.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/mondrian.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,43 @@
+ <!--
+ Provide these jars in JBoss AS profile's "lib" directory, to place the mondrian JDBC driver
+ on classpath.
+
+ commons-math-1.0.jar
+ commons-vfs-1.0.jar
+ eigenbase-properties.jar
+ eigenbase-resgen.jar
+ eigenbase-xom.jar
+ javacup.jar
+ mondrian.jar
+ olap4j.jar
+
+ Only use this datasource, if your mondrian server is also deployed to same JBoss AS
+ server, this will make embedded connection to mondrian. If you are working remote
+ then use olap-xmla-ds.xml file
+ -->
+
+
+
+
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/mondrianDS" pool-name="mondrianDS">
+ <connection-url>jdbc:mondrian:Provider=Mondrian;DataSource=java:foodmart;Catalog=FoodMart;Catalog=${jboss.server.home.dir}/deploy/mondrian.war/WEB-INF/queries/FoodMart.xml;</connection-url>
+ <driver>olap</driver>
+ <driver-class>mondrian.olap4j.MondrianOlap4jDriver</driver-class>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="olap" module="org.olap4j"/>
+ </drivers>
+ </datasources>
+</subsystem
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/mondrian.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/olap-xmla.xml (from rev 3720, trunk/build/kits/jboss-container/teiid-examples/jca/olap-xmla-ds.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/olap-xmla.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/olap-xmla.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,23 @@
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/olapDS" pool-name="olapDS">
+ <!-- note here that you need to also create datasource for source, this is for mondrian as source for teiid -->
+ <connection-url>jdbc:xmla:Server=http://127.0.0.1:8080/mondrian/xmla;Provider=Mondrian;DataSource=java:foodmart;Catalog=FoodMart;</connection-url>
+ <driver>olap</driver>
+ <driver-class>org.olap4j.driver.xmla.XmlaOlap4jDriver</driver-class>
+ <transaction-isolation>-1</transaction-isolation>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="olap" module="org.olap4j"/>
+ </drivers>
+ </datasources>
+</subsystem
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/olap-xmla.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,30 @@
+There are two parts to creating a datasource, depending upon whether this is the first time you are doing this,
+you can skip the deploying JDBC driver for the database, if you have previously already done this.
+
+Step 1: Deploying the JDBC Driver
+
+ 1) Stop the server if it is running.
+
+ 2) Overlay the "modules" directory on the "<jboss-as>/modules" directory
+
+ 3) Then copy the olap4j database JDBC driver jar file "olap4j.jar" into
+ "<jboss-as>/modules/org/olap4j/main" directory.
+
+ 4) if you are working with mondrian directly then copy these jars too into "<jboss-as>/modules/org/olap4j/main" directory.
+
+ commons-math-1.0.jar
+ commons-vfs-1.0.jar
+ eigenbase-properties.jar
+ eigenbase-resgen.jar
+ eigenbase-xom.jar
+ javacup.jar
+ mondrian.jar
+
+ 5) start server
+
+Step 2: Creating the datasource
+
+ Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "mondrian.xml"
+ or "olap-xmla.xml" file under the "datasources" subsystem. You may have to edit contents according
+ to where your olap server is located and credentials you need to use to access it.
+
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/olap/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/modules/com/oracle/main/module.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/modules/com/oracle/main/module.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/modules/com/oracle/main/module.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="com.oracle">
+ <resources>
+ <resource-root path="ojdbc6.jar"/>
+ </resources>
+
+ <dependencies>
+ <module name="javax.api"/>
+ <module name="javax.resource.api"/>
+ </dependencies>
+</
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/modules/com/oracle/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/oracle-xa.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/oracle-xa.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/oracle-xa.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,47 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <xa-datasource jndi-name="java:/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true" use-ccm="true">
+
+ <xa-datasource-property name="PortNumber">1557</xa-datasource-property>
+ <xa-datasource-property name="DatabaseName">{db-name}</xa-datasource-property>
+ <xa-datasource-property name="ServerName">{host}</xa-datasource-property>
+
+ <driver>oracle</driver>
+
+ <!--
+ <new-connection-sql>select * from dual</new-connection-sql>
+ <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
+ -->
+
+ <xa-pool>
+ <min-pool-size>10</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <is-same-rm-override>true</is-same-rm-override>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ <no-tx-separate-pools/>
+ </xa-pool>
+
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ <!--
+ <security-domain>mysecurity-realm</security-domain>
+ -->
+ </security>
+
+ <!--
+ <validation>
+ <check-valid-connection-sql>select * from dual</check-valid-connection-sql>
+ </validation>
+ -->
+ </xa-datasource>
+ <drivers>
+ <driver name="oracle" module="com.oracle">
+ <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/oracle-xa.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/oracle.xml (from rev 3720, trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/oracle.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/oracle.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,23 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/OracleDS" pool-name="OracleDS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
+ <connection-url>jdbc:oracle:thin:{host}:1521:orcl</connection-url>
+ <driver>oracle</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="oracle" module="com.oracle">
+ <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/oracle.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,31 @@
+There are two parts to creating a datasource, depending upon whether this is the first time you are doing this,
+you can skip the deploying JDBC driver for the database, if you have previously already done this.
+
+Step 1: Deploying the JDBC Driver
+
+ Option 1: use the JBoss CLI tool, and deploy the "ojdbc6.jar" or later jar by issuing the command
+ deploy ojdbc6.jar
+
+ Note: when you use CLI based deployment, the <driver> element in the <datasources> xml fragment, must
+ be the name of the jar file deployed, and no need for adding <drivers> element in standalone-teiid.xml
+ or domain-teiid.xml file
+
+ Option 2:
+
+ 1) Stop the server if it is running.
+
+ 2) Overlay the "modules" directory on the "<jboss-as>/modules" directory
+
+ 3) Then copy the oracle database JDBC driver jar file "ojdbc6.jar" into
+ "<jboss-as>/modules/com/oracle/main" directory.
+ 4) start server
+
+Step 2: Creating the datasource
+
+ Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "oracle.xml"
+ or "oracle-xa.xml" file under the "datasources" subsystem. You may have to edit contents according
+ to where your oracle server is located and credentials you need to use to access it.
+
+ Option 2: Take a look at create-ds.cli script, and modify and execute using JBoss CLI tool as below
+
+ ./Jboss-admin.sh --file create-ds.cli
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle.xml 2011-12-08 16:14:29 UTC (rev 3725)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/oracle.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -1,23 +0,0 @@
-<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
-<subsystem xmlns="urn:jboss:domain:datasources:1.0">
- <datasources>
- <datasource jndi-name="java:/OracleDS" pool-name="OracleDS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
- <connection-url>jdbc:oracle:thin:{host}:1521:orcl</connection-url>
- <driver>oracle</driver>
- <pool>
- <prefill>false</prefill>
- <use-strict-min>false</use-strict-min>
- <flush-strategy>FailingConnectionOnly</flush-strategy>
- </pool>
- <security>
- <user-name>{user}</user-name>
- <password>{password}</password>
- </security>
- </datasource>
- <drivers>
- <driver name="oracle" module="com.oracle">
- <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
- </driver>
- </drivers>
- </datasources>
-</subsystem>
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/modules/org/postgresql/main/module.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/modules/org/postgresql/main/module.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/modules/org/postgresql/main/module.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="org.postgresql">
+ <resources>
+ <resource-root path="postgresql-8.3-603.jdbc3.jar"/>
+ </resources>
+ <dependencies>
+ <module name="javax.api"/>
+ </dependencies>
+</module>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/modules/org/postgresql/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/postgresql-xa.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/postgresql-xa.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/postgresql-xa.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,47 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <xa-datasource jndi-name="java:/postgresDS" pool-name="postgresDS" enabled="true" use-java-context="true" use-ccm="true">
+
+ <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
+ <xa-datasource-property name="DatabaseName">{db-name}</xa-datasource-property>
+ <xa-datasource-property name="ServerName">{host}</xa-datasource-property>
+
+ <driver>postgresql</driver>
+
+ <!--
+ <new-connection-sql>select 1</new-connection-sql>
+ <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
+ -->
+
+ <xa-pool>
+ <min-pool-size>10</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <is-same-rm-override>true</is-same-rm-override>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ <no-tx-separate-pools/>
+ </xa-pool>
+
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ <!--
+ <security-domain>mysecurity-realm</security-domain>
+ -->
+ </security>
+
+ <!--
+ <validation>
+ <check-valid-connection-sql>select 1</check-valid-connection-sql>
+ </validation>
+ -->
+ </xa-datasource>
+ <drivers>
+ <driver name="postgresql" module="org.postgresql">
+ <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/postgresql-xa.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/postgresql.xml (from rev 3720, trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/postgresql.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/postgresql.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,23 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/postgres-ds" pool-name="PostgreDS">
+ <connection-url>jdbc:postgresql://{host}:5432/{database}</connection-url>
+ <driver>postgresql</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>user</user-name>
+ <password>pass</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="postgresql" module="org.postgresql">
+ <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/postgresql.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,31 @@
+There are two parts to creating a datasource, depending upon whether this is the first time you are doing this,
+you can skip the deploying JDBC driver for the database, if you have previously already done this.
+
+Step 1: Deploying the JDBC Driver
+
+ Option 1: use the JBoss CLI tool, and deploy the "postgresql-8.3-603.jdbc3.jar" or later jar by issuing the command
+ deploy postgresql-8.3-603.jdbc3.jar
+
+ Note: when you use CLI based deployment, the <driver> element in the <datasources> xml fragment, must
+ be the name of the jar file deployed, and no need for adding <drivers> element in standalone-teiid.xml
+ or domain-teiid.xml file
+
+ Option 2:
+
+ 1) Stop the server if it is running.
+
+ 2) Overlay the "modules" directory on the "<jboss-as>/modules" directory
+
+ 3) Then copy the postgres database JDBC driver jar file "postgresql-8.3-603.jdbc3.jar" into
+ "<jboss-as>/modules/org/postgres/main" directory.
+ 4) start server
+
+Step 2: Creating the datasource
+
+ Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "postgresql.xml"
+ or "postgresql-xa.xml" file under the "datasources" subsystem. You may have to edit contents according
+ to where your postgresql server is located and credentials you need to use to access it.
+
+ Option 2: Take a look at create-ds.cli script, and modify and execute using JBoss CLI tool.
+
+
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql.xml 2011-12-08 16:14:29 UTC (rev 3725)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/postgresql.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -1,23 +0,0 @@
-<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
-<subsystem xmlns="urn:jboss:domain:datasources:1.0">
- <datasources>
- <datasource jndi-name="java:/postgres-ds" pool-name="PostgreDS">
- <connection-url>jdbc:postgresql://{host}:5432/{database}</connection-url>
- <driver>postgresql</driver>
- <pool>
- <prefill>false</prefill>
- <use-strict-min>false</use-strict-min>
- <flush-strategy>FailingConnectionOnly</flush-strategy>
- </pool>
- <security>
- <user-name>user</user-name>
- <password>pass</password>
- </security>
- </datasource>
- <drivers>
- <driver name="postgresql" module="org.postgresql">
- <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
- </driver>
- </drivers>
- </datasources>
-</subsystem>
\ No newline at end of file
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,3 @@
+In Teiid, for Salesforce datasource a JCA connector is provided and deployed at the install time. To create
+salesforce datasource connection edit the "standalone-teiid.xml" file or "doamin-teiid.xml" file and add
+the contents of the salesforce.xml under "resource-adapters" subsystem section.
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce/salesforce.xml (from rev 3720, trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce/salesforce.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce/salesforce.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,30 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
+ <resource-adapters>
+ <resource-adapter>
+ <archive>teiid-connector-salesforce.rar</archive>
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="org.teiid.resource.adapter.salesforce.SalesForceManagedConnectionFactory"
+ jndi-name="java:/sfDS"
+ enabled="true"
+ use-java-context="true"
+ pool-name="teiid-sf-ds">
+
+ <!-- URL; the below is test; replace with actual URL you need to connect to -->
+ <config-property name="URL">https://test.salesforce.com/services/Soap/u/10.0</config-property>
+
+ <config-property name="username">user</config-property>
+ <config-property name="password">pass</config-property>
+
+ <!--
+ Uncomment this property to supply specific configuration for SalesForce service. This configuration
+ must contain config for "SforceService" service with namespace "urn:partner.soap.sforce.com"
+ <config-property name="configFile">path/to/jbossws-cxf.xml</config-property>
+ -->
+ </connection-definition>
+ </connection-definitions>
+ </resource-adapter>
+ </resource-adapters>
+</subsystem>
+
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce/salesforce.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce.xml 2011-12-08 16:14:29 UTC (rev 3725)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/salesforce.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -1,30 +0,0 @@
-<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
-<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
- <resource-adapters>
- <resource-adapter>
- <archive>teiid-connector-salesforce.rar</archive>
- <transaction-support>NoTransaction</transaction-support>
- <connection-definitions>
- <connection-definition class-name="org.teiid.resource.adapter.salesforce.SalesForceManagedConnectionFactory"
- jndi-name="java:/sfDS"
- enabled="true"
- use-java-context="true"
- pool-name="teiid-sf-ds">
-
- <!-- URL; the below is test; replace with actual URL you need to connect to -->
- <config-property name="URL">https://test.salesforce.com/services/Soap/u/10.0</config-property>
-
- <config-property name="username">user</config-property>
- <config-property name="password">pass</config-property>
-
- <!--
- Uncomment this property to supply specific configuration for SalesForce service. This configuration
- must contain config for "SforceService" service with namespace "urn:partner.soap.sforce.com"
- <config-property name="configFile">path/to/jbossws-cxf.xml</config-property>
- -->
- </connection-definition>
- </connection-definitions>
- </resource-adapter>
- </resource-adapters>
-</subsystem>
-
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/modules/net/sourceforge/jtds/main/module.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/modules/net/sourceforge/jtds/main/module.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/modules/net/sourceforge/jtds/main/module.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="net.sourceforge.jtds">
+ <resources>
+ <resource-root path="jtds-1.2.5.jar"/>
+ </resources>
+ <dependencies>
+ <module name="javax.api"/>
+ </dependencies>
+</module>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/modules/net/sourceforge/jtds/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,30 @@
+There are two parts to creating a datasource, depending upon whether this is the first time you are doing this,
+you can skip the deploying JDBC driver for the database, if you have previously already done this.
+
+Step 1: Deploying the JDBC Driver
+
+ Option 1: use the JBoss CLI tool, and deploy the "jtds-1.2.5.jar" or later jar by issuing the command
+ deploy jtds-1.2.5.jar
+
+ Note: when you use CLI based deployment, the <driver> element in the <datasources> xml fragment, must
+ be the name of the jar file deployed, and no need for adding <drivers> element in standalone-teiid.xml
+ or domain-teiid.xml file
+
+ Option 2:
+ 1) Stop the server if it is running.
+
+ 2) Overlay the "modules" directory on the "<jboss-as>/modules" directory
+
+ 3) Then copy the jtds JDBC driver jar file "jtds-1.2.5.jar" into
+ "<jboss-as>/modules/net/sourceforge/jtds/main" directory.
+ 4) start server
+
+Step 2: Creating the datasource
+
+ Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "sqlserver.xml"
+ or "sqlserver-xa.xml" file under the "datasources" subsystem. You may have to edit contents according
+ to where your sqlserver server is located and credentials you need to use to access it.
+
+ Option 2: Take a look at create-ds.cli script, and modify and execute using JBoss CLI tool as below
+
+ ./Jboss-admin.sh --file create-ds.cli
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/sqlserver-xa.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/sqlserver-xa.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/sqlserver-xa.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,48 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <xa-datasource jndi-name="java:/sqlserverDS" pool-name="sqlserverDS" enabled="true" use-java-context="true" use-ccm="true">
+
+ <xa-datasource-property name="PortNumber">1433</xa-datasource-property>
+ <xa-datasource-property name="DatabaseName">{db-name}</xa-datasource-property>
+ <xa-datasource-property name="ServerName">{host}</xa-datasource-property>
+
+ <driver>jtds</driver>
+
+ <!--
+ <new-connection-sql>select 1/new-connection-sql>
+ <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
+ -->
+
+ <xa-pool>
+ <min-pool-size>10</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <is-same-rm-override>true</is-same-rm-override>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ <no-tx-separate-pools/>
+ </xa-pool>
+
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ <!--
+ <security-domain>mysecurity-realm</security-domain>
+ -->
+ </security>
+
+ <!--
+ <validation>
+ <check-valid-connection-sql>select 1</check-valid-connection-sql>
+ </validation>
+ -->
+ </xa-datasource>
+ <drivers>
+ <driver name="jtds" module="net.sourceforge.jtds">
+ <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
+ <xa-datasource-class>net.sourceforge.jtds.jdbcx.JtdsDataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/sqlserver-xa.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/sqlserver.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/sqlserver.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/sqlserver.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,24 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/sqlserverDS" pool-name="sqlserverDS">
+ <connection-url>jdbc:jtds:sqlserver://{host}:1433/{database}</connection-url>
+ <driver>jtds</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="jtds" module="net.sourceforge.jtds">
+ <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
+ <xa-datasource-class>net.sourceforge.jtds.jdbcx.JtdsDataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/jtds/sqlserver.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/modules/com/microsoft/sqlserver/main/module.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/modules/com/microsoft/sqlserver/main/module.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/modules/com/microsoft/sqlserver/main/module.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="com.microsoft.sqlserver">
+ <resources>
+ <resource-root path="sqljdbc4.jar"/>
+ </resources>
+ <dependencies>
+ <module name="javax.api"/>
+ </dependencies>
+</module>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/modules/com/microsoft/sqlserver/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,30 @@
+There are two parts to creating a datasource, depending upon whether this is the first time you are doing this,
+you can skip the deploying JDBC driver for the database, if you have previously already done this.
+
+Step 1: Deploying the JDBC Driver
+
+ Option 1: use the JBoss CLI tool, and deploy the "sqljdbc4.jar" or later jar by issuing the command
+ deploy sqljdbc4.jar
+
+ Note: when you use CLI based deployment, the <driver> element in the <datasources> xml fragment, must
+ be the name of the jar file deployed, and no need for adding <drivers> element in standalone-teiid.xml
+ or domain-teiid.xml file
+
+ Option 2:
+ 1) Stop the server if it is running.
+
+ 2) Overlay the "modules" directory on the "<jboss-as>/modules" directory
+
+ 3) Then copy the sqlserver database JDBC driver jar file "sqljdbc4.jar" into
+ "<jboss-as>/modules/com/microsoft/sqlserver/main" directory.
+ 4) start server
+
+Step 2: Creating the datasource
+
+ Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "sqlserver.xml"
+ or "sqlserver-xa.xml" file under the "datasources" subsystem. You may have to edit contents according
+ to where your sqlserver server is located and credentials you need to use to access it.
+
+ Option 2: Take a look at create-ds.cli script, and modify and execute using JBoss CLI tool as below
+
+ ./Jboss-admin.sh --file create-ds.cli
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/sqlserver-xa.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/sqlserver-xa.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/sqlserver-xa.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,48 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <xa-datasource jndi-name="java:/sqlserverDS" pool-name="sqlserverDS" enabled="true" use-java-context="true" use-ccm="true">
+
+ <xa-datasource-property name="PortNumber">1433</xa-datasource-property>
+ <xa-datasource-property name="DatabaseName">{db-name}</xa-datasource-property>
+ <xa-datasource-property name="ServerName">{host}</xa-datasource-property>
+
+ <driver>sqlserver</driver>
+
+ <!--
+ <new-connection-sql>select 1/new-connection-sql>
+ <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
+ -->
+
+ <xa-pool>
+ <min-pool-size>10</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <is-same-rm-override>true</is-same-rm-override>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ <no-tx-separate-pools/>
+ </xa-pool>
+
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ <!--
+ <security-domain>mysecurity-realm</security-domain>
+ -->
+ </security>
+
+ <!--
+ <validation>
+ <check-valid-connection-sql>select 1</check-valid-connection-sql>
+ </validation>
+ -->
+ </xa-datasource>
+ <drivers>
+ <driver name="sqlserver" module="com.microsoft.sqlserver">
+ <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
+ <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/sqlserver-xa.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/sqlserver.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/sqlserver.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/sqlserver.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,24 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/sqlserverDS" pool-name="sqlserverDS">
+ <connection-url>jdbc:microsoft:sqlserver://{host}:1433</connection-url>
+ <driver>sqlserver</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="sqlserver" module="com.microsoft.sqlserver">
+ <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
+ <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/sqlserver/native/sqlserver.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,12 @@
+If you installed Teiid into JBoss AS then the driver is already installed, you only need to create a datasource
+
+Creating the datasource
+
+ Option 1: Edit the standalone-teiid.xml or domain-teiid.xml file and add contents of the "teiid.xml"
+ or "teiid-xa.xml" or "teiid-local.xml" file under the "datasources" subsystem. You may have to edit contents according
+ to where your Teiid server is located and credentials you need to use to access it.
+
+ Option 2: Take a look at create-ds.cli script, and modify and execute using JBoss CLI tool as below
+
+ ./Jboss-admin.sh --file create-ds.cli
+
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid-local.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid-local.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid-local.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,24 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/teiidDS" pool-name="teiidDS">
+ <connection-url>jdbc:teiid:{vdb}</connection-url>
+ <driver>teiid-local</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="teiid-local" module="org.jboss.teiid">
+ <driver-class>org.teiid.jdbc.TeiidDriver</driver-class>
+ <xa-datasource-class>org.teiid.jdbc.TeiidDataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid-local.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid-xa.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid-xa.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid-xa.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,48 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <xa-datasource jndi-name="java:/teiidDS" pool-name="teiidDS" enabled="true" use-java-context="true" use-ccm="true">
+
+ <xa-datasource-property name="PortNumber">31000</xa-datasource-property>
+ <xa-datasource-property name="DatabaseName">{db-name}</xa-datasource-property>
+ <xa-datasource-property name="ServerName">{host}</xa-datasource-property>
+
+ <driver>teiid</driver>
+
+ <!--
+ <new-connection-sql>select 1/new-connection-sql>
+ <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
+ -->
+
+ <xa-pool>
+ <min-pool-size>10</min-pool-size>
+ <max-pool-size>20</max-pool-size>
+ <is-same-rm-override>true</is-same-rm-override>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ <no-tx-separate-pools/>
+ </xa-pool>
+
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ <!--
+ <security-domain>mysecurity-realm</security-domain>
+ -->
+ </security>
+
+ <!--
+ <validation>
+ <check-valid-connection-sql>select 1</check-valid-connection-sql>
+ </validation>
+ -->
+ </xa-datasource>
+ <drivers>
+ <driver name="teiid" module="org.jboss.teiid.client">
+ <driver-class>org.teiid.jdbc.TeiidDriver</driver-class>
+ <xa-datasource-class>org.teiid.jdbc.TeiidDataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid-xa.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid.xml (from rev 3720, trunk/build/kits/jboss-container/teiid-examples/jca/teiid-jdbc-template-ds.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,24 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:datasources:1.0">
+ <datasources>
+ <datasource jndi-name="java:/teiidDS" pool-name="teiidDS">
+ <connection-url>jdbc:teiid:{vdb}@mm://{host}:31000</connection-url>
+ <driver>teiid</driver>
+ <pool>
+ <prefill>false</prefill>
+ <use-strict-min>false</use-strict-min>
+ <flush-strategy>FailingConnectionOnly</flush-strategy>
+ </pool>
+ <security>
+ <user-name>{user}</user-name>
+ <password>{password}</password>
+ </security>
+ </datasource>
+ <drivers>
+ <driver name="teiid" module="org.jboss.teiid.client">
+ <driver-class>org.teiid.jdbc.TeiidDriver</driver-class>
+ <xa-datasource-class>org.teiid.jdbc.TeiidDataSource</xa-datasource-class>
+ </driver>
+ </drivers>
+ </datasources>
+</subsystem>
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/teiid/teiid.xml
___________________________________________________________________
Added: svn:keywords
+ Id Revision
Added: svn:eol-style
+ LF
Added: trunk/build/kits/jboss-as7/docs/teiid/datasources/web-service/readme.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/web-service/readme.txt (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/web-service/readme.txt 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,3 @@
+In Teiid, for web-service(SOAP, REST/HTTP) datasource a JCA connector is provided and deployed at the install time. To create
+web service datasource connection edit the "standalone-teiid.xml" file or "doamin-teiid.xml" file and add
+the contents of the ws.xml under "resource-adapters" subsystem section.
\ No newline at end of file
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/web-service/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/build/kits/jboss-as7/docs/teiid/datasources/web-service/ws.xml (from rev 3720, trunk/build/kits/jboss-as7/docs/teiid/datasources/ws.xml)
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/web-service/ws.xml (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/web-service/ws.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -0,0 +1,27 @@
+<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
+<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
+ <resource-adapters>
+ <resource-adapter>
+ <archive>teiid-connector-ws.rar</archive>
+ <transaction-support>NoTransaction</transaction-support>
+ <connection-definitions>
+ <connection-definition class-name="org.teiid.resource.adapter.ws.WSManagedConnectionFactory"
+ jndi-name="java:/wsDS"
+ enabled="true"
+ use-java-context="true"
+ pool-name="teiid-ws-ds">
+
+ <!-- End point for the web service -->
+ <config-property name="EndPoint">endpoint url</config-property>
+
+ <!--
+ Uncomment these properties to supply specific CXF configuration for this service. This file
+ must contain configuration for name defined on "configName" property.
+ <config-property name="configFile">path/to/jbossws-cxf.xml</config-property>
+ <config-property name="configName">webSVC</config-property>
+ -->
+ </connection-definition>
+ </connection-definitions>
+ </resource-adapter>
+ </resource-adapters>
+</subsystem>
Property changes on: trunk/build/kits/jboss-as7/docs/teiid/datasources/web-service/ws.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/build/kits/jboss-as7/docs/teiid/datasources/ws.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/datasources/ws.xml 2011-12-08 16:14:29 UTC (rev 3725)
+++ trunk/build/kits/jboss-as7/docs/teiid/datasources/ws.xml 2011-12-08 17:13:56 UTC (rev 3726)
@@ -1,27 +0,0 @@
-<!-- If susbsytem is already defined, only copy the contents under it and edit to suit your needs -->
-<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
- <resource-adapters>
- <resource-adapter>
- <archive>teiid-connector-ws.rar</archive>
- <transaction-support>NoTransaction</transaction-support>
- <connection-definitions>
- <connection-definition class-name="org.teiid.resource.adapter.ws.WSManagedConnectionFactory"
- jndi-name="java:/wsDS"
- enabled="true"
- use-java-context="true"
- pool-name="teiid-ws-ds">
-
- <!-- End point for the web service -->
- <config-property name="EndPoint">endpoint url</config-property>
-
- <!--
- Uncomment these properties to supply specific CXF configuration for this service. This file
- must contain configuration for name defined on "configName" property.
- <config-property name="configFile">path/to/jbossws-cxf.xml</config-property>
- <config-property name="configName">webSVC</config-property>
- -->
- </connection-definition>
- </connection-definitions>
- </resource-adapter>
- </resource-adapters>
-</subsystem>
13 years
teiid SVN: r3725 - branches/7.4.x/metadata/src/main/java/org/teiid/metadata/index.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2011-12-08 11:14:29 -0500 (Thu, 08 Dec 2011)
New Revision: 3725
Modified:
branches/7.4.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
branches/7.4.x/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
Log:
SOA-3643 VDB deployment in EDS can be extremely slow based upon indexing needs (SOA 5.2)
Modified: branches/7.4.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
===================================================================
--- branches/7.4.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java 2011-12-07 20:42:04 UTC (rev 3724)
+++ branches/7.4.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java 2011-12-08 16:14:29 UTC (rev 3725)
@@ -42,12 +42,9 @@
import org.jboss.virtual.spi.VirtualFileHandler;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
-import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.core.TeiidException;
import org.teiid.core.TeiidRuntimeException;
-import org.teiid.core.id.UUID;
import org.teiid.core.index.IEntryResult;
-import org.teiid.core.util.ArgCheck;
import org.teiid.core.util.StringUtil;
import org.teiid.internal.core.index.Index;
import org.teiid.metadata.AbstractMetadataRecord;
@@ -76,12 +73,95 @@
public class IndexMetadataFactory {
private Index[] indexes;
- private RecordFactory recordFactory = new RecordFactory();
+ private RecordFactory recordFactory = new RecordFactory() {
+
+ protected AbstractMetadataRecord getMetadataRecord(char[] record) {
+ if (record == null || record.length == 0) {
+ return null;
+ }
+ char c = record[0];
+ switch (c) {
+ case MetadataConstants.RECORD_TYPE.ANNOTATION: {
+ final String str = new String(record);
+ final List<String> tokens = RecordFactory.getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+
+ // Extract the index version information from the record
+ int indexVersion = recordFactory.getIndexVersion(record);
+ String uuid = tokens.get(2);
+
+ // The tokens are the standard header values
+ int tokenIndex = 6;
+
+ if(recordFactory.includeAnnotationProperties(indexVersion)) {
+ // The next token are the properties, ignore it not going to be read any way
+ tokenIndex++;
+ }
+
+ // The next token is the description
+ annotationCache.put(uuid, tokens.get(tokenIndex++));
+ return null;
+ }
+ case MetadataConstants.RECORD_TYPE.PROPERTY: {
+ final String str = new String(record);
+ final List<String> tokens = RecordFactory.getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+
+ String uuid = tokens.get(1);
+ LinkedHashMap<String, String> result = extensionCache.get(uuid);
+ if (result == null) {
+ result = new LinkedHashMap<String, String>();
+ extensionCache.put(uuid, result);
+ }
+ // The tokens are the standard header values
+ int tokenIndex = 2;
+ result.put( tokens.get(tokenIndex++), tokens.get(tokenIndex++));
+ return null;
+ }
+ default:
+ AbstractMetadataRecord abstractMetadataRecord = super.getMetadataRecord(record);
+ if (abstractMetadataRecord == null) {
+ return null; //record type no longer used
+ }
+ if (record[0] == MetadataConstants.RECORD_TYPE.SELECT_TRANSFORM) {
+ this.toString();
+ }
+ String parentName = null;
+ if (record[0] == MetadataConstants.RECORD_TYPE.TABLE) {
+ parentName = ((Table)abstractMetadataRecord).getParent().getName();
+ } else if (record[0] == MetadataConstants.RECORD_TYPE.CALLABLE) {
+ parentName = ((Procedure)abstractMetadataRecord).getParent().getName();
+ }
+ if (parentName != null) {
+ Map<Character, List<AbstractMetadataRecord>> map = schemaEntries.get(parentName);
+ if (map == null) {
+ map = new HashMap<Character, List<AbstractMetadataRecord>>();
+ schemaEntries.put(parentName, map);
+ }
+ List<AbstractMetadataRecord> typeRecords = map.get(record[0]);
+ if (typeRecords == null) {
+ typeRecords = new ArrayList<AbstractMetadataRecord>();
+ map.put(record[0], typeRecords);
+ }
+ typeRecords.add(abstractMetadataRecord);
+ }
+ Map<String, AbstractMetadataRecord> uuidMap = getByType(record[0]);
+ uuidMap.put(abstractMetadataRecord.getUUID(), abstractMetadataRecord);
+ if (parentId != null) {
+ List<AbstractMetadataRecord> typeChildren = getByParent(parentId, record[0], AbstractMetadataRecord.class, true);
+ typeChildren.add(abstractMetadataRecord);
+ }
+ return abstractMetadataRecord;
+ }
+ }
+
+ };
private Map<String, String> annotationCache = new HashMap<String, String>();
private Map<String, LinkedHashMap<String, String>> extensionCache = new HashMap<String, LinkedHashMap<String,String>>();
- private Map<String, Datatype> datatypeCache;
- private Map<String, KeyRecord> primaryKeyCache = new HashMap<String, KeyRecord>();
- private Map<String, Table> tableCache = new HashMap<String, Table>();
+ //map of schema name to record entries
+ private Map<String, Map<Character, List<AbstractMetadataRecord>>> schemaEntries = new HashMap<String, Map<Character, List<AbstractMetadataRecord>>>();
+ //map of parent uuid to record entries
+ private Map<String, Map<Character, List<AbstractMetadataRecord>>> childRecords = new HashMap<String, Map<Character, List<AbstractMetadataRecord>>>();
+ //map of type to maps of uuids
+ private Map<Character, LinkedHashMap<String, AbstractMetadataRecord>> allRecords = new HashMap<Character, LinkedHashMap<String, AbstractMetadataRecord>>();
private MetadataStore store;
private HashSet<VirtualFile> indexFiles = new HashSet<VirtualFile>();
private LinkedHashMap<String, Resource> vdbEntries;
@@ -114,7 +194,53 @@
//just use the defaults for model visibility
addEntriesPlusVisibilities(vdb, new VDBMetaData());
}
-
+
+ Map<String, AbstractMetadataRecord> getByType(char type) {
+ LinkedHashMap<String, AbstractMetadataRecord> uuidMap = allRecords.get(type);
+ if (uuidMap == null) {
+ uuidMap = new LinkedHashMap<String, AbstractMetadataRecord>();
+ allRecords.put(type, uuidMap);
+ }
+ return uuidMap;
+ }
+
+ <T extends AbstractMetadataRecord> List<T> getByParent(String parentId, char type, @SuppressWarnings("unused") Class<T> clazz, boolean create) {
+ Map<Character, List<AbstractMetadataRecord>> children = childRecords.get(parentId);
+ if (children == null) {
+ children = new HashMap<Character, List<AbstractMetadataRecord>>();
+ childRecords.put(parentId, children);
+ }
+ List<AbstractMetadataRecord> typeChildren = children.get(type);
+ if (typeChildren == null) {
+ if (!create) {
+ return Collections.emptyList();
+ }
+ typeChildren = new ArrayList<AbstractMetadataRecord>(2);
+ children.put(type, typeChildren);
+ }
+ return (List<T>) typeChildren;
+ }
+
+ private void loadAll() {
+ for (Index index : this.indexes) {
+ try {
+ IEntryResult[] results = SimpleIndexUtil.queryIndex(new Index[] {index}, new char[0], true, true, false);
+ recordFactory.getMetadataRecord(results);
+ } catch (TeiidException e) {
+ throw new TeiidRuntimeException(e);
+ }
+ }
+ //associate the annotation/extension metadata
+ for (Map<String, AbstractMetadataRecord> map : allRecords.values()) {
+ for (AbstractMetadataRecord metadataRecord : map.values()) {
+ String uuid = metadataRecord.getUUID();
+
+ metadataRecord.setAnnotation(this.annotationCache.get(uuid));
+ metadataRecord.setProperties(this.extensionCache.get(uuid));
+ }
+ }
+ }
+
public MetadataStore getMetadataStore(Collection<Datatype> systemDatatypes) throws IOException {
if (this.store == null) {
this.store = new MetadataStore();
@@ -125,72 +251,27 @@
tmp.add(index);
}
this.indexes = tmp.toArray(new Index[tmp.size()]);
- getAnnotationCache();
- getExtensionCache();
- Map<String, Datatype> datatypes = getDatatypeCache();
+ loadAll();
+ //force close, since we cached the index files
+ for (Index index : tmp) {
+ index.close();
+ }
+ Map<String, AbstractMetadataRecord> uuidToRecord = getByType(MetadataConstants.RECORD_TYPE.DATATYPE);
+ for (AbstractMetadataRecord datatypeRecordImpl : uuidToRecord.values()) {
+ this.store.addDatatype((Datatype) datatypeRecordImpl);
+ }
if (systemDatatypes != null) {
for (Datatype datatype : systemDatatypes) {
- datatypes.put(datatype.getUUID(), datatype);
+ uuidToRecord.put(datatype.getUUID(), datatype);
}
}
- List<KeyRecord> keys = findMetadataRecords(MetadataConstants.RECORD_TYPE.PRIMARY_KEY, null, false);
- for (KeyRecord keyRecord : keys) {
- this.primaryKeyCache.put(keyRecord.getUUID(), keyRecord);
- }
getModels();
getTables();
getProcedures();
- //force close, since we cached the index files
- for (Index index : tmp) {
- index.close();
- }
}
return store;
}
- private void getExtensionCache() {
- IEntryResult[] properties = queryIndex(MetadataConstants.RECORD_TYPE.PROPERTY, null, false);
-
- for (IEntryResult iEntryResult : properties) {
- final String str = new String(iEntryResult.getWord());
- final List<String> tokens = RecordFactory.getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
-
- String uuid = tokens.get(1);
- LinkedHashMap<String, String> result = this.extensionCache.get(uuid);
- if (result == null) {
- result = new LinkedHashMap<String, String>();
- this.extensionCache.put(uuid, result);
- }
- // The tokens are the standard header values
- int tokenIndex = 2;
- result.put( tokens.get(tokenIndex++), tokens.get(tokenIndex++));
- }
- }
-
- private void getAnnotationCache() {
- IEntryResult[] results = queryIndex(MetadataConstants.RECORD_TYPE.ANNOTATION, null, false);
-
- for (IEntryResult iEntryResult : results) {
- final String str = new String(iEntryResult.getWord());
- final List<String> tokens = RecordFactory.getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
-
- // Extract the index version information from the record
- int indexVersion = recordFactory.getIndexVersion(iEntryResult.getWord());
- String uuid = tokens.get(2);
-
- // The tokens are the standard header values
- int tokenIndex = 6;
-
- if(recordFactory.includeAnnotationProperties(indexVersion)) {
- // The next token are the properties, ignore it not going to be read any way
- tokenIndex++;
- }
-
- // The next token is the description
- this.annotationCache.put(uuid, tokens.get(tokenIndex++));
- }
- }
-
public void addIndexFile(VirtualFile f) {
this.indexFiles.add(f);
}
@@ -246,15 +327,24 @@
}
public void getModels() {
- Collection<Schema> records = findMetadataRecords(MetadataConstants.RECORD_TYPE.MODEL, null, false);
- for (Schema modelRecord : records) {
- store.addSchema(modelRecord);
+ Collection<AbstractMetadataRecord> records = getByType(MetadataConstants.RECORD_TYPE.MODEL).values();
+ for (AbstractMetadataRecord modelRecord : records) {
+ store.addSchema((Schema) modelRecord);
}
}
public void getTables() {
for (Schema model : store.getSchemas().values()) {
- List<Table> records = findMetadataRecords(MetadataConstants.RECORD_TYPE.TABLE, model.getName() + IndexConstants.NAME_DELIM_CHAR + IndexConstants.RECORD_STRING.MATCH_CHAR, true);
+ Map<Character, List<AbstractMetadataRecord>> entries = schemaEntries.get(model.getName());
+ if (entries == null) {
+ continue;
+ }
+ List recs = entries.get(MetadataConstants.RECORD_TYPE.TABLE);
+ if (recs == null) {
+ continue;
+ }
+ List<Table> records = recs;
+
//load non-materialized first, so that the uuid->table cache is populated
Collections.sort(records, new Comparator<Table>() {
@Override
@@ -269,10 +359,9 @@
}
});
for (Table tableRecord : records) {
- tableCache.put(tableRecord.getUUID(), tableRecord);
- List<Column> columns = new ArrayList<Column>(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.COLUMN));
+ List<Column> columns = new ArrayList<Column>(getByParent(tableRecord.getUUID(), MetadataConstants.RECORD_TYPE.COLUMN, Column.class, false));
for (Column columnRecordImpl : columns) {
- columnRecordImpl.setDatatype(getDatatypeCache().get(columnRecordImpl.getDatatypeUUID()));
+ columnRecordImpl.setDatatype((Datatype) getByType(MetadataConstants.RECORD_TYPE.DATATYPE).get(columnRecordImpl.getDatatypeUUID()));
columnRecordImpl.setParent(tableRecord);
String fullName = columnRecordImpl.getName();
if (fullName.startsWith(tableRecord.getName() + '.')) {
@@ -281,7 +370,7 @@
}
Collections.sort(columns);
tableRecord.setColumns(columns);
- tableRecord.setAccessPatterns(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.ACCESS_PATTERN));
+ tableRecord.setAccessPatterns(getByParent(tableRecord.getUUID(), MetadataConstants.RECORD_TYPE.ACCESS_PATTERN, KeyRecord.class, false));
Map<String, Column> uuidColumnMap = new HashMap<String, Column>();
for (Column columnRecordImpl : columns) {
uuidColumnMap.put(columnRecordImpl.getUUID(), columnRecordImpl);
@@ -290,18 +379,18 @@
loadColumnSetRecords(columnSetRecordImpl, uuidColumnMap);
columnSetRecordImpl.setParent(tableRecord);
}
- tableRecord.setForiegnKeys(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.FOREIGN_KEY));
+ tableRecord.setForiegnKeys(getByParent(tableRecord.getUUID(), MetadataConstants.RECORD_TYPE.FOREIGN_KEY, ForeignKey.class, false));
for (ForeignKey foreignKeyRecord : tableRecord.getForeignKeys()) {
foreignKeyRecord.setPrimaryKey(getPrimaryKey(foreignKeyRecord.getUniqueKeyID()));
loadColumnSetRecords(foreignKeyRecord, uuidColumnMap);
foreignKeyRecord.setParent(tableRecord);
}
- tableRecord.setUniqueKeys(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.UNIQUE_KEY));
+ tableRecord.setUniqueKeys(getByParent(tableRecord.getUUID(), MetadataConstants.RECORD_TYPE.UNIQUE_KEY, KeyRecord.class, false));
for (KeyRecord columnSetRecordImpl : tableRecord.getUniqueKeys()) {
loadColumnSetRecords(columnSetRecordImpl, uuidColumnMap);
columnSetRecordImpl.setParent(tableRecord);
}
- tableRecord.setIndexes(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.INDEX));
+ tableRecord.setIndexes(getByParent(tableRecord.getUUID(), MetadataConstants.RECORD_TYPE.INDEX, KeyRecord.class, false));
for (KeyRecord columnSetRecordImpl : tableRecord.getIndexes()) {
loadColumnSetRecords(columnSetRecordImpl, uuidColumnMap);
columnSetRecordImpl.setParent(tableRecord);
@@ -339,8 +428,8 @@
}
}
if (tableRecord.isMaterialized()) {
- tableRecord.setMaterializedStageTable(tableCache.get(tableRecord.getMaterializedStageTable().getUUID()));
- tableRecord.setMaterializedTable(tableCache.get(tableRecord.getMaterializedTable().getUUID()));
+ tableRecord.setMaterializedStageTable((Table)getByType(MetadataConstants.RECORD_TYPE.TABLE).get(tableRecord.getMaterializedStageTable().getUUID()));
+ tableRecord.setMaterializedTable((Table)getByType(MetadataConstants.RECORD_TYPE.TABLE).get(tableRecord.getMaterializedTable().getUUID()));
}
model.addTable(tableRecord);
}
@@ -348,28 +437,16 @@
}
private KeyRecord getPrimaryKey(String uuid) {
- KeyRecord key = this.primaryKeyCache.get(uuid);
+ KeyRecord key = (KeyRecord)this.getByType(MetadataConstants.RECORD_TYPE.PRIMARY_KEY).get(uuid);
if (key == null) {
throw new TeiidRuntimeException(uuid+" PrimaryKey "+TransformationMetadata.NOT_EXISTS_MESSAGE); //$NON-NLS-1$
}
return key;
}
- public Map<String, Datatype> getDatatypeCache() {
- if (this.datatypeCache == null) {
- this.datatypeCache = new HashMap<String, Datatype>();
- Collection<Datatype> dataTypes = findMetadataRecords(MetadataConstants.RECORD_TYPE.DATATYPE, null, false);
- for (Datatype datatypeRecordImpl : dataTypes) {
- datatypeCache.put(datatypeRecordImpl.getUUID(), datatypeRecordImpl);
- this.store.addDatatype(datatypeRecordImpl);
- }
- }
- return datatypeCache;
- }
-
private Column findElement(String fullName) {
- Column columnRecord = (Column)getRecordByType(fullName, MetadataConstants.RECORD_TYPE.COLUMN);
- columnRecord.setDatatype(getDatatypeCache().get(columnRecord.getDatatypeUUID()));
+ Column columnRecord = (Column)getRecordByType(fullName, MetadataConstants.RECORD_TYPE.COLUMN);
+ columnRecord.setDatatype((Datatype) getByType(MetadataConstants.RECORD_TYPE.DATATYPE).get(columnRecord.getDatatypeUUID()));
return columnRecord;
}
@@ -379,31 +456,34 @@
private AbstractMetadataRecord getRecordByType(final String entityName, final char recordType, boolean mustExist) {
// Query the index files
- final Collection results = findMetadataRecords(recordType,entityName,false);
-
- int resultSize = results.size();
- if(resultSize == 1) {
- // get the columnset record for this result
- return (AbstractMetadataRecord) results.iterator().next();
- }
- if(resultSize == 0) {
+ AbstractMetadataRecord record = getByType(recordType).get(entityName);
+
+ if(record == null) {
if (mustExist) {
// there should be only one for the UUID
throw new TeiidRuntimeException(entityName+TransformationMetadata.NOT_EXISTS_MESSAGE);
}
return null;
}
- throw new TeiidRuntimeException(RuntimeMetadataPlugin.Util.getString("TransformationMetadata.0", entityName)); //$NON-NLS-1$
+ return record;
}
public void getProcedures() {
for (Schema model : store.getSchemas().values()) {
- Collection<Procedure> procedureRecordImpls = findMetadataRecords(MetadataConstants.RECORD_TYPE.CALLABLE, model.getName() + IndexConstants.NAME_DELIM_CHAR + IndexConstants.RECORD_STRING.MATCH_CHAR, true);
- for (Procedure procedureRecord : procedureRecordImpls) {
+ Map<Character, List<AbstractMetadataRecord>> entries = schemaEntries.get(model.getName());
+ if (entries == null) {
+ continue;
+ }
+ List recs = entries.get(MetadataConstants.RECORD_TYPE.CALLABLE);
+ if (recs == null) {
+ continue;
+ }
+ List<Procedure> records = recs;
+ for (Procedure procedureRecord : records) {
// get the parameter metadata info
for (int i = 0; i < procedureRecord.getParameters().size(); i++) {
ProcedureParameter paramRecord = (ProcedureParameter) this.getRecordByType(procedureRecord.getParameters().get(i).getUUID(), MetadataConstants.RECORD_TYPE.CALLABLE_PARAMETER);
- paramRecord.setDatatype(getDatatypeCache().get(paramRecord.getDatatypeUUID()));
+ paramRecord.setDatatype((Datatype) getByType(MetadataConstants.RECORD_TYPE.DATATYPE).get(paramRecord.getDatatypeUUID()));
procedureRecord.getParameters().set(i, paramRecord);
paramRecord.setProcedure(procedureRecord);
}
@@ -464,22 +544,6 @@
}
}
- /**
- * Finds children by parent uuid - note that this is not the best way to query for columns,
- * but it removes the need to store the parent uuid
- * @param parentRecord
- * @param childRecordType
- * @return
- */
- private List findChildRecords(final AbstractMetadataRecord parentRecord, final char childRecordType) {
- // construct the pattern string
- String patternStr = getUUIDMatchPattern(childRecordType, parentRecord.getUUID(), true);
- // Query the model index files
- IEntryResult[] results = queryIndex(childRecordType, patternStr.toCharArray(), false, true, false);
-
- return loadRecords(results);
- }
-
private void loadColumnSetRecords(ColumnSet<?> indexRecord, Map<String, Column> columns) {
for (int i = 0; i < indexRecord.getColumns().size(); i++) {
String uuid = indexRecord.getColumns().get(i).getUUID();
@@ -496,180 +560,5 @@
}
}
}
-
- private List findMetadataRecords(final char recordType,
- final String entityName, final boolean isPartialName) {
- IEntryResult[] results = queryIndex(recordType, entityName, isPartialName);
- List<AbstractMetadataRecord> records = loadRecords(results);
- return records;
- }
- private List<AbstractMetadataRecord> loadRecords(
- IEntryResult[] results) {
- List<AbstractMetadataRecord> records = recordFactory.getMetadataRecord(results);
-
- for (AbstractMetadataRecord metadataRecord : records) {
- String uuid = metadataRecord.getUUID();
-
- metadataRecord.setAnnotation(this.annotationCache.get(uuid));
- metadataRecord.setProperties(this.extensionCache.get(uuid));
- }
- return records;
- }
-
- /**
- * Return the pattern match string that could be used to match a UUID in
- * an index record. All index records contain a header portion of the form:
- * recordType|pathInModel|UUID|nameInSource|parentObjectID|
- * @param uuid The UUID for which the pattern match string is to be constructed.
- * @return The pattern match string of the form: recordType|*|uuid|*
- */
- private String getUUIDMatchPattern(final char recordType, String uuid, boolean parent) {
- ArgCheck.isNotNull(uuid);
- // construct the pattern string
- String patternStr = String.valueOf(recordType) + IndexConstants.RECORD_STRING.RECORD_DELIMITER + IndexConstants.RECORD_STRING.MATCH_CHAR + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- if (parent) {
- for (int i = 0; i < 3; i++) {
- patternStr += String.valueOf(IndexConstants.RECORD_STRING.MATCH_CHAR) + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- }
- }
- patternStr += uuid.toLowerCase() + IndexConstants.RECORD_STRING.RECORD_DELIMITER + IndexConstants.RECORD_STRING.MATCH_CHAR;
- return patternStr;
- }
-
- /**
- * Return all index file records that match the specified entity name
- * @param indexName
- * @param entityName the name to match
- * @param isPartialName true if the entity name is a partially qualified
- * @return results
- * @throws QueryMetadataException
- */
- private IEntryResult[] queryIndex(final char recordType, final String entityName, final boolean isPartialName) {
-
- IEntryResult[] results = null;
-
- // Query based on UUID
- if (StringUtil.startsWithIgnoreCase(entityName,UUID.PROTOCOL)) {
- String patternString = null;
- if (recordType == MetadataConstants.RECORD_TYPE.DATATYPE) {
- patternString = getDatatypeUUIDMatchPattern(entityName);
- } else {
- patternString = getUUIDMatchPattern(recordType,entityName, false);
- }
- results = queryIndex(recordType, patternString.toCharArray(), false, true, true);
- }
-
- // Query based on partially qualified name
- else if (isPartialName) {
- String patternString = getMatchPattern(recordType,entityName);
- results = queryIndex(recordType, patternString.toCharArray(), false, true, false);
- }
-
- // Query based on fully qualified name
- else {
- String prefixString = getPrefixPattern(recordType,entityName);
- results = queryIndex(recordType, prefixString.toCharArray(), true, true, entityName != null);
- }
-
- return results;
- }
-
- /**
- * Return the pattern match string that could be used to match a UUID in
- * a datatype index record. The RECORD_TYPE.DATATYPE records contain a header portion of the form:
- * recordType|datatypeID|basetypeID|fullName|objectID|nameInSource|...
- * @param uuid The UUID for which the pattern match string is to be constructed.
- * @return The pattern match string of the form: recordType|*|*|*|uuid|*
- */
- private String getDatatypeUUIDMatchPattern(final String uuid) {
- ArgCheck.isNotNull(uuid);
- String uuidString = uuid;
- if (StringUtil.startsWithIgnoreCase(uuid,UUID.PROTOCOL)) {
- uuidString = uuid.toLowerCase();
- }
- // construct the pattern string
- String patternStr = "" //$NON-NLS-1$
- + MetadataConstants.RECORD_TYPE.DATATYPE //recordType
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + IndexConstants.RECORD_STRING.MATCH_CHAR //datatypeID
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + IndexConstants.RECORD_STRING.MATCH_CHAR //basetypeID
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + IndexConstants.RECORD_STRING.MATCH_CHAR //fullName
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + uuidString //objectID
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + IndexConstants.RECORD_STRING.MATCH_CHAR;
- return patternStr;
- }
-
- /**
- * Return the prefix match string that could be used to exactly match a fully
- * qualified entity name in an index record. All index records
- * contain a header portion of the form:
- * recordType|pathInModel|UUID|nameInSource|parentObjectID|
- * @param name The fully qualified name for which the prefix match
- * string is to be constructed.
- * @return The pattern match string of the form: recordType|name|
- */
- private String getPrefixPattern(final char recordType, final String name) {
-
- // construct the pattern string
- String patternStr = "" //$NON-NLS-1$
- + recordType
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- if(name != null) {
- patternStr = patternStr + name.trim().toUpperCase() + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- }
-
- return patternStr;
- }
-
- /**
- * Return the pattern match string that could be used to match a
- * partially/fully qualified entity name in an index record. All index records
- * contain a header portion of the form:
- * recordType|pathInModel|UUID|nameInSource|parentObjectID|
- * @param name The partially/fully qualified name for which
- * the pattern match string is to be constructed.
- * @return The pattern match string of the form: recordType|name|*
- */
- private String getMatchPattern(final char recordType, final String name) {
- ArgCheck.isNotNull(name);
-
- // construct the pattern string
- String patternStr = "" //$NON-NLS-1$
- + recordType
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- if(name != null) {
- patternStr = patternStr + name.trim().toUpperCase()
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + IndexConstants.RECORD_STRING.MATCH_CHAR;
- }
- return patternStr;
- }
-
- /**
- * Return all index file records that match the specified record pattern.
- * @param indexes the array of MtkIndex instances to query
- * @param pattern
- * @return results
- * @throws QueryMetadataException
- */
- private IEntryResult[] queryIndex(char recordType, final char[] pattern, boolean isPrefix, boolean isCaseSensitive, boolean returnFirstMatch) {
- // The the index file name for the record type
- final String indexName = SimpleIndexUtil.getIndexFileNameForRecordType(recordType);
- Index[] search = SimpleIndexUtil.getIndexes(indexName, this.indexes);
-
- if (search.length == 0) {
- search = this.indexes;
- }
-
- try {
- return SimpleIndexUtil.queryIndex(search, pattern, isPrefix, isCaseSensitive, returnFirstMatch);
- } catch (TeiidException e) {
- throw new TeiidRuntimeException(e);
- }
- }
}
Modified: branches/7.4.x/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
===================================================================
--- branches/7.4.x/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2011-12-07 20:42:04 UTC (rev 3724)
+++ branches/7.4.x/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2011-12-08 16:14:29 UTC (rev 3725)
@@ -134,6 +134,8 @@
public static final int CURRENT_INDEX_VERSION = PROCEDURE_UPDATE_COUNT_VERSION;
private int version = NONVERSIONED_RECORD_INDEX_VERSION;
+
+ protected String parentId;
/**
* Return a collection of {@link AbstractMetadataRecord}
@@ -157,7 +159,8 @@
* instances for specified IEntryResult.
* @param entryResult
*/
- private AbstractMetadataRecord getMetadataRecord(final char[] record) {
+ protected AbstractMetadataRecord getMetadataRecord(final char[] record) {
+ parentId = null;
if (record == null || record.length == 0) {
return null;
}
@@ -182,7 +185,7 @@
case MetadataConstants.RECORD_TYPE.MAPPING_TRANSFORM:
case MetadataConstants.RECORD_TYPE.PROC_TRANSFORM: return createTransformationRecord(record);
default:
- throw new IllegalArgumentException("Invalid record type for creating MetadataRecord "+record[0]); //$NON-NLS-1$
+ return null;
}
}
@@ -343,11 +346,12 @@
int tokenIndex = 2;
// The next token is the UUID of the transformed object
- getObjectValue(tokens.get(tokenIndex++));
+ transform.setUUID(getObjectValue(tokens.get(tokenIndex++)));
// The next token is the UUID of the transformation object
if(includeTransformationUUID(indexVersion)) {
- transform.setUUID(getObjectValue((tokens.get(tokenIndex++))));
+ tokenIndex++;
+ //transform.setUUID(getObjectValue((tokens.get(tokenIndex++))));
}
// The next token is the transformation definition
@@ -857,8 +861,8 @@
}
final List<String> tokens = StringUtil.split(values,String.valueOf(listDelimiter));
final List<String> result = new ArrayList<String>(tokens.size());
- for (Iterator iter = tokens.iterator(); iter.hasNext();) {
- String token = (String)iter.next();
+ for (Iterator<String> iter = tokens.iterator(); iter.hasNext();) {
+ String token = iter.next();
if (token != null) {
result.add(new String(token));
}
@@ -950,6 +954,7 @@
final String parentObjectID) {
record.setUUID(getObjectValue(objectID));
+ String parentName = fullName;
if (fullName != null) {
String name = fullName;
if (record instanceof ProcedureParameter || record instanceof KeyRecord) { //take only the last part
@@ -958,10 +963,23 @@
int index = fullName.indexOf(IndexConstants.NAME_DELIM_CHAR);
if (index > 0) {
name = new String(fullName.substring(index + 1));
+ parentName = new String(fullName.substring(0, index));
}
}
record.setName(name);
}
+ if (parentName != null) {
+ if (record instanceof Table) {
+ Schema s = new Schema();
+ s.setName(parentName);
+ ((Table)record).setParent(s);
+ } else if (record instanceof Procedure) {
+ Schema s = new Schema();
+ s.setName(parentName);
+ ((Procedure)record).setParent(s);
+ }
+ }
+ parentId = getObjectValue(parentObjectID);
record.setNameInSource(getObjectValue(nameInSource));
}
13 years
teiid SVN: r3724 - in trunk: api/src/main/java/org/teiid/translator and 36 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-12-07 15:42:04 -0500 (Wed, 07 Dec 2011)
New Revision: 3724
Added:
trunk/api/src/main/java/org/teiid/translator/ReusableExecution.java
trunk/client/src/main/java/org/teiid/jdbc/RequestOptions.java
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java
Removed:
trunk/engine/src/main/java/org/teiid/query/util/ContextProperties.java
trunk/engine/src/test/java/org/teiid/dqp/message/TestAtomicRequestMessage.java
Modified:
trunk/api/src/main/java/org/teiid/CommandContext.java
trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java
trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html
trunk/client/src/main/java/org/teiid/client/RequestMessage.java
trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java
trunk/client/src/main/java/org/teiid/jdbc/TeiidStatement.java
trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties
trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml
trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ProcedureBatchHandler.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/message/AtomicRequestMessage.java
trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataReader.java
trunk/engine/src/main/java/org/teiid/query/function/source/SystemSource.java
trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java
trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java
trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/FakeExecutionContextImpl.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestConnectorWorkItem.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestExecutionContextImpl.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java
trunk/engine/src/test/java/org/teiid/query/function/TestFunction.java
trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestBatchedUpdatePlanner.java
trunk/engine/src/test/java/org/teiid/query/optimizer/capabilities/AllCapabilities.java
trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
trunk/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestRelationalNodeStatistics.java
trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
trunk/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
trunk/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestRelate.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
Log:
TEIID-1801 TEIID-1604 adding support for continuous plans and beginning to rationalize the context objects
Modified: trunk/api/src/main/java/org/teiid/CommandContext.java
===================================================================
--- trunk/api/src/main/java/org/teiid/CommandContext.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/api/src/main/java/org/teiid/CommandContext.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -24,7 +24,6 @@
import java.io.Serializable;
import java.util.Map;
-import java.util.Properties;
import java.util.TimeZone;
import javax.security.auth.Subject;
@@ -64,14 +63,6 @@
String getConnectionID();
/**
- * Get the environment properties. The returned properties are associated only with the currently executing command.
- * The only built-in key/value in the properties is the key "sessionid" with the same value as getConnectionID()
- * @return
- * @deprecated
- */
- Properties getEnvironmentProperties();
-
- /**
* Get the next random double value
* @return
*/
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -27,6 +27,7 @@
import javax.security.auth.Subject;
+import org.teiid.CommandContext;
import org.teiid.adminapi.Session;
import org.teiid.jdbc.TeiidSQLWarning;
@@ -167,4 +168,10 @@
* resumed.
*/
void dataAvailable();
+
+ /**
+ * Get the CommandContext
+ * @return
+ */
+ CommandContext getCommandContext();
}
Added: trunk/api/src/main/java/org/teiid/translator/ReusableExecution.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ReusableExecution.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/translator/ReusableExecution.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -0,0 +1,45 @@
+/*
+ * 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.translator;
+
+import org.teiid.language.Command;
+
+/**
+ * Additional methods that may optionally be implemented for an {@link Execution}
+ */
+public interface ReusableExecution<C> extends Execution {
+
+ /**
+ * Called to reinitialized the execution for use.
+ * @param c
+ * @param executionContext
+ * @param connection
+ */
+ void reset(Command c, ExecutionContext executionContext, C connection);
+
+ /**
+ * Called when the execution is no longer used.
+ */
+ void dispose();
+
+}
\ No newline at end of file
Property changes on: trunk/api/src/main/java/org/teiid/translator/ReusableExecution.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html 2011-12-07 20:42:04 UTC (rev 3724)
@@ -29,6 +29,13 @@
<LI><B>CallableStatement Named Parameters</B> - you can now use CallableStatement named parameter get/set methods.
<LI><B>New Translator capabilities</B> - translators may indicate which convert functions they support and restrict non-join comparisons
to only literals.
+ <LI><B>New Translator capabilities</B>
+ <UL>
+ <LI>translators may indicate which convert functions they support
+ <LI>restrict non-join comparisons to only literals.
+ <LI>return ReusableExecution instances for processing nodes that issue multiple queries.
+ </UL>
+ <LI><B>Continuous Asynch Queries</B> to process plans in a streamed window fashion the TeiidStatement/TeiidPreparedStatement methods now take a RequestOptions object to specify continuous mode. See the Client and Developers Guides for more.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
@@ -47,6 +54,8 @@
enable the pre-8.0 behavior. The BigDecimal form of the AVG function now uses the same precision and scale logic as the division system function, rather than using a
fixed scale of 9.
<li>BigDecimal division that returns a quotient that is equal to zero will have a scale of zero as well. Prior releases would typically return a zero value with a scale of 16.
+ <li>The env function no longer returns the value for the session id, the session_id() function should be used instead.
+ <li>The CommandContext no longer provides getEnvironmentProperties()
</ul>
<h4>from 7.5</h4>
Modified: trunk/client/src/main/java/org/teiid/client/RequestMessage.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/RequestMessage.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/client/src/main/java/org/teiid/client/RequestMessage.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -34,6 +34,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.util.ExternalizeUtil;
import org.teiid.jdbc.JDBCPlugin;
+import org.teiid.jdbc.RequestOptions;
/**
@@ -89,7 +90,13 @@
private long executionId;
private int transactionIsolation;
private boolean noExec;
+
+ /*
+ * Used by embedded connections, could change if we add support
+ * for an asynch socket transport
+ */
private transient boolean sync;
+ private RequestOptions requestOptions;
public RequestMessage() {
}
@@ -403,5 +410,16 @@
out.writeInt(transactionIsolation);
out.writeBoolean(noExec);
}
+
+ public RequestOptions getRequestOptions() {
+ if (this.requestOptions == null) {
+ this.requestOptions = new RequestOptions();
+ }
+ return this.requestOptions;
+ }
+ public void setRequestOptions(RequestOptions requestOptions) {
+ this.requestOptions = requestOptions;
+ }
+
}
Modified: trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -28,17 +28,7 @@
import java.math.BigDecimal;
import java.net.URL;
import java.nio.charset.Charset;
-import java.sql.Array;
-import java.sql.Blob;
-import java.sql.Clob;
-import java.sql.NClob;
-import java.sql.Ref;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.RowId;
-import java.sql.SQLException;
-import java.sql.SQLXML;
-import java.sql.Types;
+import java.sql.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
@@ -173,7 +163,7 @@
}
@Override
- public void submitExecute(String sql, StatementCallback callback) throws TeiidSQLException {
+ public void submitExecute(String sql, StatementCallback callback, RequestOptions options) throws TeiidSQLException {
String msg = JDBCPlugin.Util.getString("JDBC.Method_not_supported"); //$NON-NLS-1$
throw new TeiidSQLException(msg);
}
@@ -197,18 +187,19 @@
}
@Override
- public void submitExecute(StatementCallback callback) throws SQLException {
+ public void submitExecute(StatementCallback callback, RequestOptions options)
+ throws SQLException {
NonBlockingRowProcessor processor = new NonBlockingRowProcessor(this, callback);
- submitExecute(ResultsMode.EITHER).addCompletionListener(processor);
+ submitExecute(ResultsMode.EITHER, options).addCompletionListener(processor);
}
- public ResultsFuture<Boolean> submitExecute(ResultsMode mode) throws SQLException {
- return executeSql(new String[] {this.prepareSql}, false, mode, false);
+ public ResultsFuture<Boolean> submitExecute(ResultsMode mode, RequestOptions options) throws SQLException {
+ return executeSql(new String[] {this.prepareSql}, false, mode, false, options);
}
@Override
public boolean execute() throws SQLException {
- executeSql(new String[] {this.prepareSql}, false, ResultsMode.EITHER, true);
+ executeSql(new String[] {this.prepareSql}, false, ResultsMode.EITHER, true, null);
return hasResultSet();
}
@@ -218,7 +209,7 @@
return new int[0];
}
try{
- executeSql(new String[] {this.prepareSql}, true, ResultsMode.UPDATECOUNT, true);
+ executeSql(new String[] {this.prepareSql}, true, ResultsMode.UPDATECOUNT, true, null);
}finally{
batchParameterList.clear();
}
@@ -227,13 +218,13 @@
@Override
public ResultSet executeQuery() throws SQLException {
- executeSql(new String[] {this.prepareSql}, false, ResultsMode.RESULTSET, true);
+ executeSql(new String[] {this.prepareSql}, false, ResultsMode.RESULTSET, true, null);
return resultSet;
}
@Override
public int executeUpdate() throws SQLException {
- executeSql(new String[] {this.prepareSql}, false, ResultsMode.UPDATECOUNT, true);
+ executeSql(new String[] {this.prepareSql}, false, ResultsMode.UPDATECOUNT, true, null);
return this.updateCounts[0];
}
Added: trunk/client/src/main/java/org/teiid/jdbc/RequestOptions.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/RequestOptions.java (rev 0)
+++ trunk/client/src/main/java/org/teiid/jdbc/RequestOptions.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.jdbc;
+
+
+public class RequestOptions {
+
+ /**
+ * true indicates that the query should be re-executed upon completion, such that
+ * the current Executions and CommandContext are reused.
+ * Continuous queries must be forward-only and return a result set.
+ */
+ private boolean continuous;
+
+ public boolean isContinuous() {
+ return continuous;
+ }
+
+ public RequestOptions continuous(boolean isContinuous) {
+ this.continuous = isContinuous;
+ return this;
+ }
+
+ public void setContinuous(boolean continuous) {
+ this.continuous = continuous;
+ }
+
+}
Property changes on: trunk/client/src/main/java/org/teiid/jdbc/RequestOptions.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -28,18 +28,7 @@
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.SQLWarning;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.TimeZone;
-import java.util.TreeMap;
+import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -311,18 +300,18 @@
}
@Override
- public void submitExecute(String sql, StatementCallback callback) throws SQLException {
+ public void submitExecute(String sql, StatementCallback callback, RequestOptions options) throws SQLException {
NonBlockingRowProcessor processor = new NonBlockingRowProcessor(this, callback);
- submitExecute(sql).addCompletionListener(processor);
+ submitExecute(sql, options).addCompletionListener(processor);
}
- public ResultsFuture<Boolean> submitExecute(String sql) throws SQLException {
- return executeSql(new String[] {sql}, false, ResultsMode.EITHER, false);
+ public ResultsFuture<Boolean> submitExecute(String sql, RequestOptions options) throws SQLException {
+ return executeSql(new String[] {sql}, false, ResultsMode.EITHER, false, options);
}
@Override
public boolean execute(String sql) throws SQLException {
- executeSql(new String[] {sql}, false, ResultsMode.EITHER, true);
+ executeSql(new String[] {sql}, false, ResultsMode.EITHER, true, null);
return hasResultSet();
}
@@ -332,20 +321,20 @@
return new int[0];
}
String[] commands = batchedUpdates.toArray(new String[batchedUpdates.size()]);
- executeSql(commands, true, ResultsMode.UPDATECOUNT, true);
+ executeSql(commands, true, ResultsMode.UPDATECOUNT, true, null);
return updateCounts;
}
@Override
public ResultSet executeQuery(String sql) throws SQLException {
- executeSql(new String[] {sql}, false, ResultsMode.RESULTSET, true);
+ executeSql(new String[] {sql}, false, ResultsMode.RESULTSET, true, null);
return resultSet;
}
@Override
public int executeUpdate(String sql) throws SQLException {
String[] commands = new String[] {sql};
- executeSql(commands, false, ResultsMode.UPDATECOUNT, true);
+ executeSql(commands, false, ResultsMode.UPDATECOUNT, true, null);
return this.updateCounts[0];
}
@@ -405,10 +394,24 @@
}
@SuppressWarnings("unchecked")
- protected ResultsFuture<Boolean> executeSql(String[] commands, boolean isBatchedCommand, ResultsMode resultsMode, boolean synch)
+ protected ResultsFuture<Boolean> executeSql(String[] commands, boolean isBatchedCommand, ResultsMode resultsMode, boolean synch, RequestOptions options)
throws SQLException {
checkStatement();
resetExecutionState();
+ if (options != null) {
+ if (options.isContinuous()) {
+ if (this.getResultSetType() != ResultSet.TYPE_FORWARD_ONLY) {
+ String msg = JDBCPlugin.Util.getString("JDBC.forward_only_resultset"); //$NON-NLS-1$
+ throw new TeiidSQLException(msg);
+ }
+ if (resultsMode == ResultsMode.EITHER) {
+ resultsMode = ResultsMode.RESULTSET;
+ } else if (resultsMode == ResultsMode.UPDATECOUNT) {
+ String msg = JDBCPlugin.Util.getString("JDBC.forward_only_resultset"); //$NON-NLS-1$
+ throw new TeiidSQLException(msg);
+ }
+ }
+ }
if (logger.isLoggable(Level.FINER)) {
logger.finer("Executing: requestID " + getCurrentRequestID() + " commands: " + Arrays.toString(commands) + " expecting: " + resultsMode); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -535,6 +538,7 @@
}
final RequestMessage reqMessage = createRequestMessage(commands, isBatchedCommand, resultsMode);
+ reqMessage.setRequestOptions(options);
ResultsFuture<ResultsMessage> pendingResult = execute(reqMessage, synch);
final ResultsFuture<Boolean> result = new ResultsFuture<Boolean>();
pendingResult.addCompletionListener(new ResultsFuture.CompletionListener<ResultsMessage>() {
Modified: trunk/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -38,8 +38,9 @@
* Note that a single Statement may only have 1 asynch query executing at a time.
*
* @param callback
+ * @param options
* @throws SQLException
*/
- void submitExecute(StatementCallback callback) throws SQLException;
+ void submitExecute(StatementCallback callback, RequestOptions options) throws SQLException;
}
Modified: trunk/client/src/main/java/org/teiid/jdbc/TeiidStatement.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/TeiidStatement.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/client/src/main/java/org/teiid/jdbc/TeiidStatement.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -108,7 +108,8 @@
* Note that a single Statement may only have 1 asynch query executing at a time.
*
* @param callback
+ * @param options
* @throws SQLException
*/
- void submitExecute(String sql, StatementCallback callback) throws SQLException;
+ void submitExecute(String sql, StatementCallback callback, RequestOptions options) throws SQLException;
}
Modified: trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties
===================================================================
--- trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties 2011-12-07 20:42:04 UTC (rev 3724)
@@ -156,4 +156,6 @@
gss_auth_failed=GSS Authentication failed
setup_failed=Protocol error. Session setup failed.
client_prop_missing=Client URL connection property missing "{0}". Please add the property to connection URL.
-system_prop_missing=System property "{0}" missing, please add using -D option on the VM startup script.
\ No newline at end of file
+system_prop_missing=System property "{0}" missing, please add using -D option on the VM startup script.
+
+JDBC.forward_only_resultset=Continuous queries must be forward only and return a result set.
\ No newline at end of file
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -110,12 +110,12 @@
Properties p = new Properties();
Mockito.stub(conn.getExecutionProperties()).toReturn(p);
StatementImpl statement = new StatementImpl(conn, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
- statement.submitExecute("start transaction"); //$NON-NLS-1$
+ statement.submitExecute("start transaction", null); //$NON-NLS-1$
Mockito.verify(conn).setAutoCommit(false);
- statement.submitExecute("commit"); //$NON-NLS-1$
+ statement.submitExecute("commit", null); //$NON-NLS-1$
Mockito.verify(conn).submitSetAutoCommitTrue(true);
- statement.submitExecute("start transaction"); //$NON-NLS-1$
- statement.submitExecute("rollback"); //$NON-NLS-1$
+ statement.submitExecute("start transaction", null); //$NON-NLS-1$
+ statement.submitExecute("rollback", null); //$NON-NLS-1$
Mockito.verify(conn).submitSetAutoCommitTrue(false);
}
@@ -127,11 +127,11 @@
Mockito.stub(statement.getDQP()).toReturn(dqp);
ResultsFuture<ResultsMessage> future = new ResultsFuture<ResultsMessage>();
Mockito.stub(dqp.executeRequest(Mockito.anyLong(), (RequestMessage) Mockito.anyObject())).toReturn(future);
- statement.submitExecute("select 'hello world'");
+ statement.submitExecute("select 'hello world'", null);
Thread.sleep(300);
Mockito.verify(dqp).cancelRequest(0);
statement.setQueryTimeoutMS(1);
- statement.submitExecute("select 'hello world'");
+ statement.submitExecute("select 'hello world'", null);
Thread.sleep(300);
Mockito.verify(dqp, Mockito.times(2)).cancelRequest(0);
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -47,7 +47,7 @@
"Payload", //$NON-NLS-1$
"ConnectionID", //$NON-NLS-1$
"Connector", //$NON-NLS-1$
- "RequestID", //$NON-NLS-1$
+ 1,
"PartID", //$NON-NLS-1$
"ExecCount"); //$NON-NLS-1$
@@ -367,29 +367,29 @@
}
@Test public void testVisitIDeleteWithComment() throws Exception {
- String expected = "DELETE /*teiid sessionid:ConnectionID, requestid:RequestID.PartID*/ FROM g1 WHERE 100 >= 200 AND 500 < 600"; //$NON-NLS-1$
+ String expected = "DELETE /*teiid sessionid:ConnectionID, requestid:ConnectionID.1.PartID*/ FROM g1 WHERE 100 >= 200 AND 500 < 600"; //$NON-NLS-1$
assertEquals(expected, getStringWithContext(TestDeleteImpl.example()));
}
@Test public void testVisitIInsertWithComment() throws Exception {
- String expected = "INSERT /*teiid sessionid:ConnectionID, requestid:RequestID.PartID*/ INTO g1 (e1, e2, e3, e4) VALUES (1, 2, 3, 4)"; //$NON-NLS-1$
+ String expected = "INSERT /*teiid sessionid:ConnectionID, requestid:ConnectionID.1.PartID*/ INTO g1 (e1, e2, e3, e4) VALUES (1, 2, 3, 4)"; //$NON-NLS-1$
assertEquals(expected, getStringWithContext(TestInsertImpl.example("g1"))); //$NON-NLS-1$
}
@Test public void testVisitISelectWithComment() throws Exception {
- String expected = "SELECT /*teiid sessionid:ConnectionID, requestid:RequestID.PartID*/ g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE 100 >= 200 AND 500 < 600 GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING 100 >= 200 AND 500 < 600 ORDER BY g1.e1, g1.e2 DESC, g1.e3, g1.e4 DESC"; //$NON-NLS-1$
+ String expected = "SELECT /*teiid sessionid:ConnectionID, requestid:ConnectionID.1.PartID*/ g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE 100 >= 200 AND 500 < 600 GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING 100 >= 200 AND 500 < 600 ORDER BY g1.e1, g1.e2 DESC, g1.e3, g1.e4 DESC"; //$NON-NLS-1$
assertEquals(expected, getStringWithContext(TestQueryImpl.example(false)));
- expected = "SELECT /*teiid sessionid:ConnectionID, requestid:RequestID.PartID*/ DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE 100 >= 200 AND 500 < 600 GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING 100 >= 200 AND 500 < 600 ORDER BY g1.e1, g1.e2 DESC, g1.e3, g1.e4 DESC"; //$NON-NLS-1$
+ expected = "SELECT /*teiid sessionid:ConnectionID, requestid:ConnectionID.1.PartID*/ DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE 100 >= 200 AND 500 < 600 GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING 100 >= 200 AND 500 < 600 ORDER BY g1.e1, g1.e2 DESC, g1.e3, g1.e4 DESC"; //$NON-NLS-1$
assertEquals(expected, getStringWithContext(TestQueryImpl.example(true)));
}
@Test public void testVisitIUpdateWithComment() throws Exception {
- String expected = "UPDATE /*teiid sessionid:ConnectionID, requestid:RequestID.PartID*/ g1 SET e1 = 1, e2 = 1, e3 = 1, e4 = 1 WHERE 1 = 1"; //$NON-NLS-1$
+ String expected = "UPDATE /*teiid sessionid:ConnectionID, requestid:ConnectionID.1.PartID*/ g1 SET e1 = 1, e2 = 1, e3 = 1, e4 = 1 WHERE 1 = 1"; //$NON-NLS-1$
assertEquals(expected, getStringWithContext(TestUpdateImpl.example()));
}
@Test public void testVisitIProcedureWithComment() throws Exception {
- String expected = "{ /*teiid sessionid:ConnectionID, requestid:RequestID.PartID*/ call sq3(?,?)}"; //$NON-NLS-1$
+ String expected = "{ /*teiid sessionid:ConnectionID, requestid:ConnectionID.1.PartID*/ call sq3(?,?)}"; //$NON-NLS-1$
assertEquals(expected, getStringWithContext(TestProcedureImpl.example()));
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -22,14 +22,13 @@
package org.teiid.translator.jdbc;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import javax.xml.bind.JAXBException;
import javax.xml.stream.XMLStreamException;
import junit.framework.Assert;
@@ -42,8 +41,8 @@
import org.teiid.language.Command;
import org.teiid.metadata.FunctionMethod;
import org.teiid.query.function.metadata.FunctionMetadataReader;
-import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.TranslatorException;
public class TranslationHelper {
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -705,7 +705,7 @@
String output = "SELECT /*+ ALL_ROWS */ PARTS.PART_NAME, ROWNUM FROM PARTS"; //$NON-NLS-1$
String hint = "/*+ ALL_ROWS */"; //$NON-NLS-1$
- ExecutionContext context = new ExecutionContextImpl(null, 1, hint, null, "", null, null, null); //$NON-NLS-1$
+ ExecutionContext context = new ExecutionContextImpl(null, 1, hint, null, "", 1, null, null); //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
@@ -720,7 +720,7 @@
String output = "SELECT PARTS.PART_NAME, ROWNUM FROM PARTS"; //$NON-NLS-1$
String hint = "/*+ ALL_ROWS */ something else"; //$NON-NLS-1$
- ExecutionContext context = new ExecutionContextImpl(null, 1, hint, null, "", null, null, null); //$NON-NLS-1$
+ ExecutionContext context = new ExecutionContextImpl(null, 1, hint, null, "", 1, null, null); //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
Modified: trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml
===================================================================
--- trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml 2011-12-07 20:42:04 UTC (rev 3724)
@@ -389,7 +389,7 @@
</section>
</section>
- <section>
+ <section id="non_blocking">
<title>Non-blocking Statement Execution</title>
<para>JDBC query execution can indefinitely block the calling thread when a statement is executed or a resultset is being iterated.
In some situations you may wish to have your calling threads held in these blocked states. When using embedded connections, you may optionally use the
@@ -416,10 +416,22 @@
@Override
public void onComplete(Statement s) throws Exception {
s.close();
- }
+ }, new RequestOptions()
);</programlisting>
</example>
<note><para>The non-blocking logic is limited to statement execution only. Other JDBC operations, such as connection creation or batched executions do not yet have non-blocking options.</para></note>
+
+ <section>
+ <title>Continous Execution</title>
+ <para>The <code>RequestOptions</code> object may be used to specify a special type of continuous asynch execution via the <code>continuous</code> or <code>setContinuous</code> methods.
+ In continuous mode the statement will be continously re-executed. This is intended for consuming real-time or other data streams processed through a SQL plan.
+ A continuous query will only terminate on an error or when the statement is explicitly closed. The SQL for a continuous query is no different than any other statement.
+ Care should be taken to ensure that retrivals from non-continuous sources is appropriately cached for reuse, such as by using materialized views or session scoped temp tables.
+ A continous query must return a result set, must be executed with a forward-only resultset, and cannot be used in the scope of a transaction. Since resource consumptions is expected to be
+ different in a continuous plan, it does not count against the server max active plan limit.
+ Typically custom sources will be used to provide data streams. See the Developer's Guide, in particular the section on ReusableExecutions for more.</para>
+ </section>
+
</section>
</chapter>
\ No newline at end of file
Modified: trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
===================================================================
--- trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2011-12-07 20:42:04 UTC (rev 3724)
@@ -306,31 +306,61 @@
be retrieved via the getOutputParameterValues() method.
</para>
</section>
-
- <section>
+
+ <section id="asynchronous_executions">
<title>Asynchronous Executions</title>
- <para>
- In some scenarios, a translator needs to execute
- asynchronously and allow the executing thread to perform other work. To allow this, you should Throw a
- <code>DataNotAvailableExecption</code>
- during a retrival method, rather than explicitly waiting or sleeping for the results.
- <note>
- <para>
- A <code>DataNotAvailableException</code> should not be thrown by the execute method. The
- <code>DataNotAvailableException</code> may take a delay parameter in its
- constructor to indicate how long the system should wait befor polling
- for results. Any non-negative value indicates a time until the next polling should be performed.
- The
- <code>DataNotAvailableException.NO_POLLING</code>
- exception (or any DataNotAvailableException with a negative delay) can be thrown to indicate that
- the execution will call <code>ExecutionContext.dataAvailable()</code> to indicate processing should resume.
- </para>
- </note>
- </para>
- <note>
- <para>Since the exection and the associated connection are not closed until the work has completed, care should be taken if using asynchronous executions that hold a lot of state.</para>
- </note>
+ <para>
+ In some scenarios, a translator needs to execute
+ asynchronously and allow the executing thread to perform other work. To allow this,
+ you should Throw a <code>DataNotAvailableExecption</code>
+ during a retrival method, rather than explicitly waiting or sleeping
+ for the results.
+ <note>
+ <para>
+ A <code>DataNotAvailableException</code>
+ should not be thrown by the execute method. The
+ <code>DataNotAvailableException</code>
+ may take a delay parameter in its
+ constructor to indicate how long the system should wait befor polling
+ for results. Any non-negative value indicates a time until the next
+ polling should be performed.
+ The <code>DataNotAvailableException.NO_POLLING</code>
+ exception (or any DataNotAvailableException with a negative delay)
+ can be thrown to indicate that
+ the execution will call
+ <code>ExecutionContext.dataAvailable()</code>
+ to indicate processing should resume.
+ </para>
+ </note>
+ </para>
+ <note>
+ <para>Since the exection and the associated connection are not closed
+ until the work has completed, care should be taken if using
+ asynchronous executions that hold a lot of state.</para>
+ </note>
</section>
+
+ <section>
+ <title>Reusable Executions</title>
+ <para>
+ A translator may return instances of <code>ReusableExecution</code>s for the expected <code>Execution</code> objects.
+ There can be one <code>ReusableExecution</code> per query execting node in the processing plan.
+ The lifecycle of a <code>ReusableExecution</code> is different that a normal <code>Execution</code>.
+ After a normal creation/execute/close cycle the <code>ReusableExecution.reset</code> is called for another execution cycle.
+ This may occur indefinitely dependin on how many times a processing node executes its query.
+ The behavior of the <code>close</code> is no different than a regular <code>Execution</code>,
+ that is it may not be called until the end of the statement if lobs are detected and any connection associated with the
+ <code>Execution</code> will also be closed. When the user command is finished, the <code>ReusableExecution.dispose()</code>
+ method will be called.
+ </para>
+ <para>
+ In general <code>ReusableExecution</code>s are most useful for continuous query execution and will also be implemented using the
+ <code>ExecutionCotext.dataAvailable()</code> method for <xref linkend="asynchronous_executions"/>.
+ See the Client Developer's Guide for executing continuous statements. In continuous mode the user query will be continously re-executed.
+ A ReusableExecution allows the same Execution object to be associated with the processing plan for a given processing node for the lifetime
+ of the user query. This can simplify asynch resource management, such as establishing queue listeners.
+ </para>
+ </section>
<section>
<title>Bulk Execution</title>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2011-12-07 20:42:04 UTC (rev 3724)
@@ -1875,9 +1875,7 @@
<title>ENV</title>
<para>Retrieve a system environment property.</para>
<para><synopsis>ENV(key)</synopsis></para>
- <para>The only key specific to the current session is 'sessionid'.
- However the preferred mechanism for getting the session id is with the session_id() function.
- To prevent untrusted access to system properties, this function is not enabled by default. The ENV function may be enabled via the allowEnvFunction property in the &teiid-beans; file.</para>
+ <para>To prevent untrusted access to system properties, this function is not enabled by default. The ENV function may be enabled via the allowEnvFunction property in the &teiid-deployer-beans; file.</para>
<para>key, return value are strings</para>
</section>
<section>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -20,10 +20,6 @@
* 02110-1301 USA.
*/
-/*
- * Date: Aug 25, 2003
- * Time: 3:53:37 PM
- */
package org.teiid.dqp.internal.datamgr;
import java.util.Arrays;
@@ -40,10 +36,10 @@
import org.teiid.dqp.message.AtomicRequestID;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.logging.CommandLogMessage;
-import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
+import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.metadata.Datatype;
import org.teiid.metadata.FunctionMethod;
import org.teiid.metadata.MetadataFactory;
@@ -51,7 +47,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
-import org.teiid.query.optimizer.capabilities.SourceCapabilities.Scope;
import org.teiid.query.sql.lang.Command;
import org.teiid.resource.spi.WrappedConnection;
import org.teiid.translator.ExecutionContext;
@@ -60,7 +55,7 @@
/**
- * The <code>ConnectorManager</code> manages a {@link org.teiid.translator.BasicExecutionFactory Connector}
+ * The <code>ConnectorManager</code> manages an {@link ExecutionFactory}
* and its associated workers' state.
*/
public class ConnectorManager {
@@ -69,7 +64,6 @@
private String translatorName;
private String connectionName;
- private String modelName;
// known requests
private ConcurrentHashMap<AtomicRequestID, ConnectorWorkItem> requestStates = new ConcurrentHashMap<AtomicRequestID, ConnectorWorkItem>();
@@ -143,7 +137,6 @@
checkStatus();
ExecutionFactory<Object, Object> translator = getExecutionFactory();
BasicSourceCapabilities resultCaps = CapabilitiesConverter.convertCapabilities(translator, Arrays.asList(translatorName, connectionName));
- resultCaps.setScope(Scope.SCOPE_GLOBAL);
cachedCapabilities = resultCaps;
return resultCaps;
}
@@ -166,9 +159,9 @@
* Remove the state associated with
* the given <code>RequestID</code>.
*/
- void removeState(AtomicRequestID id) {
+ boolean removeState(AtomicRequestID id) {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {id, "Remove State"}); //$NON-NLS-1$
- requestStates.remove(id);
+ return requestStates.remove(id) != null;
}
int size() {
@@ -282,11 +275,4 @@
return this.connectionName;
}
- public void setModelName(String modelName) {
- this.modelName = modelName;
- }
-
- public String getModelName() {
- return this.modelName;
- }
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -30,7 +30,6 @@
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.client.ResizingArrayList;
-import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.util.Assertion;
import org.teiid.dqp.internal.process.RequestWorkItem;
@@ -38,7 +37,6 @@
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.AtomicResultsMessage;
import org.teiid.language.Call;
-import org.teiid.language.QueryExpression;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.CommandLogMessage.Event;
@@ -48,6 +46,7 @@
import org.teiid.query.metadata.TempMetadataAdapter;
import org.teiid.query.metadata.TempMetadataStore;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.lang.QueryCommand;
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.resource.spi.WrappedConnection;
import org.teiid.translator.DataNotAvailableException;
@@ -55,10 +54,10 @@
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.ResultSetExecution;
+import org.teiid.translator.ReusableExecution;
import org.teiid.translator.TranslatorException;
import org.teiid.translator.UpdateExecution;
-
public class ConnectorWorkItem implements ConnectorWork {
/* Permanent state members */
@@ -74,7 +73,6 @@
private ExecutionContextImpl securityContext;
private volatile ResultSetExecution execution;
private ProcedureBatchHandler procedureBatchHandler;
- private org.teiid.language.Command translatedCommand;
private int expectedColumns;
/* End state information */
@@ -89,18 +87,13 @@
this.requestMsg = message;
this.manager = manager;
AtomicRequestID requestID = this.requestMsg.getAtomicRequestID();
- this.securityContext = new ExecutionContextImpl(requestMsg.getWorkContext().getVdbName(),
- requestMsg.getWorkContext().getVdbVersion(),
- requestMsg.getExecutionPayload(),
- requestMsg.getWorkContext().getSessionId(),
+ this.securityContext = new ExecutionContextImpl(message.getCommandContext(),
requestMsg.getConnectorName(),
- requestMsg.getRequestID().toString(),
Integer.toString(requestID.getNodeID()),
Integer.toString(requestID.getExecutionId())
);
this.securityContext.setGeneralHint(message.getGeneralHint());
this.securityContext.setHint(message.getHint());
- this.securityContext.setUser(requestMsg.getWorkContext().getSubject());
this.securityContext.setBatchSize(this.requestMsg.getFetchSize());
this.securityContext.setSession(requestMsg.getWorkContext().getSession());
@@ -146,6 +139,9 @@
public void close() {
this.securityContext.setRequestWorkItem(null);
+ if (!manager.removeState(this.id)) {
+ return; //already closed
+ }
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id, "Processing Close :", this.requestMsg.getCommand()}); //$NON-NLS-1$
if (!error) {
manager.logSRCCommand(this.requestMsg, this.securityContext, Event.END, this.rowCount);
@@ -162,8 +158,6 @@
this.connector.closeConnection(connection, connectionFactory);
} catch (Throwable e) {
LogManager.logError(LogConstants.CTX_CONNECTOR, e, e.getMessage());
- } finally {
- manager.removeState(this.id);
}
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id, "Closed connection"}); //$NON-NLS-1$
}
@@ -196,7 +190,7 @@
return new TranslatorException(t);
}
- public AtomicResultsMessage execute() throws TranslatorException, BlockedException {
+ public AtomicResultsMessage execute() throws TranslatorException {
if(isCancelled()) {
throw new TranslatorException("Request canceled"); //$NON-NLS-1$
}
@@ -214,56 +208,25 @@
throw new TranslatorException(QueryPlugin.Util.getString("failed_to_unwrap_connection")); //$NON-NLS-1$
}
}
-
+
// Translate the command
Command command = this.requestMsg.getCommand();
this.expectedColumns = command.getProjectedSymbols().size();
LanguageBridgeFactory factory = new LanguageBridgeFactory(queryMetadata);
- this.translatedCommand = factory.translate(command);
-
- RuntimeMetadata rmd = new RuntimeMetadataImpl(queryMetadata);
-
- // Create the execution based on mode
- final Execution exec = connector.createExecution(this.translatedCommand, this.securityContext, rmd, (unwrapped == null) ? this.connection:unwrapped);
- if (this.translatedCommand instanceof Call) {
- this.execution = Assertion.isInstanceOf(exec, ProcedureExecution.class, "Call Executions are expected to be ProcedureExecutions"); //$NON-NLS-1$
- StoredProcedure proc = (StoredProcedure)command;
- if (proc.returnParameters()) {
- this.procedureBatchHandler = new ProcedureBatchHandler((Call)this.translatedCommand, (ProcedureExecution)exec);
- }
- } else if (this.translatedCommand instanceof QueryExpression){
- this.execution = Assertion.isInstanceOf(exec, ResultSetExecution.class, "QueryExpression Executions are expected to be ResultSetExecutions"); //$NON-NLS-1$
- } else {
- Assertion.isInstanceOf(exec, UpdateExecution.class, "Update Executions are expected to be UpdateExecutions"); //$NON-NLS-1$
- this.execution = new ResultSetExecution() {
- private int[] results;
- private int index;
-
- @Override
- public void cancel() throws TranslatorException {
- exec.cancel();
- }
- @Override
- public void close() {
- exec.close();
- }
- @Override
- public void execute() throws TranslatorException {
- exec.execute();
- }
- @Override
- public List<?> next() throws TranslatorException,
- DataNotAvailableException {
- if (results == null) {
- results = ((UpdateExecution)exec).getUpdateCounts();
- }
- if (index < results.length) {
- return Arrays.asList(results[index++]);
- }
- return null;
- }
- };
- }
+ org.teiid.language.Command translatedCommand = factory.translate(command);
+
+ Execution exec = this.requestMsg.getCommandContext().getReusableExecution(this.securityContext.getPartIdentifier());
+ if (exec != null) {
+ ((ReusableExecution)exec).reset(translatedCommand, this.securityContext, connection);
+ } else {
+ RuntimeMetadata rmd = new RuntimeMetadataImpl(queryMetadata);
+ exec = connector.createExecution(translatedCommand, this.securityContext, rmd, (unwrapped == null) ? this.connection:unwrapped);
+ if (exec instanceof ReusableExecution<?>) {
+ this.requestMsg.getCommandContext().putReusableExecution(this.securityContext.getPartIdentifier(), (ReusableExecution<?>) exec);
+ }
+ }
+ setExecution(command, translatedCommand, exec);
+
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.requestMsg.getAtomicRequestID(), "Obtained execution"}); //$NON-NLS-1$
//Log the Source Command (Must be after obtaining the execution context)
manager.logSRCCommand(this.requestMsg, this.securityContext, Event.NEW, null);
@@ -277,6 +240,49 @@
throw handleError(t);
}
}
+
+ private void setExecution(Command command,
+ org.teiid.language.Command translatedCommand, final Execution exec) {
+ if (translatedCommand instanceof Call) {
+ this.execution = Assertion.isInstanceOf(exec, ProcedureExecution.class, "Call Executions are expected to be ProcedureExecutions"); //$NON-NLS-1$
+ StoredProcedure proc = (StoredProcedure)command;
+ if (proc.returnParameters()) {
+ this.procedureBatchHandler = new ProcedureBatchHandler((Call)translatedCommand, (ProcedureExecution)exec);
+ }
+ } else if (command instanceof QueryCommand){
+ this.execution = Assertion.isInstanceOf(exec, ResultSetExecution.class, "QueryExpression Executions are expected to be ResultSetExecutions"); //$NON-NLS-1$
+ } else {
+ Assertion.isInstanceOf(exec, UpdateExecution.class, "Update Executions are expected to be UpdateExecutions"); //$NON-NLS-1$
+ this.execution = new ResultSetExecution() {
+ private int[] results;
+ private int index;
+
+ @Override
+ public void cancel() throws TranslatorException {
+ exec.cancel();
+ }
+ @Override
+ public void close() {
+ exec.close();
+ }
+ @Override
+ public void execute() throws TranslatorException {
+ exec.execute();
+ }
+ @Override
+ public List<?> next() throws TranslatorException,
+ DataNotAvailableException {
+ if (results == null) {
+ results = ((UpdateExecution)exec).getUpdateCounts();
+ }
+ if (index < results.length) {
+ return Arrays.asList(results[index++]);
+ }
+ return null;
+ }
+ };
+ }
+ }
protected AtomicResultsMessage handleBatch() throws TranslatorException {
Assertion.assertTrue(!this.lastBatch);
@@ -354,7 +360,7 @@
return response;
}
- public static AtomicResultsMessage createResultsMessage(List[] batch) {
+ public static AtomicResultsMessage createResultsMessage(List<?>[] batch) {
return new AtomicResultsMessage(batch);
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -23,6 +23,7 @@
package org.teiid.dqp.internal.datamgr;
import java.io.Serializable;
+import java.lang.ref.WeakReference;
import java.security.Principal;
import java.util.ArrayList;
import java.util.LinkedList;
@@ -34,29 +35,18 @@
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.util.HashCodeUtil;
import org.teiid.dqp.internal.process.RequestWorkItem;
+import org.teiid.dqp.message.RequestID;
+import org.teiid.query.util.CommandContext;
import org.teiid.translator.ExecutionContext;
/**
*/
public class ExecutionContextImpl implements ExecutionContext {
-
- // Orginal request non-atomic request id
- private String requestID;
// Access Node ID
private String partID;
// currentConnector ID
private String connectorName;
- // current VDB
- private String vdbName;
- // Current VDB's version
- private int vdbVersion;
- // User Name
- private Subject user;
- // Payload setup on the Statement object
- private Serializable executionPayload;
- // ID of the parent JDBC Connection which is executing the statement
- private String requestConnectionID;
// Execute count of the query
private String executeCount;
// keep the execution object alive during the processing. default:false
@@ -67,31 +57,44 @@
private int batchSize = BufferManager.DEFAULT_CONNECTOR_BATCH_SIZE;
private List<Exception> warnings = new LinkedList<Exception>();
private Session session;
- private RequestWorkItem worktItem;
+ private WeakReference<RequestWorkItem> worktItem;
private boolean dataAvailable;
private String generalHint;
private String hint;
+ private CommandContext commandContext;
+
+ public ExecutionContextImpl(String vdbName, int vdbVersion, Serializable executionPayload,
+ String originalConnectionID, String connectorName, long requestId, String partId, String execCount) {
+ commandContext = new CommandContext();
+ commandContext.setVdbName(vdbName);
+ commandContext.setVdbVersion(vdbVersion);
+ commandContext.setCommandPayload(executionPayload);
+ commandContext.setConnectionID(originalConnectionID);
+ commandContext.setRequestId(new RequestID(originalConnectionID, requestId));
+ this.connectorName = connectorName;
+ this.partID = partId;
+ this.executeCount = execCount;
+ }
- public ExecutionContextImpl(String vdbName, int vdbVersion, Serializable executionPayload,
- String originalConnectionID, String connectorName, String requestId, String partId, String execCount) {
-
- this.vdbName = vdbName;
- this.vdbVersion = vdbVersion;
- this.executionPayload = executionPayload;
+ public ExecutionContextImpl(CommandContext commandContext, String connectorName, String partId, String execCount) {
this.connectorName = connectorName;
- this.requestID = requestId;
this.partID = partId;
- this.requestConnectionID = originalConnectionID;
this.executeCount = execCount;
+ this.commandContext = commandContext;
}
+ @Override
+ public org.teiid.CommandContext getCommandContext() {
+ return this.commandContext;
+ }
+
public String getConnectorIdentifier() {
return this.connectorName;
}
@Override
public String getRequestIdentifier() {
- return this.requestID;
+ return this.commandContext.getRequestId();
}
@Override
@@ -105,29 +108,25 @@
}
@Override
public String getVirtualDatabaseName() {
- return this.vdbName;
+ return this.commandContext.getVdbName();
}
@Override
public int getVirtualDatabaseVersion() {
- return this.vdbVersion;
+ return this.commandContext.getVdbVersion();
}
@Override
public Subject getSubject() {
- return this.user;
+ return this.commandContext.getSubject();
}
- public void setUser(Subject user) {
- this.user = user;
- }
-
@Override
public Serializable getExecutionPayload() {
- return executionPayload;
+ return this.commandContext.getCommandPayload();
}
@Override
public String getConnectionIdentifier() {
- return requestConnectionID;
+ return this.commandContext.getConnectionID();
}
@Override
public void keepExecutionAlive(boolean alive) {
@@ -164,17 +163,17 @@
}
public int hashCode() {
- return HashCodeUtil.hashCode(HashCodeUtil.hashCode(0, requestID), partID);
+ return HashCodeUtil.hashCode(HashCodeUtil.hashCode(0, getRequestIdentifier()), partID);
}
public String toString() {
String userName = null;
- if (this.user != null) {
- for(Principal p:this.user.getPrincipals()) {
+ if (this.getSubject() != null) {
+ for(Principal p:this.getSubject().getPrincipals()) {
userName = p.getName();
}
}
- return "ExecutionContext<vdb=" + this.vdbName + ", version=" + this.vdbVersion + ", user=" + userName + ">"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ return "ExecutionContext<vdb=" + this.getVirtualDatabaseName() + ", version=" + this.getVirtualDatabaseVersion() + ", user=" + userName + ">"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
@Override
@@ -222,12 +221,12 @@
}
public void setRequestWorkItem(RequestWorkItem item) {
- this.worktItem = item;
+ this.worktItem = new WeakReference<RequestWorkItem>(item);
}
@Override
public synchronized void dataAvailable() {
- RequestWorkItem requestWorkItem = this.worktItem;
+ RequestWorkItem requestWorkItem = this.worktItem.get();
dataAvailable = true;
if (requestWorkItem != null) {
requestWorkItem.moreWork();
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ProcedureBatchHandler.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ProcedureBatchHandler.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ProcedureBatchHandler.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -43,7 +43,7 @@
private ProcedureExecution procExec;
private int paramCols = 0;
private int resultSetCols = 0;
- private List filler;
+ private List<?> filler;
public ProcedureBatchHandler(Call proc, ProcedureExecution procExec) {
this.proc = proc;
@@ -65,20 +65,20 @@
}
}
- List padRow(List row) throws TranslatorException {
+ List<?> padRow(List<?> row) throws TranslatorException {
if (row.size() != resultSetCols) {
throw new TranslatorException(QueryPlugin.Util.getString("ConnectorWorker.ConnectorWorker_result_set_unexpected_columns", new Object[] {proc, new Integer(resultSetCols), new Integer(row.size())})); //$NON-NLS-1$
}
if (paramCols == 0) {
return row;
}
- List result = new ArrayList(resultSetCols + paramCols);
+ List<Object> result = new ArrayList<Object>(resultSetCols + paramCols);
result.addAll(row);
result.addAll(filler);
return result;
}
- List getParameterRow() throws TranslatorException {
+ List<?> getParameterRow() throws TranslatorException {
if (paramCols == 0) {
return null;
}
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-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -67,15 +67,15 @@
import org.teiid.dqp.message.RequestID;
import org.teiid.dqp.service.BufferService;
import org.teiid.dqp.service.TransactionContext;
+import org.teiid.dqp.service.TransactionService;
import org.teiid.dqp.service.TransactionContext.Scope;
-import org.teiid.dqp.service.TransactionService;
import org.teiid.events.EventDistributor;
import org.teiid.jdbc.EnhancedTimer;
import org.teiid.logging.CommandLogMessage;
-import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
+import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.metadata.MetadataRepository;
import org.teiid.query.QueryPlugin;
import org.teiid.query.tempdata.TempTableDataManager;
@@ -401,11 +401,14 @@
}
private void startActivePlan(RequestWorkItem workItem, boolean addToQueue) {
- workItem.active = true;
+ boolean continuous = workItem.requestMsg.getRequestOptions().isContinuous();
+ workItem.active = !continuous;
if (addToQueue) {
this.addWork(workItem);
}
- this.currentlyActivePlans++;
+ if (!continuous) {
+ this.currentlyActivePlans++;
+ }
}
void finishProcessing(final RequestWorkItem workItem) {
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-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -181,6 +181,7 @@
}
AtomicRequestMessage aqr = createRequest(context.getProcessorID(), command, modelName, connectorBindingId, nodeID);
+ aqr.setCommandContext(context);
SourceHint sh = context.getSourceHint();
if (sh != null) {
aqr.setGeneralHint(sh.getGeneralHint());
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-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -26,7 +26,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.Properties;
import java.util.Set;
import java.util.concurrent.Executor;
@@ -87,7 +86,6 @@
import org.teiid.query.tempdata.GlobalTableStore;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ContextProperties;
import org.teiid.query.validator.AbstractValidationVisitor;
import org.teiid.query.validator.ValidationVisitor;
import org.teiid.query.validator.Validator;
@@ -221,9 +219,6 @@
RequestID reqID = workContext.getRequestID(this.requestMsg.getExecutionId());
- Properties props = new Properties();
- props.setProperty(ContextProperties.SESSION_ID, workContext.getSessionId());
-
this.context =
new CommandContext(
reqID,
@@ -232,7 +227,6 @@
requestMsg.getExecutionPayload(),
workContext.getVdbName(),
workContext.getVdbVersion(),
- props,
this.requestMsg.getShowPlan() != ShowPlan.OFF);
this.context.setProcessorBatchSize(bufferManager.getProcessorBatchSize());
this.context.setGlobalTableStore(this.globalTables);
@@ -367,6 +361,7 @@
tc.setIsolationLevel(requestMsg.getTransactionIsolation());
this.transactionContext = tc;
this.processor = new QueryProcessor(processPlan, context, bufferManager, processorDataManager);
+ this.processor.setContinuous(this.requestMsg.getRequestOptions().isContinuous());
}
/**
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-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -77,6 +77,7 @@
import org.teiid.query.sql.lang.SPParameter;
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.symbol.SingleElementSymbol;
+import org.teiid.query.util.CommandContext;
public class RequestWorkItem extends AbstractWorkItem implements PrioritizedRunnable {
@@ -275,7 +276,7 @@
state = ProcessingState.PROCESSING;
processNew();
if (isCanceled) {
- this.processingException = new TeiidProcessingException(SQLStates.QUERY_CANCELED, QueryPlugin.Util.getString("QueryProcessor.request_cancelled", this.requestID)); //$NON-NLS-1$
+ setCanceledException();
state = ProcessingState.CLOSE;
}
}
@@ -317,6 +318,10 @@
}
}
+ private void setCanceledException() {
+ this.processingException = new TeiidProcessingException(SQLStates.QUERY_CANCELED, QueryPlugin.Util.getString("QueryProcessor.request_cancelled", this.requestID)); //$NON-NLS-1$
+ }
+
private void handleThrowable(Throwable e) {
LogManager.logDetail(LogConstants.CTX_DQP, e, "Request Thread", requestID, "- error occurred"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -424,6 +429,9 @@
for (DataTierTupleSource connectorRequest : getConnectorRequests()) {
connectorRequest.fullyCloseSource();
}
+
+ CommandContext cc = this.processor.getContext();
+ cc.close();
}
this.resultsBuffer = null;
@@ -451,6 +459,13 @@
suspend();
}
}
+
+ synchronized (this) {
+ if (this.processingException == null && this.resultsReceiver != null) {
+ //sanity check to ensure that something will be sent to the client
+ setCanceledException();
+ }
+ }
} catch (Throwable t) {
handleThrowable(t);
} finally {
@@ -478,7 +493,7 @@
boolean cachable = false;
CacheID cacheId = null;
- boolean canUseCached = (requestMsg.useResultSetCache() ||
+ boolean canUseCached = !requestMsg.getRequestOptions().isContinuous() && (requestMsg.useResultSetCache() ||
QueryParser.getQueryParser().parseCacheHint(requestMsg.getCommandString()) != null);
if (rsCache != null) {
@@ -554,6 +569,9 @@
analysisRecord = request.analysisRecord;
transactionContext = request.transactionContext;
if (this.transactionContext != null && this.transactionContext.getTransactionType() != Scope.NONE) {
+ if (this.requestMsg.getRequestOptions().isContinuous()) {
+ throw new IllegalStateException("Continuous requests are not allowed to be transactional."); //$NON-NLS-1$
+ }
this.transactionState = TransactionState.ACTIVE;
}
if (requestMsg.isNoExec()) {
@@ -562,6 +580,9 @@
this.cid = null;
}
this.returnsUpdateCount = request.returnsUpdateCount;
+ if (this.returnsUpdateCount && this.requestMsg.getRequestOptions().isContinuous()) {
+ throw new IllegalStateException("Continuous requests are not allowed to be updates."); //$NON-NLS-1$
+ }
request = null;
}
@@ -633,7 +654,7 @@
} else if (!fromBuffer){
result = !isForwardOnly();
}
- int finalRowCount = this.resultsBuffer.isFinal()?this.resultsBuffer.getRowCount():(batch.getTerminationFlag()?batch.getEndRow():-1);
+ int finalRowCount = (this.resultsBuffer.isFinal()&&!this.requestMsg.getRequestOptions().isContinuous())?this.resultsBuffer.getRowCount():(batch.getTerminationFlag()?batch.getEndRow():-1);
response = createResultsMessage(batch.getTuples(), this.originalCommand.getProjectedSymbols());
response.setFirstRow(batch.getBeginRow());
Modified: trunk/engine/src/main/java/org/teiid/dqp/message/AtomicRequestMessage.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/message/AtomicRequestMessage.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/dqp/message/AtomicRequestMessage.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -24,7 +24,6 @@
*/
package org.teiid.dqp.message;
-import java.io.Serializable;
import java.util.concurrent.atomic.AtomicInteger;
import org.teiid.client.RequestMessage;
@@ -33,13 +32,14 @@
import org.teiid.dqp.service.TransactionContext;
import org.teiid.dqp.service.TransactionContext.Scope;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.util.CommandContext;
/**
* This class defines a request message for the Connector layer. This is uniquely identified
* by AtomicRequestID.
*/
-public class AtomicRequestMessage implements Serializable {
+public class AtomicRequestMessage {
static final long serialVersionUID = -4060941593023225562L;
/**
@@ -76,7 +76,6 @@
private boolean partialResultsFlag;
private RequestID requestID;
- private Serializable executionPayload;
private boolean exceptionOnMaxRows;
private int maxRows;
@@ -86,13 +85,9 @@
private DQPWorkContext workContext;
private String generalHint;
private String hint;
+ private CommandContext commandContext;
- public AtomicRequestMessage() {
- // This is only to honor the externalizable interface..
- }
-
public AtomicRequestMessage(RequestMessage requestMessage, DQPWorkContext parent, int nodeId){
- this.executionPayload = requestMessage.getExecutionPayload();
this.workContext = parent;
this.requestID = new RequestID(parent.getSessionId(), requestMessage.getExecutionId());
this.atomicRequestId = new AtomicRequestID(this.requestID, nodeId, EXECUTION_COUNT.getAndIncrement());
@@ -193,14 +188,6 @@
return atomicRequestId.toString();
}
- public void setExecutionPayload(Serializable executionPayload) {
- this.executionPayload = executionPayload;
- }
-
- public Serializable getExecutionPayload() {
- return executionPayload;
- }
-
public void setRequestID(RequestID requestID) {
this.requestID = requestID;
}
@@ -232,5 +219,13 @@
public void setHint(String hint) {
this.hint = hint;
}
+
+ public CommandContext getCommandContext() {
+ return commandContext;
+ }
+
+ public void setCommandContext(CommandContext commandContext) {
+ this.commandContext = commandContext;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -1266,13 +1266,9 @@
}
// ================= Function - ENV ========================
- public static Object env(CommandContext context, String propertyName) {
+ public static Object env(String propertyName) {
// All context property keys must be lowercase - we lowercase the incoming key here to match regardless of case
String propertyNameNocase = propertyName.toLowerCase();
- Properties envProps = context.getEnvironmentProperties();
- if(envProps != null && envProps.containsKey(propertyNameNocase)) {
- return envProps.getProperty(propertyNameNocase);
- }
String value = System.getProperty(propertyName);
if (value == null) {
value = System.getProperty(propertyNameNocase);
Modified: trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataReader.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataReader.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataReader.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -1,7 +1,11 @@
package org.teiid.query.function.metadata;
import java.io.InputStream;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@@ -31,7 +35,6 @@
XMLStreamReader reader = inputFactory.createXMLStreamReader(content);
FunctionMetadataReader fmr = new FunctionMetadataReader();
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
- System.out.println(reader.getLocalName());
switch (Namespace.forUri(reader.getNamespaceURI())) {
case XMI: {
Element element = Element.forName(reader.getLocalName());
Modified: trunk/engine/src/main/java/org/teiid/query/function/source/SystemSource.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/source/SystemSource.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/query/function/source/SystemSource.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -840,7 +840,7 @@
new FunctionParameter[] {
new FunctionParameter("variablename", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.Env_varname")) //$NON-NLS-1$ //$NON-NLS-2$
},
- new FunctionParameter("result", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.Env_result")), false, Determinism.SESSION_DETERMINISTIC ) ); //$NON-NLS-1$ //$NON-NLS-2$
+ new FunctionParameter("result", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.Env_result")), false, Determinism.DETERMINISTIC ) ); //$NON-NLS-1$ //$NON-NLS-2$
}
private void addSessionIdFunction() {
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -37,7 +37,6 @@
private static final long serialVersionUID = -1779069588746365579L;
- private Scope scope = Scope.SCOPE_GLOBAL;
private Map<Capability, Boolean> capabilityMap = new HashMap<Capability, Boolean>();
private Map<String, Boolean> functionMap = new TreeMap<String, Boolean>(String.CASE_INSENSITIVE_ORDER);
private Map<Capability, Object> propertyMap = new HashMap<Capability, Object>();
@@ -82,16 +81,8 @@
functionMap.put(function, Boolean.valueOf(supports));
}
- public Scope getScope() {
- return this.scope;
- }
-
- public void setScope(Scope scope) {
- this.scope = scope;
- }
-
public String toString() {
- return "BasicSourceCapabilities<"+scope+", caps=" + capabilityMap + ", funcs=" + functionMap + ">"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ return "BasicSourceCapabilities<caps=" + capabilityMap + ", funcs=" + functionMap + ">"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
/**
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/SourceCapabilities.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -349,23 +349,7 @@
}
- public enum Scope {
- /**
- * A legal value for the {@link #SCOPE} property.
- */
- SCOPE_GLOBAL,
- /**
- * A legal value for the {@link #SCOPE} property.
- */
- SCOPE_PER_USER
- }
-
/**
- * Determine the scope of these capabilities.
- */
- Scope getScope();
-
- /**
* Returns true if the capability is supported. The capability constants are all defined in this interface with the meaning of
* supporting that capability.
*
Modified: trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -68,6 +68,8 @@
private volatile boolean requestCanceled;
private static final int DEFAULT_WAIT = 50;
private boolean processorClosed;
+ private boolean continuous;
+ private int rowOffset = 1;
/**
* Construct a processor with all necessary information to process.
@@ -137,7 +139,19 @@
throw new TeiidProcessingException("Query timed out"); //$NON-NLS-1$
}
result = processPlan.nextBatch();
-
+
+ if (continuous) {
+ result.setRowOffset(rowOffset);
+ rowOffset = result.getEndRow() + 1;
+
+ if (result.getTerminationFlag()) {
+ result.setTerminationFlag(false);
+ this.processPlan.close();
+ this.processPlan.reset();
+ this.open = false;
+ }
+ }
+
if(result.getTerminationFlag()) {
done = true;
break;
@@ -264,4 +278,8 @@
public BufferManager getBufferManager() {
return bufferMgr;
}
+
+ public void setContinuous(boolean continuous) {
+ this.continuous = continuous;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -28,10 +28,10 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import java.util.Random;
import java.util.Set;
import java.util.TimeZone;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import javax.security.auth.Subject;
@@ -51,6 +51,8 @@
import org.teiid.dqp.message.RequestID;
import org.teiid.dqp.service.TransactionContext;
import org.teiid.dqp.service.TransactionService;
+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.eval.SecurityFunctionEvaluator;
@@ -64,6 +66,7 @@
import org.teiid.query.sql.util.VariableContext;
import org.teiid.query.tempdata.GlobalTableStore;
import org.teiid.query.tempdata.TempTableStore;
+import org.teiid.translator.ReusableExecution;
/**
* Defines the context that a command is processing in. For example, this defines
@@ -90,8 +93,6 @@
private int vdbVersion;
- private Properties environmentProperties;
-
/** Indicate whether statistics should be collected for relational node processing*/
private boolean collectNodeStatistics;
@@ -138,6 +139,7 @@
private TransactionService transactionService;
private SourceHint sourceHint;
private Executor executor = ExecutorUtils.getDirectExecutor();
+ Map<String, ReusableExecution<?>> reusableExecutions;
}
private GlobalState globalState = new GlobalState();
@@ -153,14 +155,13 @@
* Construct a new context.
*/
public CommandContext(Object processorID, String connectionID, String userName,
- Serializable commandPayload, String vdbName, int vdbVersion, Properties envProperties, boolean collectNodeStatistics) {
+ Serializable commandPayload, String vdbName, int vdbVersion, boolean collectNodeStatistics) {
setProcessorID(processorID);
setConnectionID(connectionID);
setUserName(userName);
setCommandPayload(commandPayload);
setVdbName(vdbName);
setVdbVersion(vdbVersion);
- setEnvironmentProperties(envProperties);
setCollectNodeStatistics(collectNodeStatistics);
}
@@ -171,7 +172,7 @@
String vdbName, int vdbVersion) {
this(processorID, connectionID, userName, null, vdbName,
- vdbVersion, null, false);
+ vdbVersion, false);
}
@@ -289,14 +290,6 @@
this.globalState.vdbVersion = vdbVersion;
}
- public Properties getEnvironmentProperties() {
- return globalState.environmentProperties;
- }
-
- public void setEnvironmentProperties(Properties properties) {
- globalState.environmentProperties = properties;
- }
-
public Serializable getCommandPayload() {
return this.globalState.commandPayload;
}
@@ -650,4 +643,30 @@
this.globalState.executor = e;
}
+ public ReusableExecution<?> getReusableExecution(String nodeId) {
+ if (this.globalState.reusableExecutions == null) {
+ return null;
+ }
+ return this.globalState.reusableExecutions.get(nodeId);
+ }
+
+ public void putReusableExecution(String nodeId, ReusableExecution<?> execution) {
+ if (this.globalState.reusableExecutions == null) {
+ this.globalState.reusableExecutions = new ConcurrentHashMap<String, ReusableExecution<?>>();
+ }
+ this.globalState.reusableExecutions.put(nodeId, execution);
+ }
+
+ public void close() {
+ if (this.globalState.reusableExecutions != null) {
+ for (ReusableExecution<?> reusableExecution : this.globalState.reusableExecutions.values()) {
+ try {
+ reusableExecution.dispose();
+ } catch (Exception e) {
+ LogManager.logWarning(LogConstants.CTX_DQP, e, "Unhandled exception disposing reusable execution"); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
}
Deleted: trunk/engine/src/main/java/org/teiid/query/util/ContextProperties.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/util/ContextProperties.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/main/java/org/teiid/query/util/ContextProperties.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.query.util;
-
-/**
- * Defines constants that are used within the DQP, provided to the query engine as
- * properties in the CommandContext for access via the ENV function.
- */
-public interface ContextProperties {
-
- // !!!!!!!!!!!!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- // ALL constants defined here for use with the CommandContext and that should be
- // retrievable by the env() system function MUST be defined in all lower-case or
- // they will not work.
-
- public static final String SESSION_ID = "sessionid"; //$NON-NLS-1$
-
-}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/FakeExecutionContextImpl.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/FakeExecutionContextImpl.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/FakeExecutionContextImpl.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -24,7 +24,6 @@
import java.util.concurrent.atomic.AtomicInteger;
-import org.teiid.dqp.internal.datamgr.ExecutionContextImpl;
import org.teiid.translator.ExecutionContext;
/**
@@ -43,15 +42,15 @@
"ExecutionPayload" + unique, //$NON-NLS-1$
"ConnectionID" + unique, //$NON-NLS-1$
"ConnectorID" + unique, //$NON-NLS-1$
- "RequestID" + unique, //$NON-NLS-1$
+ unique,
"PartID" + unique, //$NON-NLS-1$
"ExecCount" + unique); //$NON-NLS-1$
}
public FakeExecutionContextImpl(ExecutionContext c) {
super(c.getVirtualDatabaseName(), c.getVirtualDatabaseVersion(), c.getExecutionPayload(), c
- .getConnectionIdentifier(), c.getConnectorIdentifier(), c
- .getRequestIdentifier(), c.getPartIdentifier(), c
+ .getConnectionIdentifier(), c.getConnectorIdentifier(), Long.valueOf(c
+ .getRequestIdentifier()), c.getPartIdentifier(), c
.getExecutionCountIdentifier());
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestConnectorWorkItem.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestConnectorWorkItem.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestConnectorWorkItem.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -33,10 +33,6 @@
import org.junit.Test;
import org.mockito.Mockito;
import org.teiid.client.RequestMessage;
-import org.teiid.dqp.internal.datamgr.ConnectorManager;
-import org.teiid.dqp.internal.datamgr.ConnectorWorkItem;
-import org.teiid.dqp.internal.datamgr.LanguageBridgeFactory;
-import org.teiid.dqp.internal.datamgr.ProcedureBatchHandler;
import org.teiid.dqp.internal.process.DQPWorkContext;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.AtomicResultsMessage;
@@ -50,6 +46,7 @@
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.unittest.RealMetadataFactory;
+import org.teiid.query.util.CommandContext;
import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.TranslatorException;
@@ -77,6 +74,7 @@
request.setRequestID(new RequestID(requestid));
request.setConnectorName("testing"); //$NON-NLS-1$
request.setFetchSize(5);
+ request.setCommandContext(new CommandContext());
return request;
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestExecutionContextImpl.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestExecutionContextImpl.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestExecutionContextImpl.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -22,35 +22,28 @@
package org.teiid.dqp.internal.datamgr;
+import org.junit.Test;
import org.teiid.core.util.UnitTestUtil;
-import org.teiid.dqp.internal.datamgr.ExecutionContextImpl;
-
-import junit.framework.TestCase;
-
/**
*/
-public class TestExecutionContextImpl extends TestCase {
+public class TestExecutionContextImpl {
- public TestExecutionContextImpl(String name) {
- super(name);
- }
-
- public ExecutionContextImpl createContext(String requestID, String partID) {
- return new ExecutionContextImpl("vdb", 1, null, //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ public ExecutionContextImpl createContext(long requestID, String partID) {
+ return new ExecutionContextImpl("vdb", 1, null, //$NON-NLS-1$
"Connection", "Connector", requestID, partID, "0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- public void testEqivalenceSemanticsSame() {
- UnitTestUtil.helpTestEquivalence(0, createContext("100", "1"), createContext("100", "1")); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-4$
+ @Test public void testEqivalenceSemanticsSame() {
+ UnitTestUtil.helpTestEquivalence(0, createContext(100, "1"), createContext(100, "1")); //$NON-NLS-2$ //$NON-NLS-1$
}
- public void testEqivalenceSemanticsDifferentPart() {
- UnitTestUtil.helpTestEquivalence(1, createContext("100", "1"), createContext("100", "2")); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-4$
+ @Test public void testEqivalenceSemanticsDifferentPart() {
+ UnitTestUtil.helpTestEquivalence(1, createContext(100, "1"), createContext(100, "2")); //$NON-NLS-2$ //$NON-NLS-1$
}
- public void testEqivalenceSemanticsDifferentRequest() {
- UnitTestUtil.helpTestEquivalence(1, createContext("100", "1"), createContext("200", "1")); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-4$
+ @Test public void testEqivalenceSemanticsDifferentRequest() {
+ UnitTestUtil.helpTestEquivalence(1, createContext(100, "1"), createContext(200, "1")); //$NON-NLS-2$ //$NON-NLS-1$
}
}
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-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -225,20 +225,6 @@
helpExecute(sql, userName);
}
- @Test public void testEnvSessionId() throws Exception {
- String sql = "SELECT env('sessionid') as SessionID"; //$NON-NLS-1$
- String userName = "1"; //$NON-NLS-1$
- ResultsMessage rm = helpExecute(sql, userName);
- assertEquals("1", rm.getResultsList().get(0).get(0)); //$NON-NLS-1$
- }
-
- @Test public void testEnvSessionIdMixedCase() throws Exception {
- String sql = "SELECT env('sEsSIonId') as SessionID"; //$NON-NLS-1$
- String userName = "1"; //$NON-NLS-1$
- ResultsMessage rm = helpExecute(sql, userName);
- assertEquals("1", rm.getResultsList().get(0).get(0)); //$NON-NLS-1$
- }
-
@Test public void testTxnAutoWrap() throws Exception {
String sql = "SELECT * FROM BQT1.SmallA"; //$NON-NLS-1$
helpExecute(sql, "a", 1, true); //$NON-NLS-1$
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-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -155,13 +155,12 @@
@Test public void testSessionSpecificFunction() throws Exception {
// Create query
- System.setProperty("foo", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
- String preparedSql = "SELECT env('foo'), e2, pm1.g1.e3 as a, e4 as b FROM pm1.g1 WHERE e2=?"; //$NON-NLS-1$
+ String preparedSql = "SELECT session_id(), e2, pm1.g1.e3 as a, e4 as b FROM pm1.g1 WHERE e2=?"; //$NON-NLS-1$
// Create expected results
List[] expected = new List[] {
- Arrays.asList(new Object[] { "foo", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
- Arrays.asList(new Object[] { "foo", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
+ Arrays.asList(new Object[] { "6", new Integer(0), Boolean.FALSE, new Double(2.0) }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "6", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
};
List<?> values = Arrays.asList((short)0);
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestRequest.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -44,7 +44,6 @@
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.tempdata.TempTableStore.TransactionMode;
import org.teiid.query.unittest.RealMetadataFactory;
-import org.teiid.query.util.ContextProperties;
@@ -125,7 +124,7 @@
DQPWorkContext workContext = RealMetadataFactory.buildWorkContext(metadata, RealMetadataFactory.example1VDB());
Request request = helpProcessMessage(message, null, workContext);
- assertEquals("1", request.context.getEnvironmentProperties().get(ContextProperties.SESSION_ID)); //$NON-NLS-1$
+ assertEquals("1", request.context.getConnectionID()); //$NON-NLS-1$
}
private Request helpProcessMessage(RequestMessage message, SessionAwareCache<PreparedPlan> cache, DQPWorkContext workContext) throws TeiidComponentException,
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -114,7 +114,7 @@
IDGenerator idGenerator = new IDGenerator();
Properties props = new Properties();
- CommandContext context = new CommandContext("0", "test", "user", null, vdb.getName(), vdb.getVersion(), props, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ CommandContext context = new CommandContext("0", "test", "user", null, vdb.getName(), vdb.getVersion(), false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
context.setPlanToProcessConverter(new MultiSourcePlanToProcessConverter(metadata, idGenerator, analysis, finder, multiSourceModels, dqpContext, context));
ProcessorPlan plan = QueryOptimizer.optimizePlan(command, wrapper, idGenerator, finder, analysis, context);
Deleted: trunk/engine/src/test/java/org/teiid/dqp/message/TestAtomicRequestMessage.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/message/TestAtomicRequestMessage.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/dqp/message/TestAtomicRequestMessage.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.dqp.message;
-
-import static org.junit.Assert.*;
-
-import org.junit.Ignore;
-import org.junit.Test;
-import org.teiid.client.RequestMessage;
-import org.teiid.core.util.UnitTestUtil;
-import org.teiid.dqp.internal.datamgr.TestQueryImpl;
-import org.teiid.dqp.internal.process.DQPWorkContext;
-
-@Ignore(value="Serialization of language objects has been turned off")
-public class TestAtomicRequestMessage {
-
- public static AtomicRequestMessage example() {
- RequestMessage rm = new RequestMessage();
- DQPWorkContext workContext = new DQPWorkContext();
- workContext.getSession().setSessionId(String.valueOf(2));
- AtomicRequestMessage message = new AtomicRequestMessage(rm, workContext, 1000);
- message.setCommand(TestQueryImpl.helpExample(true));
- message.setFetchSize(100);
- message.setPartialResults(true);
- message.setRequestID(new RequestID(5000L));
-
- //AtomicRequestMessage-specific stuff
- message.setConnectorName("connectorBindingID"); //$NON-NLS-1$
- return message;
- }
-
- @Test public void testSerialize() throws Exception {
- AtomicRequestMessage example = example();
- AtomicRequestMessage copy = UnitTestUtil.helpSerialize(example);
-
- assertEquals(TestQueryImpl.helpExample(true), copy.getCommand());
- assertEquals(100, copy.getFetchSize());
-
- assertEquals(example.getProcessingTimestamp(), copy.getProcessingTimestamp());
- assertEquals(new RequestID(5000L), copy.getRequestID());
- assertEquals("2", copy.getWorkContext().getSessionId()); //$NON-NLS-1$
- //AtomicRequestMessage-specific stuff
- assertEquals("connectorBindingID", copy.getConnectorName()); //$NON-NLS-1$
- assertEquals(1000, copy.getAtomicRequestID().getNodeID());
- }
-}
Modified: trunk/engine/src/test/java/org/teiid/query/function/TestFunction.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/function/TestFunction.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/query/function/TestFunction.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -30,7 +30,6 @@
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
-import java.util.Properties;
import org.junit.Test;
import org.teiid.api.exception.query.FunctionExecutionException;
@@ -1119,22 +1118,14 @@
}
@Test public void testEnv() throws Exception {
- Properties p = new Properties();
- String envProperty = "EnvProperty"; //$NON-NLS-1$
String systemProperty = "SystemProperty"; //$NON-NLS-1$
- p.setProperty(envProperty.toLowerCase(), envProperty);
- // set an environment property
- CommandContext context = new CommandContext();
- context.setEnvironmentProperties(p);
-
// set the system property
System.setProperty(systemProperty, systemProperty);
System.setProperty(systemProperty.toLowerCase(), systemProperty+"_lowercase"); //$NON-NLS-1$
- assertEquals(envProperty, FunctionMethods.env(context, envProperty));
- assertEquals(systemProperty, FunctionMethods.env(context, systemProperty));
- assertEquals(systemProperty+"_lowercase", FunctionMethods.env(context, systemProperty.toUpperCase())); //$NON-NLS-1$
+ assertEquals(systemProperty, FunctionMethods.env(systemProperty));
+ assertEquals(systemProperty+"_lowercase", FunctionMethods.env(systemProperty.toUpperCase())); //$NON-NLS-1$
}
@Test(expected=FunctionExecutionException.class) public void testParseIntStrictness() throws Exception {
Modified: trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -1210,12 +1210,7 @@
}
@Test public void testInvokeEnv() throws Exception {
- CommandContext c = new CommandContext();
- Properties props = new Properties();
- props.setProperty("env_test", "env_value"); //$NON-NLS-1$ //$NON-NLS-2$
- c.setEnvironmentProperties(props);
- helpInvokeMethod("env", new Class<?>[] {String.class}, new Object[] {"env_test"}, c, "env_value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- helpInvokeMethod("env", new Class<?>[] {String.class}, new Object[] {null}, c, null); //$NON-NLS-1$
+ helpInvokeMethod("env", new Class<?>[] {String.class}, new Object[] {null}, null); //$NON-NLS-1$
}
@Test public void testInvokeCommandPayload() throws Exception {
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestBatchedUpdatePlanner.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestBatchedUpdatePlanner.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestBatchedUpdatePlanner.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -215,7 +215,6 @@
private FakeCapabilities(boolean supportsBatching) {
this.supportsBatching = supportsBatching;
}
- public Scope getScope() {return null;}
public boolean supportsCapability(Capability capability) {
return !capability.equals(Capability.BATCHED_UPDATES) || supportsBatching;
}
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/capabilities/AllCapabilities.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/capabilities/AllCapabilities.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/capabilities/AllCapabilities.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -43,10 +43,6 @@
return null;
}
- public Scope getScope() {
- return Scope.SCOPE_GLOBAL;
- }
-
@Override
public boolean supportsConvert(int sourceType, int targetType) {
return true;
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -349,7 +349,7 @@
Properties props = new Properties();
props.setProperty("soap_host", "my.host.com"); //$NON-NLS-1$ //$NON-NLS-2$
props.setProperty("soap_port", "12345"); //$NON-NLS-1$ //$NON-NLS-2$
- CommandContext context = new CommandContext("0", "test", "user", null, "myvdb", 1, props, DEBUG); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ CommandContext context = new CommandContext("0", "test", "user", null, "myvdb", 1, DEBUG); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
context.setProcessorBatchSize(BufferManager.DEFAULT_PROCESSOR_BATCH_SIZE);
context.setBufferManager(BufferManagerFactory.getStandaloneBufferManager());
context.setPreparedPlanCache(new SessionAwareCache<PreparedPlan>());
@@ -4755,7 +4755,7 @@
// Create expected results
List[] expected = new List[] {
- Arrays.asList(new Object[] { "http://my.host.com:12345/metamatrix-soap/services/DataService" }), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "http://soap_host/metamatrix-soap/services/DataService" }), //$NON-NLS-1$
};
// Plan query
Modified: trunk/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -51,16 +51,7 @@
import org.teiid.query.sql.lang.Query;
import org.teiid.query.sql.lang.QueryCommand;
import org.teiid.query.sql.lang.SubqueryContainer;
-import org.teiid.query.sql.symbol.CaseExpression;
-import org.teiid.query.sql.symbol.Constant;
-import org.teiid.query.sql.symbol.ElementSymbol;
-import org.teiid.query.sql.symbol.Expression;
-import org.teiid.query.sql.symbol.Function;
-import org.teiid.query.sql.symbol.ScalarSubquery;
-import org.teiid.query.sql.symbol.SearchedCaseExpression;
-import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.query.sql.symbol.TestCaseExpression;
-import org.teiid.query.sql.symbol.TestSearchedCaseExpression;
+import org.teiid.query.sql.symbol.*;
import org.teiid.query.sql.util.ValueIterator;
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.query.util.CommandContext;
@@ -320,31 +311,6 @@
assertEquals(context.getUserName(), new Evaluator(Collections.emptyMap(), dataMgr, context).evaluate(func, Collections.emptyList()) );
}
- /*
- * This is the only test that depends upon the the testsrc/metamatrix.properties
- * and testsrc/config.xml. If the implementation is changed, please update/remove
- * these files.
- * @throws Exception
- */
- @Test public void testEnv() throws Exception {
- Function func = new Function("env", new Expression[] {}); //$NON-NLS-1$
- FunctionDescriptor desc = RealMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("env", new Class[] {String.class} ); //$NON-NLS-1$
- func.setFunctionDescriptor(desc);
-
- FakeDataManager dataMgr = new FakeDataManager();
-
- Properties props = new Properties();
- props.setProperty("http_host", "testHostName"); //$NON-NLS-1$ //$NON-NLS-2$
- props.setProperty("http_port", "8000"); //$NON-NLS-1$ //$NON-NLS-2$
- CommandContext context = new CommandContext(new Long(1), null, null, null, null, 0, props, false);
-
- func.setArgs(new Expression[] {new Constant("http_host")}); //$NON-NLS-1$
- assertEquals("testHostName", new Evaluator(Collections.emptyMap(), dataMgr, context).evaluate(func, Collections.emptyList())); //$NON-NLS-1$
-
- func.setArgs(new Expression[] {new Constant("http_port")}); //$NON-NLS-1$
- assertEquals("8000", new Evaluator(Collections.emptyMap(), dataMgr, context).evaluate(func, Collections.emptyList())); //$NON-NLS-1$
- }
-
public void helpTestCommandPayload(Serializable payload, String property, String expectedValue) throws Exception {
Function func = new Function("commandpayload", new Expression[] {}); //$NON-NLS-1$
@@ -358,7 +324,7 @@
func.setFunctionDescriptor(desc);
FakeDataManager dataMgr = new FakeDataManager();
- CommandContext context = new CommandContext(new Long(-1), null, "user", payload, "vdb", 1, null, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ CommandContext context = new CommandContext(new Long(-1), null, "user", payload, "vdb", 1, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if(property != null) {
func.setArgs(new Expression[] {new Constant(property)});
Modified: trunk/engine/src/test/java/org/teiid/query/processor/relational/TestRelationalNodeStatistics.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/relational/TestRelationalNodeStatistics.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestRelationalNodeStatistics.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -111,7 +111,7 @@
FakeRelationalNode fakeNode = new FakeRelationalNode(1, data, 100);
fakeNode.setElements(elements);
- CommandContext context = new CommandContext("pid", "group", null, null, null, 1, null, true); //$NON-NLS-1$ //$NON-NLS-2$
+ CommandContext context = new CommandContext("pid", "group", null, null, null, 1, true); //$NON-NLS-1$ //$NON-NLS-2$
fakeNode.initialize(context, BufferManagerFactory.getStandaloneBufferManager(), null);
return fakeNode;
}
Modified: trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -31,7 +31,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import java.util.TimeZone;
import org.junit.Before;
@@ -67,7 +66,6 @@
import org.teiid.query.sql.visitor.CorrelatedReferenceCollectorVisitor;
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ContextProperties;
@SuppressWarnings("nls")
@@ -1078,16 +1076,13 @@
}
- //note that the env is now treated as deterministic, however it is really only deterministic within a session
- @Test public void testRewriteExecEnv() throws Exception {
- Command command = QueryParser.getQueryParser().parseCommand("exec pm1.sq2(env('sessionid'))"); //$NON-NLS-1$
+ @Test public void testRewriteExec() throws Exception {
+ Command command = QueryParser.getQueryParser().parseCommand("exec pm1.sq2(session_id())"); //$NON-NLS-1$
QueryResolver.resolveCommand(command, RealMetadataFactory.example1Cached());
- CommandContext context = new CommandContext();
- Properties props = new Properties();
- props.setProperty(ContextProperties.SESSION_ID, "1"); //$NON-NLS-1$
- context.setEnvironmentProperties(props);
+ CommandContext context = new CommandContext();
+ context.setConnectionID("1");
Command rewriteCommand = QueryRewriter.rewrite(command, RealMetadataFactory.example1Cached(), context);
assertEquals("EXEC pm1.sq2('1')", rewriteCommand.toString()); //$NON-NLS-1$
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -260,7 +260,6 @@
try {
ExecutionFactory<Object, Object> ef = getExecutionFactory(name, repo, getTranslatorRepository(), deployment, map, new HashSet<String>());
cm.setExecutionFactory(ef);
- cm.setModelName(model.getName());
cmr.addConnectorManager(source, cm);
} catch (TranslatorNotFoundException e) {
if (e.getCause() != null) {
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -93,7 +93,6 @@
model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), msg);
cm = new ConnectorManager(translatorName, dsName);
cm.setExecutionFactory(ef);
- cm.setModelName(modelName);
cmr.addConnectorManager(sourceName, cm);
dsReplaced = true;
}
Modified: trunk/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -258,7 +258,7 @@
}
final PreparedStatementImpl stmt = this.connection.prepareStatement(sql);
- this.executionFuture = stmt.submitExecute(ResultsMode.RESULTSET);
+ this.executionFuture = stmt.submitExecute(ResultsMode.RESULTSET, null);
this.executionFuture.addCompletionListener(new ResultsFuture.CompletionListener<Boolean>() {
@Override
public void onCompletion(ResultsFuture<Boolean> future) {
@@ -341,7 +341,7 @@
private void sqlExecute(final String sql, final ResultsFuture<Integer> completion) throws SQLException {
String modfiedSQL = fixSQL(sql);
final StatementImpl stmt = connection.createStatement();
- executionFuture = stmt.submitExecute(modfiedSQL);
+ executionFuture = stmt.submitExecute(modfiedSQL, null);
executionFuture.addCompletionListener(new ResultsFuture.CompletionListener<Boolean>() {
@Override
public void onCompletion(ResultsFuture<Boolean> future) {
@@ -479,7 +479,7 @@
stmt.setMaxRows(maxRows);
}
- this.executionFuture = stmt.submitExecute(ResultsMode.EITHER);
+ this.executionFuture = stmt.submitExecute(ResultsMode.EITHER, null);
executionFuture.addCompletionListener(new ResultsFuture.CompletionListener<Boolean>() {
@Override
public void onCompletion(ResultsFuture<Boolean> future) {
Modified: trunk/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -65,14 +65,14 @@
metaGroup.addStore(metadataStore);
ConnectorManagerRepository cmr = new ConnectorManagerRepository();
- cmr.addConnectorManager("source", getConnectorManager("bqt1", "FakeTranslator", "FakeConnection", getFuncsOne()));
- cmr.addConnectorManager("source2", getConnectorManager("bqt2", "FakeTranslator2", "FakeConnection2", getFuncsTwo()));
+ cmr.addConnectorManager("source", getConnectorManager("FakeTranslator", "FakeConnection", getFuncsOne()));
+ cmr.addConnectorManager("source2", getConnectorManager("FakeTranslator2", "FakeConnection2", getFuncsTwo()));
CompositeVDB cvdb = new CompositeVDB(vdbMetaData, metaGroup, null, null, RealMetadataFactory.SFM.getSystemFunctions(),cmr);
return cvdb;
}
- private static ConnectorManager getConnectorManager(String modelName, String translatorName, String connectionName, List<FunctionMethod> funcs) {
+ private static ConnectorManager getConnectorManager(String translatorName, String connectionName, List<FunctionMethod> funcs) {
final ExecutionFactory<Object, Object> ef = Mockito.mock(ExecutionFactory.class);
Mockito.stub(ef.getPushDownFunctions()).toReturn(funcs);
@@ -82,7 +82,6 @@
return ef;
}
};
- cm.setModelName(modelName);
cm.start();
return cm;
}
Added: trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java (rev 0)
+++ trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -0,0 +1,176 @@
+/*
+ * 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 static org.junit.Assert.*;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.mockito.internal.progress.OngoingStubbing;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.core.util.UnitTestUtil;
+import org.teiid.dqp.internal.datamgr.ConnectorManager;
+import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
+import org.teiid.jdbc.FakeServer;
+import org.teiid.jdbc.RequestOptions;
+import org.teiid.jdbc.StatementCallback;
+import org.teiid.jdbc.TeiidStatement;
+import org.teiid.language.Command;
+import org.teiid.language.QueryExpression;
+import org.teiid.metadata.RuntimeMetadata;
+import org.teiid.translator.DataNotAvailableException;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ExecutionFactory;
+import org.teiid.translator.ResultSetExecution;
+import org.teiid.translator.ReusableExecution;
+import org.teiid.translator.TranslatorException;
+
+@SuppressWarnings("nls")
+public class TestExecutionReuse {
+
+ private static final int EXEC_COUNT = 3;
+ private static FakeServer server;
+
+ private static class FakeReusableExecution implements ResultSetExecution, ReusableExecution<Object> {
+
+ @Override
+ public List<?> next() throws TranslatorException,
+ DataNotAvailableException {
+ return null;
+ }
+
+ @Override
+ public void cancel() throws TranslatorException {
+ }
+
+ @Override
+ public void close() {
+ }
+
+ @Override
+ public void execute() throws TranslatorException {
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void reset(Command c, ExecutionContext executionContext,
+ Object connection) {
+ }
+
+ }
+
+ private static FakeReusableExecution execution;
+
+ @Before public void setup() throws DataNotAvailableException, TranslatorException {
+ execution = Mockito.mock(FakeReusableExecution.class);
+ OngoingStubbing stubbing = Mockito.stub(execution.next()).toReturn((List) Arrays.asList((Object)null)).toReturn(null);
+ for (int i = 1; i < EXEC_COUNT; i++) {
+ stubbing.toReturn((List<Object>) Arrays.asList((Object)null)).toReturn(null);
+ }
+ }
+
+ @BeforeClass public static void oneTimeSetUp() throws Exception {
+ DQPConfiguration config = new DQPConfiguration();
+ config.setUserRequestSourceConcurrency(1);
+ server = new FakeServer(config);
+ server.setConnectorManagerRepository(new ConnectorManagerRepository() {
+ private ConnectorManager cm = new ConnectorManager("x", "y") {
+ private ExecutionFactory<Object, Object> ef = new ExecutionFactory<Object, Object>() {
+
+ @Override
+ public ResultSetExecution createResultSetExecution(
+ QueryExpression command,
+ ExecutionContext executionContext,
+ RuntimeMetadata metadata, Object connection)
+ throws TranslatorException {
+ return execution;
+ };
+ };
+ @Override
+ public ExecutionFactory<Object, Object> getExecutionFactory() {
+ return ef;
+ }
+
+ @Override
+ protected Object getConnectionFactory()
+ throws TranslatorException {
+ return null;
+ }
+ };
+ @Override
+ public ConnectorManager getConnectorManager(String connectorName) {
+ return cm;
+ }
+ });
+ server.deployVDB("PartsSupplier", UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
+ }
+
+ @AfterClass public static void oneTimeTearDown() throws Exception {
+ server.stop();
+ }
+
+ @Test public void testReusableAsynchContinuous() throws Exception {
+ Connection c = server.createConnection("jdbc:teiid:partssupplier");
+ Statement s = c.createStatement();
+ TeiidStatement ts = s.unwrap(TeiidStatement.class);
+ final ResultsFuture<Integer> result = new ResultsFuture<Integer>();
+ ts.submitExecute("select part_id from parts", new StatementCallback() {
+ int rowCount;
+ @Override
+ public void onRow(Statement s, ResultSet rs) throws SQLException {
+ rowCount++;
+ if (rowCount == EXEC_COUNT) {
+ s.close();
+ }
+ }
+
+ @Override
+ public void onException(Statement s, Exception e) {
+ result.getResultsReceiver().receiveResults(rowCount);
+ }
+
+ @Override
+ public void onComplete(Statement s) {
+ result.getResultsReceiver().receiveResults(rowCount);
+ }
+ }, new RequestOptions().continuous(true));
+ assertEquals(EXEC_COUNT, result.get().intValue());
+ Mockito.verify(execution, Mockito.times(1)).dispose();
+ Mockito.verify(execution, Mockito.times(EXEC_COUNT)).execute();
+ Mockito.verify(execution, Mockito.times(EXEC_COUNT)).close();
+ Mockito.verify(execution, Mockito.times(EXEC_COUNT - 1)).reset((Command)Mockito.anyObject(), (ExecutionContext)Mockito.anyObject(), Mockito.anyObject());
+ }
+
+}
Property changes on: trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestExecutionReuse.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestRelate.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestRelate.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestRelate.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -42,6 +42,7 @@
import org.h2.jdbcx.JdbcConnectionPool;
import org.h2.jdbcx.JdbcDataSource;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.teiid.core.util.UnitTestUtil;
@@ -87,6 +88,10 @@
}
}
+ @AfterClass public static void oneTimeTearDown() throws Exception {
+ server.stop();
+ }
+
private void compareResults(SQLXML[] docs)
throws SQLException, IOException {
StackTraceElement ste = new Exception().getStackTrace()[1];
Modified: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2011-12-07 20:31:15 UTC (rev 3723)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2011-12-07 20:42:04 UTC (rev 3724)
@@ -38,6 +38,7 @@
import org.teiid.core.util.UnitTestUtil;
import org.teiid.jdbc.AbstractMMQueryTestCase;
import org.teiid.jdbc.FakeServer;
+import org.teiid.jdbc.RequestOptions;
import org.teiid.jdbc.StatementCallback;
import org.teiid.jdbc.TeiidStatement;
import org.teiid.jdbc.TestMMDatabaseMetaData;
@@ -211,10 +212,37 @@
public void onComplete(Statement s) {
result.getResultsReceiver().receiveResults(rowCount);
}
- });
+ }, new RequestOptions());
assertEquals(4, result.get().intValue());
}
+ @Test public void testAsynchContinuous() throws Exception {
+ Statement s = this.internalConnection.createStatement();
+ TeiidStatement ts = s.unwrap(TeiidStatement.class);
+ final ResultsFuture<Integer> result = new ResultsFuture<Integer>();
+ ts.submitExecute("select * from SYS.Schemas", new StatementCallback() {
+ int rowCount;
+ @Override
+ public void onRow(Statement s, ResultSet rs) throws SQLException {
+ rowCount++;
+ if (rowCount == 1024) {
+ s.close();
+ }
+ }
+
+ @Override
+ public void onException(Statement s, Exception e) {
+ result.getResultsReceiver().receiveResults(rowCount);
+ }
+
+ @Override
+ public void onComplete(Statement s) {
+ result.getResultsReceiver().receiveResults(rowCount);
+ }
+ }, new RequestOptions().continuous(true));
+ assertEquals(1024, result.get().intValue());
+ }
+
@Test public void testCallableParametersByName() throws Exception {
CallableStatement cs = this.internalConnection.prepareCall("{? = call logMsg(?, ?, ?)}");
ParameterMetaData pmd = cs.getParameterMetaData();
13 years
teiid SVN: r3723 - in branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries: xa_transaction and 1 other directory.
by teiid-commits@lists.jboss.org
Author: van.halbert
Date: 2011-12-07 15:31:15 -0500 (Wed, 07 Dec 2011)
New Revision: 3723
Added:
branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/xa_transaction/
branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/xa_transaction/TestPhysicalQueries.xml
branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/xa_transaction/TestVirtualQueries.xml
Modified:
branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/TestPhysicalQueries.xml
Log:
adding xa transaction tests
Modified: branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/TestPhysicalQueries.xml
===================================================================
--- branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/TestPhysicalQueries.xml 2011-12-07 16:55:59 UTC (rev 3722)
+++ branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/TestPhysicalQueries.xml 2011-12-07 20:31:15 UTC (rev 3723)
@@ -5,58 +5,65 @@
<!-- * Testing simple transactions * -->
<!-- * =====================================================================* -->
-<query name="TestQuery1">select * from pm1.g1 order by e1
-</query>
+<query name="TestQuery1">delete from pm1.g2</query>
+<query name="TestQuery2">delete from pm1.g1</query>
-<query name="TestQuery2">select * from pm1.g2 where e1 >= 0 order by e1</query>
-<query name="TestQuery3">select * from pm2.g1 where e1 >= 0 order by e1</query>
-<query name="TestQuery4">select * from pm2.g2 where e1 >= 0 order by e1</query>
+<query name="TestQuery3">delete from pm2.G2</query>
+<query name="TestQuery4">delete from pm2.G1</query>
-
<query name="TestQuery5">
<sql updatecnt="1">insert into pm1.g1 (e1, e2) values(?, ?)
<parm type="integer">1000</parm>
- <parm type="string">'1000'</parm>
+ <parm type="string">'blah'</parm>
</sql>
<sql>select * from pm1.g1 where e1 = 1000</sql>
</query>
<query name="TestQuery6">
<sql updatecnt="1">insert into pm1.g1 (e1, e2) values(?, ?)
- <parm type="integer">1000</parm>
- <parm type="string">'1000'</parm>
+ <parm type="integer">2000</parm>
+ <parm type="string">'blah2'</parm>
</sql>
- <sql updatecnt="1">update pm1.g1 set e2='blah' where e1 = ?
- <parm type="integer">1000</parm>
+ <sql updatecnt="1">update pm1.g1 set e2='blah2_updated' where e1 = ?
+ <parm type="integer">2000</parm>
</sql>
- <sql>select * from pm1.g1 where e2 = 'blah'</sql>
+ <sql>select * from pm1.g1 where e2 = 'blah_updated'</sql>
</query>
<query name="TestQuery7">
<sql updatecnt="1">insert into pm1.g1 (e1, e2) values(?, ?)
- <parm type="integer">1000</parm>
- <parm type="string">'1000'</parm>
+ <parm type="integer">3000</parm>
+ <parm type="string">'USA'</parm>
</sql>
- <sql rowCount="1">select * from pm1.g1 where e1 = 1000</sql>
- <sql updatecnt="1">delete from pm1.g1 where pm1.g1.e1 = 1000</sql>
- <sql>select * from pm1.g1 where e1 > 999</sql>
+ <sql rowCount="1">select * from pm1.g1 where e1 = 3000</sql>
+ <sql updatecnt="1">delete from pm1.g1 where pm1.g1.e1 = 3000</sql>
+ <sql rowCount="0">select * from pm1.g1 where e1 = 3000</sql>
</query>
<query name="TestQuery8">
<sql updatecnt="1">insert into pm1.g1 (e1, e2) values(?, ?)
- <parm type="integer">1100</parm>
- <parm type="string">'1100'</parm>
+ <parm type="integer">4000</parm>
+ <parm type="string">'USA'</parm>
</sql>
<sql updatecnt="1">insert into pm1.g2 (e1, e2) values(?, ?)
- <parm type="integer">1100</parm>
- <parm type="string">'1100'</parm>
+ <parm type="integer">4000</parm>
+ <parm type="string">'Missouri'</parm>
</sql>
- <sql rowCount="1">select a.* from pm1.g1 as a, pm1.g2 as b where a.e1 = 1100 and a.e1=b.e1</sql>
+ <sql rowCount="1">select a.* from pm1.g1 as a, pm1.g2 as b where a.e1 = 4000 and a.e1=b.e1</sql>
</query>
-
+<query name="TestQuery9">
+ <sql rowCount="1">select a.* from pm1.g1 as a, pm1.g2 as b where a.e1 = 4000 and a.e1=b.e1</sql>
+ <sql updatecnt="1">delete from pm1.g2 where pm1.g2.e1 = 4000</sql>
+ <sql updatecnt="1">delete from pm1.g1 where pm1.g1.e1 = 4000</sql>
+ <sql rowCount="0">select a.* from pm1.g1 as a, pm1.g2 as b where a.e1 = 4000 and a.e1=b.e1</sql>
+</query>
+
+<xquery name="TestQuery10">
+ <sql rowCount="1">select a.* from pm1.g1 as a, pm1.g2 as b where a.e1 = 4000 and a.e1=b.e1</sql>
+</xquery>
</root>
Added: branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/xa_transaction/TestPhysicalQueries.xml
===================================================================
--- branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/xa_transaction/TestPhysicalQueries.xml (rev 0)
+++ branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/xa_transaction/TestPhysicalQueries.xml 2011-12-07 20:31:15 UTC (rev 3723)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+
+<!-- * =====================================================================* -->
+<!-- * Testing simple transactions * -->
+<!-- * =====================================================================* -->
+
+<query name="TestQuery1">delete from pm1.g2</query>
+<query name="TestQuery2">delete from pm1.g1</query>
+
+
+<query name="TestQuery5">
+ <sql updatecnt="1">insert into pm1.g1 (e1, e2) values(?, ?)
+ <parm type="integer">1000</parm>
+ <parm type="string">'blah'</parm>
+ </sql>
+ <sql>select * from pm1.g1 where e1 = 1000</sql>
+</query>
+
+<query name="TestQuery6">
+ <sql updatecnt="1">insert into pm1.g1 (e1, e2) values(?, ?)
+ <parm type="integer">2000</parm>
+ <parm type="string">'blah2'</parm>
+ </sql>
+ <sql updatecnt="1">update pm1.g1 set e2='blah2_updated' where e1 = ?
+ <parm type="integer">2000</parm>
+ </sql>
+ <sql>select * from pm1.g1 where e2 = 'blah_updated'</sql>
+</query>
+
+
+<query name="TestQuery7">
+ <sql updatecnt="1">insert into pm1.g1 (e1, e2) values(?, ?)
+ <parm type="integer">3000</parm>
+ <parm type="string">'USA'</parm>
+ </sql>
+ <sql rowCount="1">select * from pm1.g1 where e1 = 3000</sql>
+ <sql updatecnt="1">delete from pm1.g1 where pm1.g1.e1 = 3000</sql>
+ <sql rowCount="0">select * from pm1.g1 where e1 = 3000</sql>
+</query>
+
+<query name="TestQuery8">
+ <sql updatecnt="1">insert into pm1.g1 (e1, e2) values(?, ?)
+ <parm type="integer">4000</parm>
+ <parm type="string">'USA'</parm>
+ </sql>
+ <sql updatecnt="1">insert into pm1.g2 (e1, e2) values(?, ?)
+ <parm type="integer">4000</parm>
+ <parm type="string">'Missouri'</parm>
+ </sql>
+
+ <sql rowCount="1">select a.* from pm1.g1 as a, pm1.g2 as b where a.e1 = 4000 and a.e1=b.e1</sql>
+
+</query>
+
+<query name="TestQuery9">
+ <sql rowCount="1">select a.* from pm1.g1 as a, pm1.g2 as b where a.e1 = 4000 and a.e1=b.e1</sql>
+ <sql updatecnt="1">delete from pm1.g2 where pm1.g2.e1 = 4000</sql>
+ <sql updatecnt="1">delete from pm1.g1 where pm1.g1.e1 = 4000</sql>
+ <sql rowCount="0">select a.* from pm1.g1 as a, pm1.g2 as b where a.e1 = 4000 and a.e1=b.e1</sql>
+</query>
+
+<xquery name="TestQuery10">
+ <sql rowCount="1">select a.* from pm1.g1 as a, pm1.g2 as b where a.e1 = 4000 and a.e1=b.e1</sql>
+</xquery>
+</root>
+
Added: branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/xa_transaction/TestVirtualQueries.xml
===================================================================
--- branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/xa_transaction/TestVirtualQueries.xml (rev 0)
+++ branches/7.1.x/test-integration/db/src/main/resources/ctc_tests/queries/rdbms/test_queries/xa_transaction/TestVirtualQueries.xml 2011-12-07 20:31:15 UTC (rev 3723)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+
+<!-- * =====================================================================* -->
+<!-- * Testing simple transactions * -->
+<!-- * =====================================================================* -->
+
+<query name="TestQuery1">delete from vm.g2</query>
+<query name="TestQuery2">delete from vm.g1</query>
+
+
+<query name="TestQuery5">
+ <sql updatecnt="1">insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values(?, ?, ?, ?)
+ <parm type="integer">1000</parm>
+ <parm type="string">blah1</parm>
+ <parm type="integer">1000</parm>
+ <parm type="string">blah2</parm>
+ </sql>
+</query>
+
+<!-- revalidating the commit was successful -->
+<query name="TestQuery6">
+ <sql rowCount="1" >select * from pm1.g1 where e2 = 'blah1'</sql>
+ <sql rowCount="1" >select * from pm2.g1 where e2 = 'blah2'</sql>
+
+</query>
+
+<query numtimes="10" name="TestQuery7">
+ <sql>delete from vm.g2</sql>
+ <sql>delete from vm.g1</sql>
+
+ <sql updatecnt="1">insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values(?, ?, ?, ?)
+ <parm type="integer">1000</parm>
+ <parm type="string">blaha</parm>
+ <parm type="integer">1000</parm>
+ <parm type="string">blahb</parm>
+ </sql>
+
+ <sql rowCount="1" >select * from pm1.g1 where e2 = 'blaha'</sql>
+ <sql rowCount="1" >select * from pm2.g1 where e2 = 'blahb'</sql>
+
+</query>
+
+
+</root>
+
13 years
teiid SVN: r3722 - branches/7.6.x/engine/src/test/java/org/teiid/query/processor.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2011-12-07 11:55:59 -0500 (Wed, 07 Dec 2011)
New Revision: 3722
Modified:
branches/7.6.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
Log:
https://issues.jboss.org/browse/TEIID-1862
Unit test to prevent regression of: https://c.na7.visual.force.com/apex/Case_View?id=500A0000008T0Ck&sfdc.ove...
Modified: branches/7.6.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- branches/7.6.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-12-07 15:46:45 UTC (rev 3721)
+++ branches/7.6.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-12-07 16:55:59 UTC (rev 3722)
@@ -7653,5 +7653,35 @@
Arrays.asList(3)});
}
+ @Test public void testMultipleAliasInUnionAll(){
+ String sql = "SELECT enterprise_id FROM ( " +
+ "SELECT * FROM ( " +
+ " SELECT id, id AS display_id, 103 AS enterprise_id FROM (" +
+ " SELECT 'x' as id, e1 FROM pm1.g1) AS nexted103) as table103Source " +
+ "UNION ALL " +
+ "SELECT 'x', 'x' AS display_id, 101 AS enterprise_id FROM (" +
+ " SELECT 'x', e1 FROM pm1.g1) AS nested101 " +
+ "UNION ALL " +
+ "SELECT 'x', 'x' AS display_id, 100 AS enterprise_id FROM (" +
+ " SELECT 'x', e1 FROM pm1.g1) AS nested100) as tableFrom1stSelect " +
+ "WHERE enterprise_id = 100";
+
+
+ // Create expected results - would expect these to be:
+ List[] expected = new List[] {
+ Arrays.asList(100)
+ };
+
+ // Construct data manager with data
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("SELECT 100 FROM pm1.g1 AS g_0", new List[] {Arrays.asList(100)});
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, RealMetadataFactory.example1Cached(), TestOptimizer.getGenericFinder(false));
+ // Run query
+ helpProcess(plan, dataManager, expected);
+
+ }
+
private static final boolean DEBUG = false;
}
13 years