teiid SVN: r2440 - trunk/engine/src/main/java/org/teiid/query/validator.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-11 15:05:40 -0400 (Wed, 11 Aug 2010)
New Revision: 2440
Modified:
trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
Log:
TEIID-1200 fix for npe seen in designer validation of a procedure
Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-08-11 17:51:25 UTC (rev 2439)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-08-11 19:05:40 UTC (rev 2440)
@@ -525,11 +525,11 @@
return;
}
Map symbolMap = this.updateProc.getSymbolMap();
+ Command userCommand = this.updateProc.getUserCommand();
// modeler validation
- if(symbolMap == null) {
+ if(userCommand == null) {
return;
}
- Command userCommand = this.updateProc.getUserCommand();
Criteria userCrit = null;
int userCmdType = userCommand.getType();
switch(userCmdType) {
15 years, 8 months
teiid SVN: r2439 - in trunk: client/src/test/java/org/teiid/jdbc and 4 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-08-11 13:51:25 -0400 (Wed, 11 Aug 2010)
New Revision: 2439
Modified:
trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java
trunk/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java
trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java
trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
trunk/runtime/src/test/java/org/teiid/services/TestSessionServiceImpl.java
Log:
TEIID-1198: Allowing to specify the VDB version as the extension to the VDB name in the JDBC URL connection property.
Modified: trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java 2010-08-11 16:17:29 UTC (rev 2438)
+++ trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java 2010-08-11 17:51:25 UTC (rev 2439)
@@ -47,7 +47,7 @@
* - jdbc:teiid:BQT
* - jdbc:teiid:BQT;verson=1
*/
- static final String BASE_PATTERN = "jdbc:teiid:([\\w|-]+)(;.*)?"; //$NON-NLS-1$
+ static final String BASE_PATTERN = "jdbc:teiid:([\\w-\\.]+)(;.*)?"; //$NON-NLS-1$
private static Logger logger = Logger.getLogger("org.teiid.jdbc"); //$NON-NLS-1$
Modified: trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java 2010-08-11 16:17:29 UTC (rev 2438)
+++ trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java 2010-08-11 17:51:25 UTC (rev 2439)
@@ -61,7 +61,7 @@
// This host/port pattern allows just a . or a - to be in the host part.
static final String HOST_PORT_PATTERN = "[\\p{Alnum}\\.\\-\\_]+:\\d+"; //$NON-NLS-1$
- static final String URL_PATTERN = "jdbc:(metamatrix|teiid):([\\w|-]+)@mm[s]?://"+HOST_PORT_PATTERN+"(,"+HOST_PORT_PATTERN+")*(;.*)?"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ static final String URL_PATTERN = "jdbc:(metamatrix|teiid):([\\w-\\.]+)@mm[s]?://"+HOST_PORT_PATTERN+"(,"+HOST_PORT_PATTERN+")*(;.*)?"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
static Pattern urlPattern = Pattern.compile(URL_PATTERN);
/**
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java 2010-08-11 16:17:29 UTC (rev 2438)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java 2010-08-11 17:51:25 UTC (rev 2439)
@@ -48,6 +48,7 @@
assertFalse(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT!/path/foo.properties")); //$NON-NLS-1$
assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT;")); //$NON-NLS-1$
assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT;version=1;logFile=foo.txt")); //$NON-NLS-1$
+ assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:teiid:BQT.1;version=1;logFile=foo.txt")); //$NON-NLS-1$
}
@Test public void testParseURL() throws SQLException{
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java 2010-08-11 16:17:29 UTC (rev 2438)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java 2010-08-11 17:51:25 UTC (rev 2439)
@@ -50,6 +50,8 @@
assertTrue(drv.acceptsURL("jdbc:teiid:8294601c-9fe9-4244-9499-4a012c5e1476_vdb@mm://localhost:12345")); //$NON-NLS-1$
assertTrue(drv.acceptsURL("jdbc:teiid:test_vdb@mm://local-host:12345")); //$NON-NLS-1$
assertTrue(drv.acceptsURL("jdbc:teiid:test_vdb@mm://local_host:12345")); //$NON-NLS-1$
+ assertTrue(drv.acceptsURL("jdbc:teiid:test_vdb.1@mm://local_host:12345")); //$NON-NLS-1$
+ assertTrue(drv.acceptsURL("jdbc:teiid:test_vdb.10@mm://local_host:12345")); //$NON-NLS-1$
}
/** Valid format of urls*/
Modified: trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
===================================================================
--- trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2010-08-11 16:17:29 UTC (rev 2438)
+++ trunk/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2010-08-11 17:51:25 UTC (rev 2439)
@@ -48,7 +48,11 @@
<para>URL Components</para>
<orderedlist>
- <listitem><para><vdb-name> - Name of the VDB you are connecting to</para></listitem>
+ <listitem><para><vdb-name> - Name of the VDB you are connecting to. Optionally VDB
+ name can also contain version information inside it. For example: "myvdb.2", this is equivalent to supplying the
+ "version=2" connection property defined below. However, use of vdb name in this format and
+ the "version" property at the same time is not allowed.
+ </para></listitem>
<listitem><para>mm - defines Teiid JDBC protocol, mms defines a secure channel (see the <link linkend="ssl">SSL chapter</link> for more)</para></listitem>
<listitem><para><host> - defines the server where the Teiid Server is installed</para></listitem>
<listitem><para><port> - defines the port on which the Teiid Server is listening for incoming JDBC connections.</para></listitem>
@@ -261,7 +265,10 @@
<entry>
<code>String</code>
</entry>
- <entry>The name of a virtual database (VDB) deployed to Teiid</entry>
+ <entry>The name of a virtual database (VDB) deployed to Teiid. Optionally Database
+ name can also contain "DatabaseVersion" information inside it. For example: "myvdb.2", this is equivalent to supplying the
+ "DatabaseVersion" property set to value of 2. However, use of Database name in this format and use of
+ DatabaseVersion property at the same time is not allowed.</entry>
</row>
<row>
<entry>
Modified: trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2010-08-11 16:17:29 UTC (rev 2438)
+++ trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2010-08-11 17:51:25 UTC (rev 2439)
@@ -149,42 +149,29 @@
domains = this.adminSecurityDomains;
}
- if (!domains.isEmpty()) {
- // Authenticate user...
- // if not authenticated, this method throws exception
- boolean onlyAllowPassthrough = Boolean.valueOf(properties.getProperty(TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION, "false")); //$NON-NLS-1$
- TeiidLoginContext membership = authenticate(userName, credentials, applicationName, domains, this.securityHelper, onlyAllowPassthrough);
- loginContext = membership.getLoginContext();
- userName = membership.getUserName();
- securityDomain = membership.getSecurityDomain();
- securityContext = membership.getSecurityContext();
- }
-
// Validate VDB and version if logging on to server product...
VDBMetaData vdb = null;
String vdbName = properties.getProperty(TeiidURL.JDBC.VDB_NAME);
if (vdbName != null) {
String vdbVersion = properties.getProperty(TeiidURL.JDBC.VDB_VERSION);
- if (vdbVersion == null) {
- vdbVersion = "latest"; //$NON-NLS-1$
- try {
- vdb = this.vdbRepository.getVDB(vdbName);
- } catch (VirtualDatabaseException e) {
- throw new SessionServiceException(RuntimePlugin.Util.getString("VDBService.VDB_does_not_exist._2", vdbName, vdbVersion)); //$NON-NLS-1$
- }
- }
- else {
- vdb = this.vdbRepository.getVDB(vdbName, Integer.parseInt(vdbVersion));
- }
- if (vdb.getStatus() != VDB.Status.ACTIVE || vdb.getConnectionType() == ConnectionType.NONE) {
- throw new SessionServiceException(RuntimePlugin.Util.getString("VDBService.VDB_does_not_exist._2", vdbName, vdbVersion)); //$NON-NLS-1$
- }
+ vdb = getActiveVDB(vdbName, vdbVersion);
}
if (sessionMaxLimit > 0 && getActiveSessionsCount() >= sessionMaxLimit) {
throw new SessionServiceException(RuntimePlugin.Util.getString("SessionServiceImpl.reached_max_sessions", new Object[] {new Long(sessionMaxLimit)})); //$NON-NLS-1$
}
+ if (!domains.isEmpty()) {
+ // Authenticate user...
+ // if not authenticated, this method throws exception
+ boolean onlyAllowPassthrough = Boolean.valueOf(properties.getProperty(TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION, "false")); //$NON-NLS-1$
+ TeiidLoginContext membership = authenticate(userName, credentials, applicationName, domains, this.securityHelper, onlyAllowPassthrough);
+ loginContext = membership.getLoginContext();
+ userName = membership.getUserName();
+ securityDomain = membership.getSecurityDomain();
+ securityContext = membership.getSecurityContext();
+ }
+
long creationTime = System.currentTimeMillis();
// Return a new session info object
@@ -211,6 +198,45 @@
return newSession;
}
+ VDBMetaData getActiveVDB(String vdbName, String vdbVersion) throws SessionServiceException {
+ VDBMetaData vdb = null;
+
+ // handle the situation when the version is part of the vdb name.
+
+ int firstIndex = vdbName.indexOf('.');
+ int lastIndex = vdbName.lastIndexOf('.');
+ if (firstIndex != -1) {
+ if (firstIndex != lastIndex || vdbVersion != null) {
+ throw new SessionServiceException(RuntimePlugin.Util.getString("ambigious_name", vdbName, vdbVersion)); //$NON-NLS-1$
+ }
+ vdbVersion = vdbName.substring(firstIndex+1);
+ vdbName = vdbName.substring(0, firstIndex);
+ }
+
+ try {
+ if (vdbVersion == null) {
+ vdbVersion = "latest"; //$NON-NLS-1$
+ vdb = this.vdbRepository.getVDB(vdbName);
+ }
+ else {
+ vdb = this.vdbRepository.getVDB(vdbName, Integer.parseInt(vdbVersion));
+ }
+ } catch (VirtualDatabaseException e) {
+ throw new SessionServiceException(RuntimePlugin.Util.getString("VDBService.VDB_does_not_exist._2", vdbName, vdbVersion)); //$NON-NLS-1$
+ } catch (NumberFormatException e) {
+ throw new SessionServiceException(e, RuntimePlugin.Util.getString("VDBService.VDB_does_not_exist._2", vdbName, vdbVersion)); //$NON-NLS-1$
+ }
+
+ if (vdb == null) {
+ throw new SessionServiceException(RuntimePlugin.Util.getString("VDBService.VDB_does_not_exist._1", vdbName, vdbVersion)); //$NON-NLS-1$
+ }
+
+ if (vdb.getStatus() != VDB.Status.ACTIVE || vdb.getConnectionType() == ConnectionType.NONE) {
+ throw new SessionServiceException(RuntimePlugin.Util.getString("VDBService.VDB_does_not_exist._2", vdbName, vdbVersion)); //$NON-NLS-1$
+ }
+ return vdb;
+ }
+
protected TeiidLoginContext authenticate(String userName, Credentials credentials, String applicationName, List<String> domains, SecurityHelper helper, boolean onlyallowPassthrough)
throws LoginException {
TeiidLoginContext membership = new TeiidLoginContext(helper);
Modified: trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-08-11 16:17:29 UTC (rev 2438)
+++ trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-08-11 17:51:25 UTC (rev 2439)
@@ -44,7 +44,8 @@
VDBConfigFileReader.Already_contains_connector_type=Configuration has two definitions for connector \"{0}\".
VDBConfigFileReader.No_connector_binding_in_config = A model \"{0}\" specifies a connection factory "{1}" for which there is no definition found in the configuration or VDB definition files.
-VDBService.VDB_does_not_exist._2=VDB \"{0}\" version \"{1}\" is not active.
+VDBService.VDB_does_not_exist._1=VDB \"{0}\" version \"{1}\" does not exist.
+VDBService.VDB_does_not_exist._2=VDB \"{0}\" version \"{1}\" is not in "active" status.
VDBService.VDB_does_not_exist._3=In VDB \"{0}\" version \"{1}\" the Model \"{2}\" does not exist.
VDBService.Model_does_not_exist._4=Model "{0}" does not exist.
VDBService.0=Error trying to read visibility information from the vdb \"{0}\".
@@ -313,4 +314,5 @@
not_bound=No bound statement found with name {0}
no_stmt_found=No prepared statement found with name {0}
error_closing_stmt=Error closing portal statement {0}
-model_metadata_loading=VDB "{0}" - "{1}" model metadata is currently being loaded. Start Time: {2}
\ No newline at end of file
+model_metadata_loading=VDB "{0}" - "{1}" model metadata is currently being loaded. Start Time: {2}
+ambigious_name=Ambiguous VDB name specified. Only single occurrence of the "." is allowed in the VDB name. Also, when version based vdb name is specified, then a separate "version" connection option is not allowed:{0}.{1}
\ No newline at end of file
Modified: trunk/runtime/src/test/java/org/teiid/services/TestSessionServiceImpl.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/services/TestSessionServiceImpl.java 2010-08-11 16:17:29 UTC (rev 2438)
+++ trunk/runtime/src/test/java/org/teiid/services/TestSessionServiceImpl.java 2010-08-11 17:51:25 UTC (rev 2439)
@@ -12,8 +12,12 @@
import org.junit.Test;
import org.mockito.Mockito;
+import org.teiid.adminapi.VDB.Status;
import org.teiid.adminapi.impl.SessionMetadata;
+import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.client.security.InvalidSessionException;
+import org.teiid.deployers.VDBRepository;
+import org.teiid.dqp.service.SessionServiceException;
import org.teiid.security.Credentials;
import org.teiid.security.SecurityHelper;
import org.teiid.services.TeiidLoginContext;
@@ -83,4 +87,109 @@
validateSession(false);
}
+ @Test
+ public void testActiveVDBWithNoVersion() throws Exception {
+ VDBRepository repo = Mockito.mock(VDBRepository.class);
+ VDBMetaData vdb = new VDBMetaData();
+ vdb.setName("name");
+ vdb.setVersion(1);
+ vdb.setStatus(Status.ACTIVE);
+
+
+ Mockito.stub(repo.getVDB("name")).toReturn(vdb);
+
+ SessionServiceImpl ssi = new SessionServiceImpl();
+ ssi.setVDBRepository(repo);
+
+ ssi.getActiveVDB("name", null);
+
+ Mockito.verify(repo, Mockito.times(1)).getVDB("name");
+ }
+
+ @Test
+ public void testActiveVDBWithVersion() throws Exception {
+ VDBRepository repo = Mockito.mock(VDBRepository.class);
+ VDBMetaData vdb = new VDBMetaData();
+ vdb.setName("name");
+ vdb.setVersion(1);
+ vdb.setStatus(Status.ACTIVE);
+
+
+ Mockito.stub(repo.getVDB("name", 1)).toReturn(vdb);
+
+ SessionServiceImpl ssi = new SessionServiceImpl();
+ ssi.setVDBRepository(repo);
+
+ ssi.getActiveVDB("name", "1");
+
+ Mockito.verify(repo, Mockito.times(1)).getVDB("name", 1);
+ }
+
+
+ @Test
+ public void testActiveVDBNameWithVersion() throws Exception {
+ VDBRepository repo = Mockito.mock(VDBRepository.class);
+ VDBMetaData vdb = new VDBMetaData();
+ vdb.setName("name");
+ vdb.setVersion(1);
+ vdb.setStatus(Status.ACTIVE);
+
+
+ Mockito.stub(repo.getVDB("name", 1)).toReturn(vdb);
+
+ SessionServiceImpl ssi = new SessionServiceImpl();
+ ssi.setVDBRepository(repo);
+
+ ssi.getActiveVDB("name.1", null);
+
+ Mockito.verify(repo, Mockito.times(1)).getVDB("name", 1);
+ }
+
+ @Test
+ public void testActiveVDBNameWithVersionNonInteger() throws Exception {
+ VDBRepository repo = Mockito.mock(VDBRepository.class);
+ VDBMetaData vdb = new VDBMetaData();
+ vdb.setName("name");
+ vdb.setVersion(1);
+ vdb.setStatus(Status.ACTIVE);
+
+
+ Mockito.stub(repo.getVDB("name", 1)).toReturn(vdb);
+
+ SessionServiceImpl ssi = new SessionServiceImpl();
+ ssi.setVDBRepository(repo);
+
+ try {
+ ssi.getActiveVDB("name.x", null);
+ fail("must have failed with non integer version");
+ } catch (SessionServiceException e) {
+ }
+ }
+
+ @Test
+ public void testActiveVDBNameWithVersionAndVersion() throws Exception {
+ VDBRepository repo = Mockito.mock(VDBRepository.class);
+ VDBMetaData vdb = new VDBMetaData();
+ vdb.setName("name");
+ vdb.setVersion(1);
+ vdb.setStatus(Status.ACTIVE);
+
+
+ Mockito.stub(repo.getVDB("name", 1)).toReturn(vdb);
+
+ SessionServiceImpl ssi = new SessionServiceImpl();
+ ssi.setVDBRepository(repo);
+
+ try {
+ ssi.getActiveVDB("name.1", "1");
+ fail("must have failed with ambigious version info");
+ } catch (SessionServiceException e) {
+ }
+
+ try {
+ ssi.getActiveVDB("name..1", null);
+ fail("must have failed with ambigious version info");
+ } catch (SessionServiceException e) {
+ }
+ }
}
15 years, 8 months
teiid SVN: r2438 - trunk/client/src/main/java/org/teiid/adminapi/impl.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-11 12:17:29 -0400 (Wed, 11 Aug 2010)
New Revision: 2438
Modified:
trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
Log:
TEIID-1199 update to security naming. this is not a deep refactoring - it only changes what is exposed.
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-08-11 15:42:11 UTC (rev 2437)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-08-11 16:17:29 UTC (rev 2438)
@@ -89,7 +89,7 @@
}
});
- @XmlElement(name = "data-policy", required = true, type = DataPolicyMetadata.class)
+ @XmlElement(name = "data-role", required = true, type = DataPolicyMetadata.class)
protected ListOverMap<DataPolicyMetadata> dataPolicies = new ListOverMap<DataPolicyMetadata>(new KeyBuilder<DataPolicyMetadata>() {
private static final long serialVersionUID = 4954591545242715254L;
15 years, 8 months
teiid SVN: r2437 - in trunk: client/src/main/resources and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-11 11:42:11 -0400 (Wed, 11 Aug 2010)
New Revision: 2437
Modified:
trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
trunk/client/src/main/resources/vdb-deployer.xsd
trunk/documentation/reference/src/main/docbook/en-US/content/architecture.xml
trunk/documentation/reference/src/main/docbook/en-US/content/entitlements.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
Log:
TEIID-1199 update to security naming. this is not a deep refactoring - it only changes what is exposed.
Modified: trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-08-11 03:42:11 UTC (rev 2436)
+++ trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-08-11 15:42:11 UTC (rev 2437)
@@ -87,8 +87,8 @@
<property name="lobChunkSizeInKB">100</property>
<!-- The maximum number of query plans that are cached. Note: this is a memory based cache. (default 250) -->
<property name="preparedPlanCacheMaxCount">250</property>
- <!-- Turn on checking the entitlements on resources based on the roles defined in VDB -->
- <property name="useEntitlements" class="java.lang.Boolean">false</property>
+ <!-- Turn on role checking on resources based on the roles defined in VDB -->
+ <property name="useDataRoles" class="java.lang.Boolean">false</property>
<!-- Long running query threshold, after which a alert can be generated by tooling if configured-->
<property name="queryThresholdInSecs">600</property>
<!-- Maximum rows allowed from a source query. -1 indicates no limit. (default -1)-->
Modified: trunk/client/src/main/resources/vdb-deployer.xsd
===================================================================
--- trunk/client/src/main/resources/vdb-deployer.xsd 2010-08-11 03:42:11 UTC (rev 2436)
+++ trunk/client/src/main/resources/vdb-deployer.xsd 2010-08-11 15:42:11 UTC (rev 2437)
@@ -73,12 +73,12 @@
<xs:attribute name="type" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
- <xs:element name="data-policy" minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="data-role" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
- <xs:documentation>This defines a security policy on the Schema. The "resource-name" element defines fully qualified
- name for a Table, procedure etc. The "allows-*" elements define the security access. The "mapped-role-name" defines
- the "role" name that user must have before they have access to this data. The "role" name matches to the
- JAAS based role that user has.</xs:documentation>
+ <xs:documentation>This defines a data role. The "resource-name" element defines fully qualified
+ name for a Schema, Table, Procedure, etc. The "allows-*" elements define the security access, which are applied to the resource
+ and all child resources. The "mapped-role-name" defines the "role" name that user must have before they have access to this data.
+ The "role" name matches to the JAAS based role that user has.</xs:documentation>
</xs:annotation>
<xs:complexType>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/architecture.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/architecture.xml 2010-08-11 03:42:11 UTC (rev 2436)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/architecture.xml 2010-08-11 15:42:11 UTC (rev 2437)
@@ -29,12 +29,6 @@
</para>
</listitem>
<listitem>
- <para>Authorization – the Authorization service
- manages user entitlements. Entitlements use is
- optional (as specified in the configuration) and off by
- default.</para>
- </listitem>
- <listitem>
<para>Buffer Manager – the <link linkend="buffer_management">Buffer Manager</link> service
provides access to data management for intermediate results.</para>
</listitem>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/entitlements.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/entitlements.xml 2010-08-11 03:42:11 UTC (rev 2436)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/entitlements.xml 2010-08-11 15:42:11 UTC (rev 2437)
@@ -8,7 +8,7 @@
<para>Data roles, also called entitlements, are sets of permissions that are defined
per VDB that dictate data access (create, read, update, delete). The use of data roles is controlled system wide with the property in
<code><jboss-install>/server/<profile>/deploy/teiid/teiid-jboss-beans.xml</code> file
- in bean configuration section of <code>RuntimeEngineDeployer</code> with property <code>useEntitlements</code>.</para>
+ in bean configuration section of <code>RuntimeEngineDeployer</code> with property <code>useDataRoles</code>.</para>
<para>Once data roles are enabled, the access permissions defined in a VDB will be enforced by the Teiid Server.
</para>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2010-08-11 03:42:11 UTC (rev 2436)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2010-08-11 15:42:11 UTC (rev 2437)
@@ -44,7 +44,7 @@
private int maxRowsFetchSize = DEFAULT_FETCH_SIZE;
private int lobChunkSizeInKB = 100;
private int preparedPlanCacheMaxCount = SessionAwareCache.DEFAULT_MAX_SIZE_TOTAL;
- private boolean useEntitlements = false;
+ private boolean useDataRoles = false;
private int queryThresholdInSecs = DEFAULT_QUERY_THRESHOLD;
private boolean exceptionOnMaxSourceRows = true;
private int maxSourceRows = -1;
@@ -124,16 +124,16 @@
}
/**
- * Determine whether entitlements checking is enabled on the server.
- * @return <code>true</code> if server-side entitlements checking is enabled.
+ * Determine whether role checking is enabled on the server.
+ * @return <code>true</code> if server-side role checking is enabled.
*/
- @ManagementProperty(description="Turn on checking the entitlements on resources based on the roles defined in VDB")
- public boolean useEntitlements() {
- return useEntitlements;
+ @ManagementProperty(description="Turn on role checking on resources based on the roles defined in VDB")
+ public boolean useDataRoles() {
+ return useDataRoles;
}
- public void setUseEntitlements(Boolean useEntitlements) {
- this.useEntitlements = useEntitlements.booleanValue();
+ public void setUseDataRoles(Boolean useEntitlements) {
+ this.useDataRoles = useEntitlements.booleanValue();
}
@ManagementProperty(description="Long running query threshold, after which a alert can be generated by tooling if configured")
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 2010-08-11 03:42:11 UTC (rev 2436)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2010-08-11 15:42:11 UTC (rev 2437)
@@ -624,7 +624,7 @@
public void start(DQPConfiguration config) {
this.processorTimeslice = config.getTimeSliceInMilli();
this.maxFetchSize = config.getMaxRowsFetchSize();
- this.useEntitlements = config.useEntitlements();
+ this.useEntitlements = config.useDataRoles();
this.queryThreshold = config.getQueryThresholdInSecs();
this.maxSourceRows = config.getMaxSourceRows();
this.exceptionOnMaxSourceRows = config.isExceptionOnMaxSourceRows();
15 years, 8 months
teiid SVN: r2436 - in trunk: client/src/main/java/org/teiid/adminapi/impl and 7 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-10 23:42:11 -0400 (Tue, 10 Aug 2010)
New Revision: 2436
Modified:
trunk/api/src/main/java/org/teiid/logging/LogConstants.java
trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
trunk/engine/src/main/java/org/teiid/common/buffer/TupleBrowser.java
trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/ListNestedSortComparator.java
trunk/engine/src/main/java/org/teiid/query/tempdata/IndexCondition.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties
trunk/engine/src/test/java/org/teiid/query/processor/TestTempTables.java
Log:
TEIID-168 updating mat logic, improving index support, adding logs for mat view loads
Modified: trunk/api/src/main/java/org/teiid/logging/LogConstants.java
===================================================================
--- trunk/api/src/main/java/org/teiid/logging/LogConstants.java 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/api/src/main/java/org/teiid/logging/LogConstants.java 2010-08-11 03:42:11 UTC (rev 2436)
@@ -43,6 +43,7 @@
public static final String CTX_QUERY_RESOLVER = CTX_QUERY_PLANNER + ".RESOLVER"; //$NON-NLS-1$
public static final String CTX_XML_PLANNER = CTX_QUERY_PLANNER + ".XML_PLANNER"; //$NON-NLS-1$
public static final String CTX_XML_PLAN = CTX_DQP + ".XML_PLAN"; //$NON-NLS-1$
+ public static final String CTX_MATVIEWS = CTX_DQP + ".MATVIEWS"; //$NON-NLS-1$
public static final String CTX_WS = LogConstants.CTX_CONNECTOR + ".WS"; //$NON-NLS-1$
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-08-11 03:42:11 UTC (rev 2436)
@@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import javax.xml.bind.annotation.XmlAccessType;
@@ -199,6 +200,10 @@
return new ArrayList<Model>(this.models.getMap().values());
}
+ public Map<String, ModelMetaData> getModelMetaDatas() {
+ return this.models.getMap();
+ }
+
/**
* This method required to make the JNDI assignment on the model work; if not persistent Management framework
* treating "models" as ReadOnly property. The actual assignment is done in the VDBMetaDataClassInstancefactory
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml 2010-08-11 03:42:11 UTC (rev 2436)
@@ -229,7 +229,7 @@
The optional join hint is applied as a comment on a join clause.
<example>
<title>Example Optional Join Hint</title>
- <programlisting>select a.column1, b.column2 from a inner join /* optional */ b on a.key = b.key</programlisting>
+ <programlisting>select a.column1, b.column2 from a inner join /*+ optional */ b on a.key = b.key</programlisting>
</example>
</para>
<para> Suppose that the preceding example defined a view layer X.
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/TupleBrowser.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/TupleBrowser.java 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/TupleBrowser.java 2010-08-11 03:42:11 UTC (rev 2436)
@@ -82,7 +82,7 @@
boolean valid = true;
if (upperBound != null) {
- if (this.tree.comparator.compare(upperBound, lowerBound) < 0) {
+ if (lowerBound != null && this.tree.comparator.compare(upperBound, lowerBound) < 0) {
valid = false;
}
LinkedList<SearchResult> places = new LinkedList<SearchResult>();
Modified: trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java 2010-08-11 03:42:11 UTC (rev 2436)
@@ -48,7 +48,7 @@
public class QueryProcessor implements BatchProducer {
public static class ExpiredTimeSliceException extends TeiidRuntimeException {
-
+ private static final long serialVersionUID = 4585044674826578060L;
}
private static ExpiredTimeSliceException EXPIRED_TIME_SLICE = new ExpiredTimeSliceException();
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/ListNestedSortComparator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/ListNestedSortComparator.java 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/ListNestedSortComparator.java 2010-08-11 03:42:11 UTC (rev 2436)
@@ -138,7 +138,13 @@
public int compare(java.util.List<T> list1, java.util.List<T> list2) {
int compare = 0;
for (int k = 0; k < sortParameters.length; k++) {
+ if (list1.size() <= sortParameters[k]) {
+ return 1;
+ }
T param1 = list1.get(sortParameters[k]);
+ if (list2.size() <= sortParameters[k]) {
+ return -1;
+ }
T param2 = list2.get(sortParameters[k]);
if( param1 == null ) {
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/IndexCondition.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/IndexCondition.java 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/IndexCondition.java 2010-08-11 03:42:11 UTC (rev 2436)
@@ -43,9 +43,6 @@
List<Criteria> crits = Criteria.separateCriteriaByAnd(condition);
IndexCondition[] conditions = new IndexCondition[keyColumns.size()];
for (int i = 0; i < conditions.length; i++) {
- if (i > 0 && conditions[i - 1].valueSet.size() != 1) {
- break; //don't yet support any other types of composite key lookups
- }
conditions[i] = new IndexCondition();
ElementSymbol keyColumn = keyColumns.get(i);
for (Iterator<Criteria> critIter = crits.iterator(); critIter.hasNext();) {
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java 2010-08-11 03:42:11 UTC (rev 2436)
@@ -23,7 +23,7 @@
package org.teiid.query.tempdata;
import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -365,26 +365,48 @@
List<List<Object>> values = null;
if (condition != null && rowId == null) {
IndexCondition[] indexConditions = IndexCondition.getIndexConditions(condition, columns.subList(0, tree.getKeyLength()));
- if (indexConditions.length > 1 && indexConditions[indexConditions.length - 1] != null) {
- List<Object> value = new ArrayList<Object>(indexConditions.length);
- for (IndexCondition indexCondition : indexConditions) {
- value.add(indexCondition.valueSet.iterator().next().getValue());
+ for (int i = 0; i < indexConditions.length; i++) {
+ IndexCondition indexCondition = indexConditions[i];
+ if (indexCondition.lower != null) {
+ if (i == 0) {
+ lower = new ArrayList<Object>(tree.getKeyLength());
+ lower.add(indexCondition.lower.getValue());
+ } if (lower != null && lower.size() == i) {
+ lower.add(indexCondition.lower.getValue());
+ }
+ }
+ if (indexCondition.upper != null) {
+ if (i == 0) {
+ upper = new ArrayList<Object>(tree.getKeyLength());
+ upper.add(indexCondition.upper.getValue());
+ } else if (upper != null && upper.size() == i) {
+ upper.add(indexCondition.upper.getValue());
+ }
+ }
+ if (!indexCondition.valueSet.isEmpty()) {
+ if (i == 0) {
+ values = new ArrayList<List<Object>>();
+ for (Constant constant : indexCondition.valueSet) {
+ List<Object> value = new ArrayList<Object>(tree.getKeyLength());
+ value.add(constant.getValue());
+ values.add(value);
+ }
+ } else if (values != null && values.size() == 1 && indexCondition.valueSet.size() == 1) {
+ values.iterator().next().add(indexCondition.valueSet.first().getValue());
+ }
}
- values = new ArrayList<List<Object>>(1);
- values.add(value);
- //TODO: support other composite key lookups
- } else {
- if (indexConditions[0].lower != null) {
- lower = Arrays.asList(indexConditions[0].lower.getValue());
- }
- if (indexConditions[0].upper != null) {
- upper = Arrays.asList(indexConditions[0].upper.getValue());
- }
- if (!indexConditions[0].valueSet.isEmpty()) {
- values = new ArrayList<List<Object>>();
- for (Constant constant : indexConditions[0].valueSet) {
- values.add(Arrays.asList(constant.getValue()));
+ }
+ if (indexConditions.length > 0) {
+ if (values != null) {
+ List<Object> value = values.iterator().next();
+ if (value.size() != tree.getKeyLength()) {
+ values = null;
+ lower = new ArrayList<Object>(value);
+ lower.addAll(Collections.nCopies(tree.getKeyLength() - value.size(), null));
+ upper = new ArrayList<Object>(value);
}
+ } else if (lower != null) {
+ lower.addAll(Collections.nCopies(tree.getKeyLength() - lower.size(), null));
}
}
}
@@ -553,5 +575,12 @@
CacheHint getCacheHint() {
return this.tid.getCacheHint();
}
+
+ int getPkLength() {
+ if (rowId != null) {
+ return 0;
+ }
+ return this.tree.getKeyLength();
+ }
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2010-08-11 03:42:11 UTC (rev 2436)
@@ -36,6 +36,8 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.language.SQLConstants.Reserved;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.mapping.relational.QueryNode;
@@ -209,7 +211,7 @@
TempTableStore globalStore, MatTableInfo info)
throws QueryMetadataException, TeiidComponentException,
TeiidProcessingException, ExpressionEvaluationException {
- TempTable table;
+ LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryExecPlugin.Util.getString("TempTableDataManager.loading", tableName)); //$NON-NLS-1$
QueryMetadataInterface metadata = context.getMetadata();
Create create = new Create();
create.setTable(group);
@@ -220,7 +222,7 @@
create.getPrimaryKey().add(create.getColumns().get(metadata.getPosition(col)-1));
}
}
- table = globalStore.addTempTable(tableName, create, bufferManager);
+ TempTable table = globalStore.addTempTable(tableName, create, bufferManager);
table.setUpdatable(false);
CacheHint hint = table.getCacheHint();
if (hint != null) {
@@ -229,7 +231,7 @@
info.setTtl(table.getCacheHint().getTtl());
}
}
- boolean success = false;
+ int rowCount = -1;
try {
//TODO: order by primary key nulls first - then have an insert ordered optimization
//TODO: use the getCommand logic in RelationalPlanner to reuse commands for this.
@@ -239,12 +241,16 @@
TupleSource ts = new BatchCollector.BatchProducerTupleSource(qp);
//TODO: if this insert fails, it's unnecessary to do the undo processing
table.insert(ts, table.getColumns());
- success = true;
+ rowCount = table.getRowCount();
} finally {
- if (!success) {
+ if (rowCount == -1) {
globalStore.removeTempTableByName(tableName);
+ info.setState(MatState.FAILED_LOAD);
+ LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryExecPlugin.Util.getString("TempTableDataManager.failed_load", tableName)); //$NON-NLS-1$
+ } else {
+ info.setState(MatState.LOADED);
+ LogManager.logInfo(LogConstants.CTX_MATVIEWS, QueryExecPlugin.Util.getString("TempTableDataManager.loaded", tableName, rowCount)); //$NON-NLS-1$
}
- info.setState(success?MatState.LOADED:MatState.FAILED_LOAD);
}
return table;
}
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2010-08-11 03:42:11 UTC (rev 2436)
@@ -55,6 +55,7 @@
private long updateTime = -1;
private MatState state = MatState.NOT_LOADED;
private long ttl = -1;
+ private boolean valid;
synchronized boolean shouldLoad() throws TeiidComponentException {
for (;;) {
@@ -65,6 +66,9 @@
state = MatState.LOADING;
return true;
case LOADING:
+ if (valid) {
+ return false;
+ }
try {
wait();
} catch (InterruptedException e) {
@@ -81,10 +85,15 @@
}
}
- public synchronized void setState(MatState state) {
+ public synchronized MatState setState(MatState state) {
+ MatState oldState = this.state;
+ if (state == MatState.LOADED) {
+ valid = true;
+ }
this.state = state;
this.updateTime = System.currentTimeMillis();
notifyAll();
+ return oldState;
}
public synchronized void setTtl(long ttl) {
@@ -99,6 +108,14 @@
return state;
}
+ public boolean isValid() {
+ return valid;
+ }
+
+ public void setValid(boolean valid) {
+ this.valid = valid;
+ }
+
}
private ConcurrentHashMap<String, MatTableInfo> matTables = new ConcurrentHashMap<String, MatTableInfo>();
Modified: trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties 2010-08-11 03:42:11 UTC (rev 2436)
@@ -221,3 +221,7 @@
XMLTableNode.error=Error evaluating XQuery row context for XMLTable: {0}
XMLTableNode.path_error=Error evaluating XMLTable column path expression for column: {0}
XMLTableName.multi_value=Unexpected multi-valued result was returned for XMLTable column "{0}". Path expressions for non-XML type columns should return at most a single result.
+
+TempTableDataManager.failed_load=Failed to load MatView {0}
+TempTableDataManager.loaded=Loaded MatView {0} with row count {1}
+TempTableDataManager.loading=Loading MatView {0}
\ No newline at end of file
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestTempTables.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestTempTables.java 2010-08-10 19:58:37 UTC (rev 2435)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestTempTables.java 2010-08-11 03:42:11 UTC (rev 2436)
@@ -212,4 +212,16 @@
execute("select * from x where e1 = 'b' and e2 = 2", new List[] {Arrays.asList("b", 2)}); //$NON-NLS-1$
}
+ @Test public void testCompositeKeyPartial() throws Exception {
+ execute("create local temporary table x (e1 string, e2 integer, primary key (e1, e2))", new List[] {Arrays.asList(0)}); //$NON-NLS-1$
+ execute("insert into x (e2, e1) values (3, 'b')", new List[] {Arrays.asList(1)}); //$NON-NLS-1$
+ execute("insert into x (e2, e1) values (2, 'b')", new List[] {Arrays.asList(1)}); //$NON-NLS-1$
+ execute("insert into x (e2, e1) values (1, 'c')", new List[] {Arrays.asList(1)}); //$NON-NLS-1$
+ execute("insert into x (e2, e1) values (1, 'a')", new List[] {Arrays.asList(1)}); //$NON-NLS-1$
+ execute("select * from x where e1 = 'b'", new List[] {Arrays.asList("b", 2), Arrays.asList("b", 3)}); //$NON-NLS-1$
+ execute("select * from x where e1 < 'c'", new List[] {Arrays.asList("a", 1), Arrays.asList("b", 2), Arrays.asList("b", 3)}); //$NON-NLS-1$
+ execute("select * from x where e2 = 1", new List[] {Arrays.asList("a", 1), Arrays.asList("c", 1)}); //$NON-NLS-1$
+ execute("select * from x where e1 >= 'b'", new List[] {Arrays.asList("b", 2), Arrays.asList("b", 3), Arrays.asList("c", 1)}); //$NON-NLS-1$
+ }
+
}
15 years, 8 months
teiid SVN: r2435 - in trunk/console/src/main: resources/META-INF and 1 other directory.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-08-10 15:58:37 -0400 (Tue, 10 Aug 2010)
New Revision: 2435
Modified:
trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
TEIID-1189: Changed resource key to be unique to allow for multiple versions of a vdb
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java 2010-08-10 14:51:15 UTC (rev 2434)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java 2010-08-10 19:58:37 UTC (rev 2435)
@@ -61,9 +61,8 @@
for (ManagedComponent mcVdb : vdbs) {
- String vdbKey = mcVdb.getDeployment().getName();
- String vdbName = ProfileServiceUtil.getSimpleValue(mcVdb, "name",
- String.class);
+ String vdbKey = (String)mcVdb.getName();
+ String vdbName = vdbKey;
String fullName = ProfileServiceUtil.getSimpleValue(mcVdb, "fullName",
String.class);
Integer vdbVersion = ProfileServiceUtil.getSimpleValue(mcVdb,
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-08-10 14:51:15 UTC (rev 2434)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-08-10 19:58:37 UTC (rev 2435)
@@ -443,6 +443,8 @@
hiddenByDefault="false">
<c:simple-property name="name" type="string"
description="The Virtual Database Name" required="false" readOnly="true" />
+ <c:simple-property name="fullName" type="string"
+ description="The fully qualified Virtual Database Name" required="false" readOnly="true" />
<c:simple-property name="version" type="string"
description="The Virtual Database Version" required="false"
readOnly="true" />
@@ -458,7 +460,8 @@
</c:property-options>
</c:simple-property>
<c:simple-property name="connectionType" type="string"
- description="Connections to allow to this Virtual Database" required="false">
+ description="Connections to allow to this Virtual Database"
+ required="false">
<c:property-options>
<c:option value="NONE" name="NONE" />
<c:option value="BY_VERSION" name="BY VERSION" default="true" />
@@ -484,7 +487,7 @@
required="false" readOnly="true" />
<c:simple-property name="propertyValue"
displayName="Property Value" description="Property Value"
- required="false" readOnly="true"/>
+ required="false" readOnly="true" />
</c:map-property>
</c:list-property>
</c:group>
15 years, 8 months
teiid SVN: r2434 - in trunk: build/kits/jboss-container/deploy/teiid and 5 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-08-10 10:51:15 -0400 (Tue, 10 Aug 2010)
New Revision: 2434
Added:
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ExpirationAwareCache.java
Removed:
trunk/cache-jbosscache/src/main/java/com/metamatrix/cache/
Modified:
trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml
trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
Log:
TEIID-1104: Configuring resultset cache as expirable cache.
Modified: trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml
===================================================================
--- trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml 2010-08-10 11:01:40 UTC (rev 2433)
+++ trunk/build/kits/jboss-container/conf/jboss-teiid-log4j.xml 2010-08-10 14:51:15 UTC (rev 2434)
@@ -7,8 +7,13 @@
<!-- Teiid root category snippet. Use this to control all of Teiid logging from a single category -->
<logger name="org.teiid">
<level value="INFO" />
- </logger>
+ </logger>
+ <!-- this is to avoid the "Unable to remove nodes to reduce region size below 1024. Set expiration for nodes in this region" error -->
+ <logger name="org.jboss.cache">
+ <level value="ERROR" />
+ </logger>
+
<!-- Other categories:
org.teiid.PROCESSOR - Query processing logs. See also org.teiid.PLANNER for query planning logs.
Modified: trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-08-10 11:01:40 UTC (rev 2433)
+++ trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-08-10 14:51:15 UTC (rev 2434)
@@ -49,6 +49,16 @@
<property name="clusteredCacheName">mvcc-shared</property>
</bean>
+ <bean name="ResultsetCacheConfig" class="org.teiid.cache.CacheConfiguration">
+ <property name="enabled">true</property>
+ <!-- Max Entries allowed for ResultSet Cache -->
+ <property name="maxEntries">1024</property>
+ <!-- 2 hrs -->
+ <property name="maxAgeInSeconds">7200</property>
+ <!-- Allowed values are LRU, FIFO, LFU, EXPIRATION -->
+ <property name="type">EXPIRATION</property>
+ </bean>
+
<bean name="RuntimeEngineDeployer" class="org.teiid.jboss.deployers.RuntimeEngineDeployer">
<property name="jndiName">teiid/engine-deployer</property>
<property name="profileService"><inject bean="ProfileService"/></property>
@@ -63,8 +73,8 @@
<property name="securityHelper"><inject bean="SecurityHelper"/></property>
<property name="VDBRepository"><inject bean="VDBRepository"/></property>
<property name="cacheFactory"><inject bean="CacheFactory"/></property>
+ <property name="resultsetCacheConfig"><inject bean="ResultsetCacheConfig"/></property>
-
<!-- Process pool maximum thread count. (default 64) -->
<property name="maxThreads">64</property>
<!-- Max active plans (default 20). Increase this value on highly concurrent systems - but ensure that the underlying pools can handle the increased load without timeouts. -->
@@ -77,10 +87,6 @@
<property name="lobChunkSizeInKB">100</property>
<!-- The maximum number of query plans that are cached. Note: this is a memory based cache. (default 250) -->
<property name="preparedPlanCacheMaxCount">250</property>
- <!-- Max Entries allowed for ResultSet Cache -->
- <property name="resultSetCacheMaxEntries">1024</property>
- <!-- Enable Resultset Caching -->
- <property name="resultSetCacheEnabled">true</property>
<!-- Turn on checking the entitlements on resources based on the roles defined in VDB -->
<property name="useEntitlements" class="java.lang.Boolean">false</property>
<!-- Long running query threshold, after which a alert can be generated by tooling if configured-->
Added: trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ExpirationAwareCache.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ExpirationAwareCache.java (rev 0)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ExpirationAwareCache.java 2010-08-10 14:51:15 UTC (rev 2434)
@@ -0,0 +1,62 @@
+/*
+ * 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.cache.jboss;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Node;
+import org.jboss.cache.eviction.ExpirationAlgorithmConfig;
+
+public class ExpirationAwareCache<K, V> extends JBossCache<K, V> {
+
+ public ExpirationAwareCache(Cache cacheStore, Fqn fqn) {
+ super(cacheStore, fqn);
+ }
+
+ @Override
+ public V get(K key) {
+ Node<K, V> node = getRootNode();
+ Node child = node.getChild(Fqn.fromString(String.valueOf(key.getClass().getSimpleName()+key.hashCode())));
+ if (child != null) {
+ return (V)child.get(key);
+ }
+ return super.get(key);
+ }
+
+ @Override
+ public V put(K key, V value) {
+ Node<K, V> node = getRootNode();
+ Node child = node.addChild(Fqn.fromString(String.valueOf(key.getClass().getSimpleName()+key.hashCode())));
+ Long future = new Long(System.currentTimeMillis() + (config.getMaxAgeInSeconds()*1000));
+ child.put(ExpirationAlgorithmConfig.EXPIRATION_KEY, future);
+ return (V)child.put(key, value);
+ }
+
+ @Override
+ public org.teiid.cache.Cache<K, V> addChild(String name) {
+ Node<K, V> node = getRootNode();
+ Node child = node.addChild(Fqn.fromString(name));
+ child.put(ExpirationAlgorithmConfig.EXPIRATION_KEY, Long.MAX_VALUE);
+ return new JBossCache<K, V>(this.cacheStore, child.getFqn());
+ }
+
+}
Property changes on: trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ExpirationAwareCache.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java 2010-08-10 11:01:40 UTC (rev 2433)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java 2010-08-10 14:51:15 UTC (rev 2434)
@@ -31,6 +31,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
import org.teiid.cache.Cache;
+import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.CacheListener;
@@ -39,9 +40,10 @@
*/
public class JBossCache<K, V> implements Cache<K, V> {
- private org.jboss.cache.Cache<K, V> cacheStore;
- private Fqn rootFqn;
- private JBossCacheListener cacheListener;
+ protected org.jboss.cache.Cache<K, V> cacheStore;
+ protected Fqn rootFqn;
+ protected JBossCacheListener cacheListener;
+ protected CacheConfiguration config;
public JBossCache(org.jboss.cache.Cache<K, V> cacheStore, Fqn fqn) {
this.cacheStore = cacheStore;
@@ -149,7 +151,7 @@
return null;
}
- private Node<K, V> getRootNode() {
+ protected Node<K, V> getRootNode() {
Node<K, V> node = this.cacheStore.getNode(this.rootFqn);
if (node == null) {
throw new IllegalStateException("Cache Node "+ this.rootFqn +" not found."); //$NON-NLS-1$ //$NON-NLS-2$
@@ -186,5 +188,9 @@
@Override
public String getName() {
return this.rootFqn.toString();
- }
+ }
+
+ void setCacheConfiguration(CacheConfiguration config) {
+ this.config = config;
+ }
}
Modified: trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2010-08-10 11:01:40 UTC (rev 2433)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2010-08-10 14:51:15 UTC (rev 2434)
@@ -30,9 +30,11 @@
import org.jboss.cache.Region;
import org.jboss.cache.config.EvictionAlgorithmConfig;
import org.jboss.cache.config.EvictionRegionConfig;
+import org.jboss.cache.eviction.ExpirationAlgorithmConfig;
import org.jboss.cache.eviction.FIFOAlgorithmConfig;
import org.jboss.cache.eviction.LFUAlgorithmConfig;
import org.jboss.cache.eviction.LRUAlgorithmConfig;
+import org.jboss.cache.eviction.RemoveOnEvictActionPolicy;
import org.teiid.cache.Cache;
import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.CacheFactory;
@@ -64,39 +66,61 @@
Node cacheRoot = this.cacheStore.getRoot().addChild(Fqn.fromString("Teiid")); //$NON-NLS-1$
Node node = cacheRoot.addChild(Fqn.fromString(type.location()));
+ node.put(ExpirationAlgorithmConfig.EXPIRATION_KEY, Long.MAX_VALUE);
+ node.setResident(true);
Region cacheRegion = this.cacheStore.getRegion(node.getFqn(), true);
- EvictionRegionConfig erc = new EvictionRegionConfig(node.getFqn(), buildEvictionAlgorithmConfig(config));
- cacheRegion.setEvictionRegionConfig(erc);
+ cacheRegion.setEvictionRegionConfig(buildEvictionConfig(node.getFqn(), config));
+
+ JBossCache jc = null;
+ if (config != null && config.getPolicy().equals(Policy.EXPIRATION)) {
+ jc = new ExpirationAwareCache(this.cacheStore, node.getFqn());
+ }
+ else {
+ jc = new JBossCache(this.cacheStore, node.getFqn());
+ }
- return new JBossCache(this.cacheStore, node.getFqn());
+ jc.setCacheConfiguration(config);
+ return jc;
}
throw new TeiidRuntimeException("Cache system has been shutdown"); //$NON-NLS-1$
}
-
- private EvictionAlgorithmConfig buildEvictionAlgorithmConfig(CacheConfiguration config) {
+
+ private EvictionRegionConfig buildEvictionConfig(Fqn rootFqn, CacheConfiguration config) {
EvictionAlgorithmConfig evictionConfig = null;
if (config.getPolicy() == Policy.LRU) {
LRUAlgorithmConfig lru = new LRUAlgorithmConfig();
- lru.setMaxNodes(config.getMaxNodes());
+ lru.setMaxNodes(config.getMaxEntries());
lru.setMaxAge(config.getMaxAgeInSeconds()*1000);
lru.setTimeToLive(-1); // -1 no limit
evictionConfig = lru;
}
else if (config.getPolicy() == Policy.FIFO) {
FIFOAlgorithmConfig fifo = new FIFOAlgorithmConfig();
- fifo.setMaxNodes(config.getMaxNodes());
+ fifo.setMaxNodes(config.getMaxEntries());
evictionConfig = fifo;
}
else if (config.getPolicy() == Policy.LFU) {
LFUAlgorithmConfig lfu = new LFUAlgorithmConfig();
- lfu.setMaxNodes(config.getMaxNodes());
+ lfu.setMaxNodes(config.getMaxEntries());
evictionConfig = lfu;
}
- return evictionConfig;
- }
+ else if (config.getPolicy() == Policy.EXPIRATION) {
+ ExpirationAlgorithmConfig lfu = new ExpirationAlgorithmConfig();
+ lfu.setMaxNodes(config.getMaxEntries());
+ evictionConfig = lfu;
+ }
+
+ EvictionRegionConfig erc = new EvictionRegionConfig(rootFqn, evictionConfig);
+
+ if (config.getPolicy() == Policy.EXPIRATION) {
+ erc.setEvictionActionPolicyClassName(RemoveOnEvictActionPolicy.class.getName());
+ }
+ return erc;
+ }
+
public void destroy() {
this.destroyed = true;
}
Modified: trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java 2010-08-10 11:01:40 UTC (rev 2433)
+++ trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java 2010-08-10 14:51:15 UTC (rev 2434)
@@ -29,17 +29,22 @@
public enum Policy {
LRU, // Least Recently Used
FIFO, // First in First Out
- LFU; // Least frequently Used
+ LFU, // Least frequently Used
+ EXPIRATION; // expires after certain time.
}
private Policy policy;
private int maxage;
- private int maxnodes;
+ private int maxEntries;
+ private boolean enabled = true;
+ public CacheConfiguration() {
+ }
+
public CacheConfiguration(Policy policy, int maxAgeInSeconds, int maxNodes) {
this.policy = policy;
this.maxage = maxAgeInSeconds;
- this.maxnodes = maxNodes;
+ this.maxEntries = maxNodes;
}
public Policy getPolicy() {
@@ -49,8 +54,59 @@
public int getMaxAgeInSeconds(){
return maxage;
}
+
+ public void setMaxAgeInSeconds(int maxage){
+ this.maxage = maxage;
+ }
- public int getMaxNodes() {
- return this.maxnodes;
+ public int getMaxEntries() {
+ return this.maxEntries;
}
+
+ public void setMaxEntries(int entries) {
+ this.maxEntries = entries;
+ }
+
+ public void setType (String type) {
+ this.policy = Policy.valueOf(type);
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + maxage;
+ result = prime * result + maxEntries;
+ result = prime * result + ((policy == null) ? 0 : policy.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ CacheConfiguration other = (CacheConfiguration) obj;
+ if (maxage != other.maxage)
+ return false;
+ if (maxEntries != other.maxEntries)
+ return false;
+ if (policy == null) {
+ if (other.policy != null)
+ return false;
+ } else if (!policy.equals(other.policy))
+ return false;
+ return true;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2010-08-10 11:01:40 UTC (rev 2433)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2010-08-10 14:51:15 UTC (rev 2434)
@@ -22,6 +22,7 @@
package org.teiid.dqp.internal.process;
import org.jboss.managed.api.annotation.ManagementProperty;
+import org.teiid.cache.CacheConfiguration;
import org.teiid.client.RequestMessage;
import org.teiid.core.util.ApplicationInfo;
@@ -43,13 +44,12 @@
private int maxRowsFetchSize = DEFAULT_FETCH_SIZE;
private int lobChunkSizeInKB = 100;
private int preparedPlanCacheMaxCount = SessionAwareCache.DEFAULT_MAX_SIZE_TOTAL;
- private boolean resultSetCacheEnabled = true;
- private int maxResultSetCacheEntries = DQPConfiguration.DEFAULT_MAX_RESULTSET_CACHE_ENTRIES;
private boolean useEntitlements = false;
private int queryThresholdInSecs = DEFAULT_QUERY_THRESHOLD;
private boolean exceptionOnMaxSourceRows = true;
private int maxSourceRows = -1;
private int maxActivePlans = DEFAULT_MAX_ACTIVE_PLANS;
+ private CacheConfiguration resultsetCacheConfig;
@ManagementProperty(description="Max active plans (default 20). Increase this value, and max threads, on highly concurrent systems - but ensure that the underlying pools can handle the increased load without timeouts.")
public int getMaxActivePlans() {
@@ -107,22 +107,22 @@
@ManagementProperty(description="The maximum number of result set cache entries. 0 indicates no limit. (default 1024)")
public int getResultSetCacheMaxEntries() {
- return this.maxResultSetCacheEntries;
+ return this.resultsetCacheConfig.getMaxEntries();
}
- public void setResultSetCacheMaxEntries(int value) {
- this.maxResultSetCacheEntries = value;
+ public CacheConfiguration getResultsetCacheConfig() {
+ return this.resultsetCacheConfig;
+ }
+
+ public void setResultsetCacheConfig(CacheConfiguration config) {
+ this.resultsetCacheConfig = config;
}
-
+
@ManagementProperty(description="Denotes whether or not result set caching is enabled. (default true)")
public boolean isResultSetCacheEnabled() {
- return this.resultSetCacheEnabled;
+ return this.resultsetCacheConfig.isEnabled();
}
-
- public void setResultSetCacheEnabled(boolean value) {
- this.resultSetCacheEnabled = value;
- }
-
+
/**
* Determine whether entitlements checking is enabled on the server.
* @return <code>true</code> if server-side entitlements checking is enabled.
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 2010-08-10 11:01:40 UTC (rev 2433)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2010-08-10 14:51:15 UTC (rev 2434)
@@ -44,7 +44,9 @@
import org.teiid.adminapi.impl.RequestMetadata;
import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
import org.teiid.cache.Cache;
+import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.CacheFactory;
+import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.client.DQP;
import org.teiid.client.RequestMessage;
import org.teiid.client.ResultsMessage;
@@ -630,13 +632,14 @@
this.chunkSize = config.getLobChunkSizeInKB() * 1024;
//result set cache
- if (config.isResultSetCacheEnabled()) {
- this.rsCache = new SessionAwareCache<CachedResults>(config.getResultSetCacheMaxEntries(), this.cacheFactory, Cache.Type.RESULTSET);
+ CacheConfiguration rsCacheConfig = config.getResultsetCacheConfig();
+ if (rsCacheConfig != null && rsCacheConfig.isEnabled()) {
+ this.rsCache = new SessionAwareCache<CachedResults>(this.cacheFactory, Cache.Type.RESULTSET, rsCacheConfig);
this.rsCache.setBufferManager(this.bufferManager);
}
//prepared plan cache
- prepPlanCache = new SessionAwareCache<PreparedPlan>(config.getPreparedPlanCacheMaxCount(), this.cacheFactory, Cache.Type.PREPAREDPLAN);
+ prepPlanCache = new SessionAwareCache<PreparedPlan>(this.cacheFactory, Cache.Type.PREPAREDPLAN, new CacheConfiguration(Policy.LRU, 60, config.getPreparedPlanCacheMaxCount()));
prepPlanCache.setBufferManager(this.bufferManager);
//get buffer manager
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2010-08-10 11:01:40 UTC (rev 2433)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2010-08-10 14:51:15 UTC (rev 2434)
@@ -33,6 +33,7 @@
import org.teiid.cache.CacheFactory;
import org.teiid.cache.DefaultCache;
import org.teiid.cache.DefaultCacheFactory;
+import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.util.EquivalenceUtil;
import org.teiid.core.util.HashCodeUtil;
@@ -50,32 +51,32 @@
private Cache<CacheID, T> localCache;
private Cache<CacheID, T> distributedCache;
- private int maxSize;
+ private int maxSize = DEFAULT_MAX_SIZE_TOTAL;
private AtomicInteger cacheHit = new AtomicInteger();
private BufferManager bufferManager;
SessionAwareCache(){
- this(DEFAULT_MAX_SIZE_TOTAL, new DefaultCacheFactory(), Cache.Type.RESULTSET);
+ this(new DefaultCacheFactory(), Cache.Type.RESULTSET, new CacheConfiguration(Policy.LRU, 60, DEFAULT_MAX_SIZE_TOTAL));
}
SessionAwareCache(int maxSize){
- this(maxSize, new DefaultCacheFactory(), Cache.Type.RESULTSET);
+ this(new DefaultCacheFactory(), Cache.Type.RESULTSET, new CacheConfiguration(Policy.LRU, 60, maxSize));
}
- SessionAwareCache (int maxSize, final CacheFactory cacheFactory, final Cache.Type type){
- if(maxSize < 0){
- maxSize = DEFAULT_MAX_SIZE_TOTAL;
- }
- this.maxSize = maxSize;
+ SessionAwareCache (final CacheFactory cacheFactory, final Cache.Type type, final CacheConfiguration config){
+ this.maxSize = config.getMaxEntries();
+ if(this.maxSize < 0){
+ this.maxSize = DEFAULT_MAX_SIZE_TOTAL;
+ }
this.localCache = new DefaultCache<CacheID, T>("local", maxSize); //$NON-NLS-1$
if (type == Cache.Type.PREPAREDPLAN) {
this.distributedCache = localCache;
}
else {
- this.distributedCache = cacheFactory.get(type, new CacheConfiguration(CacheConfiguration.Policy.LRU, -1, SessionAwareCache.this.maxSize));
+ this.distributedCache = cacheFactory.get(type, config);
}
}
@@ -238,5 +239,6 @@
public void setBufferManager(BufferManager bufferManager) {
this.bufferManager = bufferManager;
- }
+ }
+
}
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2010-08-10 11:01:40 UTC (rev 2433)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2010-08-10 14:51:15 UTC (rev 2434)
@@ -30,7 +30,9 @@
import org.teiid.adminapi.VDB;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.DefaultCacheFactory;
+import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.client.DQP;
import org.teiid.client.security.ILogon;
import org.teiid.deployers.MetadataStoreGroup;
@@ -82,8 +84,10 @@
}
});
+ DQPConfiguration config = new DQPConfiguration();
+ config.setResultsetCacheConfig(new CacheConfiguration(Policy.LRU, 60, 250));
this.dqp.setCacheFactory(new DefaultCacheFactory());
- this.dqp.start(new DQPConfiguration());
+ this.dqp.start(config);
this.sessionService.setDqp(this.dqp);
registerClientService(ILogon.class, logon, null);
15 years, 8 months
teiid SVN: r2433 - in trunk: engine/src/main/java/org/teiid/dqp/internal/process and 15 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-10 07:01:40 -0400 (Tue, 10 Aug 2010)
New Revision: 2433
Added:
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestMatViews.java
trunk/test-integration/common/src/test/resources/matviews.vdb
Modified:
trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
trunk/engine/src/main/java/org/teiid/query/sql/LanguageObject.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/Command.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java
trunk/engine/src/test/java/org/teiid/dqp/message/TestAtomicRequestMessage.java
trunk/metadata/src/main/resources/System.vdb
trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCSchema.java
trunk/test-integration/common/src/test/resources/TestCase3473/testGetTables.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_allTables.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_specificTableMultipleTypes.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_specificTableTypes.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_CLASS.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testColumns.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTables.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTableIsSystem.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected
Log:
TEIID-168 adding pref_mem hint handling to rs caching, changing languageobjects to not be serializable (this is only currently needed for caching, but we can easily work around it). adding initial system reporting table on mat views. it is only really informational for default materialization.
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -72,6 +72,7 @@
private ArrayList<List<?>> batchBuffer;
private boolean removed;
private boolean forwardOnly;
+ private boolean prefersMemory;
private LobManager lobManager;
private int[] lobIndexes;
@@ -164,7 +165,7 @@
writeBatch.setTerminationFlag(true);
}
writeBatch.setDataTypes(types);
- BatchManager.ManagedBatch mbatch = manager.createManagedBatch(writeBatch, false);
+ BatchManager.ManagedBatch mbatch = manager.createManagedBatch(writeBatch, prefersMemory);
this.batches.put(writeBatch.getBeginRow(), mbatch);
batchBuffer = null;
}
@@ -314,4 +315,12 @@
return forwardOnly;
}
+ public void setPrefersMemory(boolean prefersMemory) {
+ this.prefersMemory = prefersMemory;
+ }
+
+ public boolean isPrefersMemory() {
+ return prefersMemory;
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -27,6 +27,8 @@
import java.util.List;
import java.util.UUID;
+import org.teiid.api.exception.query.QueryParserException;
+import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.cache.Cachable;
import org.teiid.cache.Cache;
import org.teiid.common.buffer.BufferManager;
@@ -34,22 +36,32 @@
import org.teiid.common.buffer.TupleBuffer;
import org.teiid.common.buffer.BufferManager.TupleSourceType;
import org.teiid.core.TeiidComponentException;
+import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.Assertion;
import org.teiid.dqp.DQPPlugin;
+import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.query.analysis.AnalysisRecord;
+import org.teiid.query.metadata.QueryMetadataInterface;
+import org.teiid.query.parser.ParseInfo;
+import org.teiid.query.parser.QueryParser;
+import org.teiid.query.resolver.QueryResolver;
+import org.teiid.query.sql.lang.CacheHint;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.symbol.ElementSymbol;
public class CachedResults implements Serializable, Cachable {
private static final long serialVersionUID = -5603182134635082207L;
- private Command command;
+ private transient Command command;
+ private transient TupleBuffer results;
+
private AnalysisRecord analysisRecord;
- private transient TupleBuffer results;
-
- private List<?> schema;
+
+ private String[] types;
+ private CacheHint hint;
private int batchSize;
protected ArrayList<UUID> cachedBatches = new ArrayList<UUID>();
@@ -68,15 +80,24 @@
public void setResults(TupleBuffer results) {
this.results = results;
- this.schema = results.getSchema();
this.batchSize = results.getBatchSize();
+ this.types = TupleBuffer.getTypeNames(results.getSchema());
}
public void setCommand(Command command) {
this.command = command;
+ this.hint = command.getCacheHint();
}
- public Command getCommand() {
+ public CacheHint getHint() {
+ return hint;
+ }
+
+ public synchronized Command getCommand(String sql, QueryMetadataInterface metadata, ParseInfo info) throws QueryParserException, QueryResolverException, TeiidComponentException {
+ if (command == null) {
+ command = QueryParser.getQueryParser().parseCommand(sql, info);
+ }
+ QueryResolver.resolveCommand(command, metadata);
return command;
}
@@ -102,9 +123,17 @@
public synchronized boolean restore(Cache cache, BufferManager bufferManager) {
try {
if (this.results == null) {
- TupleBuffer buffer = bufferManager.createTupleBuffer(this.schema, "cached", TupleSourceType.FINAL); //$NON-NLS-1$
+ List<ElementSymbol> schema = new ArrayList<ElementSymbol>(types.length);
+ for (String type : types) {
+ ElementSymbol es = new ElementSymbol("x"); //$NON-NLS-1$
+ es.setType(DataTypeManager.getDataTypeClass(type));
+ schema.add(es);
+ }
+ TupleBuffer buffer = bufferManager.createTupleBuffer(schema, "cached", TupleSourceType.FINAL); //$NON-NLS-1$
buffer.setBatchSize(this.batchSize);
-
+ if (this.hint != null) {
+ buffer.setPrefersMemory(this.hint.getPrefersMemory());
+ }
for (UUID uuid : this.cachedBatches) {
TupleBatch batch = (TupleBatch)cache.get(uuid);
if (batch != null) {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -23,6 +23,7 @@
package org.teiid.dqp.internal.process;
import java.sql.DatabaseMetaData;
+import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -64,7 +65,9 @@
import org.teiid.metadata.Schema;
import org.teiid.metadata.Table;
import org.teiid.query.metadata.CompositeMetadataStore;
+import org.teiid.query.metadata.TempMetadataID;
import org.teiid.query.metadata.TransformationMetadata;
+import org.teiid.query.optimizer.relational.RelationalPlanner;
import org.teiid.query.processor.CollectionTupleSource;
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.sql.lang.Command;
@@ -73,6 +76,8 @@
import org.teiid.query.sql.lang.UnaryFromClause;
import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.tempdata.TempTableStore;
+import org.teiid.query.tempdata.TempTableStore.MatTableInfo;
import org.teiid.query.util.CommandContext;
/**
@@ -92,7 +97,8 @@
KEYCOLUMNS,
PROCEDUREPARAMS,
REFERENCEKEYCOLUMNS,
- PROPERTIES
+ PROPERTIES,
+ MATVIEWS
}
private enum SystemProcs {
@@ -115,7 +121,7 @@
RequestWorkItem workItem = requestMgr.getRequestWorkItem((RequestID)context.getProcessorID());
if(CoreConstants.SYSTEM_MODEL.equals(modelName)) {
- return processSystemQuery(command, workItem.getDqpWorkContext());
+ return processSystemQuery(context, command, workItem.getDqpWorkContext());
}
AtomicRequestMessage aqr = createRequest(context.getProcessorID(), command, modelName, connectorBindingId, nodeID);
@@ -132,7 +138,7 @@
* @throws TeiidComponentException
*/
@SuppressWarnings("unchecked")
- private TupleSource processSystemQuery(Command command,
+ private TupleSource processSystemQuery(CommandContext context, Command command,
DQPWorkContext workContext) throws TeiidComponentException {
String vdbName = workContext.getVdbName();
int vdbVersion = workContext.getVdbVersion();
@@ -254,6 +260,33 @@
}
}
break;
+ case MATVIEWS:
+ if (table.isMaterialized()) {
+ String targetSchema = null;
+ String matTableName = null;
+ String state = null;
+ Timestamp updated = null;
+ Integer cardinaltity = null;
+
+ if (table.getMaterializedTable() == null) {
+ TempTableStore globalStore = context.getGlobalTableStore();
+ matTableName = RelationalPlanner.MAT_PREFIX+table.getFullName().toUpperCase();
+ MatTableInfo info = globalStore.getMatTableInfo(matTableName);
+ state = info.getState().name();
+ updated = info.getUpdateTime()==-1?null:new Timestamp(info.getUpdateTime());
+ TempMetadataID id = globalStore.getMetadataStore().getTempGroupID(matTableName);
+ if (id != null) {
+ cardinaltity = id.getCardinality();
+ }
+ //ttl, pref_mem
+ } else {
+ Table t = table.getMaterializedTable();
+ matTableName = t.getName();
+ targetSchema = t.getParent().getName();
+ }
+ rows.add(Arrays.asList(vdbName, schema.getName(), table.getName(), targetSchema, matTableName, state, updated, cardinaltity));
+ }
+ break;
}
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -60,6 +60,7 @@
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.function.metadata.FunctionMethod;
+import org.teiid.query.parser.ParseInfo;
import org.teiid.query.processor.BatchCollector;
import org.teiid.query.processor.QueryProcessor;
import org.teiid.query.sql.lang.Command;
@@ -333,25 +334,30 @@
protected void processNew() throws TeiidProcessingException, TeiidComponentException {
SessionAwareCache<CachedResults> rsCache = dqpCore.getRsCache();
- CacheID cacheId = new CacheID(this.dqpWorkContext, Request.createParseInfo(requestMsg), requestMsg.getCommandString());
+ ParseInfo pi = Request.createParseInfo(requestMsg);
+ CacheID cacheId = new CacheID(this.dqpWorkContext, pi, requestMsg.getCommandString());
cacheId.setParameters(requestMsg.getParameterValues());
if (rsCache != null) {
CachedResults cr = rsCache.get(cacheId);
- if (cr != null && (requestMsg.useResultSetCache() || cr.getCommand().isCache())) {
+ if (cr != null && (requestMsg.useResultSetCache() || cr.getHint() != null)) {
this.resultsBuffer = cr.getResults();
this.analysisRecord = cr.getAnalysisRecord();
- this.originalCommand = cr.getCommand();
+ request.initMetadata();
+ this.originalCommand = cr.getCommand(requestMsg.getCommandString(), request.metadata, pi);
this.doneProducingBatches();
return;
}
}
request.processRequest();
originalCommand = request.userCommand;
- if ((requestMsg.useResultSetCache() || originalCommand.isCache()) && rsCache != null && originalCommand.areResultsCachable()) {
+ if ((requestMsg.useResultSetCache() || originalCommand.getCacheHint() != null) && rsCache != null && originalCommand.areResultsCachable()) {
this.cid = cacheId;
}
processor = request.processor;
resultsBuffer = processor.createTupleBuffer();
+ if (this.cid != null) {
+ resultsBuffer.setPrefersMemory(originalCommand.getCacheHint().getPrefersMemory());
+ }
collector = new BatchCollector(processor, resultsBuffer) {
protected void flushBatchDirect(TupleBatch batch, boolean add) throws TeiidComponentException,TeiidProcessingException {
boolean added = false;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -196,6 +196,10 @@
}
}
+ public String getSql() {
+ return sql;
+ }
+
public void setUserName(String name) {
this.userName = name;
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -926,16 +926,14 @@
//not use cache
qnode = metadata.getVirtualPlan(metadataID);
//TODO: update the table for defaultMat
- recordMaterializationTableAnnotation(virtualGroup, analysisRecord, matTableName,
- QueryPlugin.Util.getString("SimpleQueryResolver.materialized_table_not_used", virtualGroup, matTableName)); //$NON-NLS-1$
+ recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.materialized_table_not_used", virtualGroup, matTableName)); //$NON-NLS-1$
}else{
qnode = new QueryNode(groupName, null);
Query query = createMatViewQuery(matMetadataId, matTableName, Arrays.asList(new AllSymbol()), isImplicitGlobal);
query.setCacheHint(hint);
qnode.setCommand(query);
cacheString = "matview"; //$NON-NLS-1$
- recordMaterializationTableAnnotation(virtualGroup, analysisRecord, matTableName,
- QueryPlugin.Util.getString("SimpleQueryResolver.Query_was_redirected_to_Mat_table", virtualGroup, matTableName)); //$NON-NLS-1$
+ recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.Query_was_redirected_to_Mat_table", virtualGroup, matTableName)); //$NON-NLS-1$
}
} else {
// Not a materialized view - query the primary transformation
@@ -986,15 +984,14 @@
//add timestamp?
Command c = getCommand(table, metadata.getVirtualPlan(table.getMetadataID()), SQLConstants.Reserved.SELECT, metadata);
CacheHint hint = c.getCacheHint();
- if (hint == null) {
- hint = new CacheHint();
- } else {
- recordMaterializationTableAnnotation(table, analysisRecord, matTableName,
- QueryPlugin.Util.getString("SimpleQueryResolver.cache_hint_used", table, matTableName, hint)); //$NON-NLS-1$
+ if (hint != null) {
+ recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.cache_hint_used", table, matTableName, hint)); //$NON-NLS-1$
}
id.setCacheHint(hint);
}
}
+ } else if (id.getCacheHint() != null) {
+ recordMaterializationTableAnnotation(analysisRecord, QueryPlugin.Util.getString("SimpleQueryResolver.cache_hint_used", table, matTableName, id.getCacheHint())); //$NON-NLS-1$
}
return id;
}
@@ -1054,9 +1051,8 @@
return false;
}
- private static void recordMaterializationTableAnnotation(GroupSymbol virtualGroup,
- AnalysisRecord analysis,
- String matTableName, String msg) {
+ private static void recordMaterializationTableAnnotation(AnalysisRecord analysis,
+ String msg) {
if ( analysis.recordAnnotations() ) {
Annotation annotation = new Annotation(Annotation.MATERIALIZED_VIEW,
msg,
Modified: trunk/engine/src/main/java/org/teiid/query/sql/LanguageObject.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/LanguageObject.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/engine/src/main/java/org/teiid/query/sql/LanguageObject.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -22,7 +22,6 @@
package org.teiid.query.sql;
-import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -31,7 +30,7 @@
* key interfaces and adds some additional methods to allow the {@link LanguageVisitor}
* to work.
*/
-public interface LanguageObject extends Serializable, Cloneable {
+public interface LanguageObject extends Cloneable {
/**
* Method for accepting a visitor. It is the responsibility of the
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/Command.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/Command.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/Command.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -319,10 +319,6 @@
this.plan = plan;
}
- public boolean isCache() {
- return cacheHint != null;
- }
-
public CacheHint getCacheHint() {
return cacheHint;
}
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -173,86 +173,105 @@
return null;
}
final String tableName = group.getNonCorrelationName().toUpperCase();
+ boolean remapColumns = !tableName.equalsIgnoreCase(group.getName());
TempTable table = null;
if (group.isGlobalTable()) {
TempTableStore globalStore = context.getGlobalTableStore();
MatTableInfo info = globalStore.getMatTableInfo(tableName);
boolean load = info.shouldLoad();
if (load) {
- QueryMetadataInterface metadata = context.getMetadata();
- Create create = new Create();
- create.setTable(group);
- create.setColumns(ResolverUtil.resolveElementsInGroup(group, metadata));
- Object pk = metadata.getPrimaryKey(group.getMetadataID());
- if (pk != null) {
- for (Object col : metadata.getElementIDsInKey(pk)) {
- create.getPrimaryKey().add(create.getColumns().get(metadata.getPosition(col)-1));
- }
- }
- table = globalStore.addTempTable(tableName, create, bufferManager);
- CacheHint hint = table.getCacheHint();
- table.setUpdatable(false);
- table.setPreferMemory(hint.getPrefersMemory());
- boolean success = false;
- try {
- //TODO: order by primary key nulls first - then have an insert ordered optimization
- //TODO: use the getCommand logic in RelationalPlanner to reuse commands for this.
- String transformation = metadata.getVirtualPlan(group.getMetadataID()).getQuery();
- QueryProcessor qp = context.getQueryProcessorFactory().createQueryProcessor(transformation, group.getCanonicalName(), context);
- qp.setNonBlocking(true);
- TupleSource ts = new BatchCollector.BatchProducerTupleSource(qp);
- //TODO: if this insert fails, it's unnecessary to do the undo processing
- table.insert(ts, table.getColumns());
- success = true;
- } finally {
- if (!success) {
- globalStore.removeTempTableByName(tableName);
- }
- info.setState(success?MatState.LOADED:MatState.FAILED_LOAD);
- if (table.getCacheHint().getTtl() != null) {
- info.setTtl(table.getCacheHint().getTtl());
- }
- }
+ table = loadGlobalTable(context, group, tableName, globalStore, info);
} else {
table = globalStore.getOrCreateTempTable(tableName, query, bufferManager, false);
}
} else {
table = contextStore.getOrCreateTempTable(tableName, query, bufferManager, true);
}
- //convert to the actual table symbols (this is typically handled by the languagebridgefactory
- ExpressionMappingVisitor emv = new ExpressionMappingVisitor(null) {
- @Override
- public Expression replaceExpression(Expression element) {
- if (element instanceof ElementSymbol) {
- ElementSymbol es = (ElementSymbol)element;
- ((ElementSymbol) element).setName(tableName + ElementSymbol.SEPARATOR + es.getShortName());
+ if (remapColumns) {
+ //convert to the actual table symbols (this is typically handled by the languagebridgefactory
+ ExpressionMappingVisitor emv = new ExpressionMappingVisitor(null) {
+ @Override
+ public Expression replaceExpression(Expression element) {
+ if (element instanceof ElementSymbol) {
+ ElementSymbol es = (ElementSymbol)element;
+ ((ElementSymbol) element).setName(tableName + ElementSymbol.SEPARATOR + es.getShortName());
+ }
+ return element;
}
- return element;
- }
- };
- PostOrderNavigator.doVisit(query, emv);
+ };
+ PostOrderNavigator.doVisit(query, emv);
+ }
return table.createTupleSource(query.getProjectedSymbols(), query.getCriteria(), query.getOrderBy());
}
+ private TempTable loadGlobalTable(CommandContext context,
+ GroupSymbol group, final String tableName,
+ TempTableStore globalStore, MatTableInfo info)
+ throws QueryMetadataException, TeiidComponentException,
+ TeiidProcessingException, ExpressionEvaluationException {
+ TempTable table;
+ QueryMetadataInterface metadata = context.getMetadata();
+ Create create = new Create();
+ create.setTable(group);
+ create.setColumns(ResolverUtil.resolveElementsInGroup(group, metadata));
+ Object pk = metadata.getPrimaryKey(group.getMetadataID());
+ if (pk != null) {
+ for (Object col : metadata.getElementIDsInKey(pk)) {
+ create.getPrimaryKey().add(create.getColumns().get(metadata.getPosition(col)-1));
+ }
+ }
+ table = globalStore.addTempTable(tableName, create, bufferManager);
+ table.setUpdatable(false);
+ CacheHint hint = table.getCacheHint();
+ if (hint != null) {
+ table.setPreferMemory(hint.getPrefersMemory());
+ if (hint.getTtl() != null) {
+ info.setTtl(table.getCacheHint().getTtl());
+ }
+ }
+ boolean success = false;
+ try {
+ //TODO: order by primary key nulls first - then have an insert ordered optimization
+ //TODO: use the getCommand logic in RelationalPlanner to reuse commands for this.
+ String transformation = metadata.getVirtualPlan(group.getMetadataID()).getQuery();
+ QueryProcessor qp = context.getQueryProcessorFactory().createQueryProcessor(transformation, group.getCanonicalName(), context);
+ qp.setNonBlocking(true);
+ TupleSource ts = new BatchCollector.BatchProducerTupleSource(qp);
+ //TODO: if this insert fails, it's unnecessary to do the undo processing
+ table.insert(ts, table.getColumns());
+ success = true;
+ } finally {
+ if (!success) {
+ globalStore.removeTempTableByName(tableName);
+ }
+ info.setState(success?MatState.LOADED:MatState.FAILED_LOAD);
+ }
+ return table;
+ }
+
public Object lookupCodeValue(CommandContext context, String codeTableName,
String returnElementName, String keyElementName, Object keyValue)
throws BlockedException, TeiidComponentException,
TeiidProcessingException {
- ElementSymbol keyElement = new ElementSymbol(keyElementName);
- ElementSymbol returnElement = new ElementSymbol(returnElementName);
+ String matTableName = CODE_PREFIX + (codeTableName + ElementSymbol.SEPARATOR + keyElementName + ElementSymbol.SEPARATOR + returnElementName).toUpperCase();
+
+ ElementSymbol keyElement = new ElementSymbol(matTableName + ElementSymbol.SEPARATOR + keyElementName);
+ ElementSymbol returnElement = new ElementSymbol(matTableName + ElementSymbol.SEPARATOR + returnElementName);
QueryMetadataInterface metadata = context.getMetadata();
keyElement.setType(DataTypeManager.getDataTypeClass(metadata.getElementType(metadata.getElementID(codeTableName + ElementSymbol.SEPARATOR + keyElementName))));
returnElement.setType(DataTypeManager.getDataTypeClass(metadata.getElementType(metadata.getElementID(codeTableName + ElementSymbol.SEPARATOR + returnElementName))));
- String matTableName = CODE_PREFIX + (codeTableName + ElementSymbol.SEPARATOR + keyElementName + ElementSymbol.SEPARATOR + returnElementName).toUpperCase();
- TempMetadataID id = context.getGlobalTableStore().getMetadataStore().addTempGroup(matTableName, Arrays.asList(keyElement, returnElement), false, true);
- String queryString = Reserved.SELECT + ' ' + keyElementName + " ," + returnElementName + ' ' + Reserved.FROM + ' ' + codeTableName; //$NON-NLS-1$
- id.setQueryNode(new QueryNode(matTableName, queryString));
- id.setPrimaryKey(id.getElements().subList(0, 1));
- CacheHint hint = new CacheHint(true, null);
- id.setCacheHint(hint);
+ TempMetadataID id = context.getGlobalTableStore().getMetadataStore().getTempGroupID(matTableName);
+ if (id == null) {
+ id = context.getGlobalTableStore().getMetadataStore().addTempGroup(matTableName, Arrays.asList(keyElement, returnElement), false, true);
+ String queryString = Reserved.SELECT + ' ' + keyElementName + " ," + returnElementName + ' ' + Reserved.FROM + ' ' + codeTableName; //$NON-NLS-1$
+ id.setQueryNode(new QueryNode(matTableName, queryString));
+ id.setPrimaryKey(id.getElements().subList(0, 1));
+ CacheHint hint = new CacheHint(true, null);
+ id.setCacheHint(hint);
+ }
Query query = RelationalPlanner.createMatViewQuery(id, matTableName, Arrays.asList(returnElement), true);
query.setCriteria(new CompareCriteria(keyElement, CompareCriteria.EQ, new Constant(keyValue)));
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -39,6 +39,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.dqp.service.FakeBufferService;
+import org.teiid.query.sql.lang.Query;
import org.teiid.query.sql.symbol.ElementSymbol;
@@ -94,7 +95,7 @@
CachedResults results = new CachedResults();
results.setResults(tb);
-
+ results.setCommand(new Query());
Cache cache = new DefaultCache("dummy", 250); //$NON-NLS-1$
results.prepare(cache, fbs.getBufferManager());
Modified: trunk/engine/src/test/java/org/teiid/dqp/message/TestAtomicRequestMessage.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/message/TestAtomicRequestMessage.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/engine/src/test/java/org/teiid/dqp/message/TestAtomicRequestMessage.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -22,26 +22,18 @@
package org.teiid.dqp.message;
-import junit.framework.TestCase;
+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;
-import org.teiid.dqp.message.AtomicRequestMessage;
-import org.teiid.dqp.message.RequestID;
+@Ignore(value="Serialization of language objects has been turned off")
+public class TestAtomicRequestMessage {
-public class TestAtomicRequestMessage extends TestCase {
-
- /**
- * Constructor for TestAtomicRequestMessage.
- * @param name
- */
- public TestAtomicRequestMessage(String name) {
- super(name);
- }
-
public static AtomicRequestMessage example() {
RequestMessage rm = new RequestMessage();
DQPWorkContext workContext = new DQPWorkContext();
@@ -57,7 +49,7 @@
return message;
}
- public void testSerialize() throws Exception {
+ @Test public void testSerialize() throws Exception {
AtomicRequestMessage example = example();
AtomicRequestMessage copy = UnitTestUtil.helpSerialize(example);
Modified: trunk/metadata/src/main/resources/System.vdb
===================================================================
(Binary files differ)
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/TestMMDatabaseMetaData.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -56,10 +56,8 @@
*/
@SuppressWarnings("nls")
public class TestMMDatabaseMetaData {
-
-
- private static final boolean REPLACE_EXPECTED = true;
+ private static final boolean REPLACE_EXPECTED = false;
private static final boolean WRITE_ACTUAL_RESULTS_TO_FILE = false;
private static final boolean PRINT_RESULTSETS_TO_CONSOLE = false;
@@ -476,14 +474,13 @@
try {
java.sql.Statement stmt = conn.createStatement();
- // Returns 0 rows (but should be identical and return 24 rows):
rs = stmt.executeQuery("SELECT Name FROM SYS.Tables WHERE UCASE(SchemaName) = 'SYS'"); //$NON-NLS-1$
int count = 0;
while(rs.next()) {
count++;
}
- assertEquals(11, count);
+ assertEquals(12, count);
} finally {
if(rs != null) {
rs.close();
Added: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestMatViews.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestMatViews.java (rev 0)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestMatViews.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -0,0 +1,73 @@
+/*
+ * 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.systemmodel;
+
+import static org.junit.Assert.*;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.teiid.core.util.UnitTestUtil;
+import org.teiid.jdbc.FakeServer;
+
+@SuppressWarnings("nls")
+public class TestMatViews {
+
+ private Connection conn;
+
+ @Before public void setUp() throws Exception {
+ FakeServer server = new FakeServer();
+ server.deployVDB("matviews", UnitTestUtil.getTestDataPath() + "/matviews.vdb");
+ conn = server.createConnection("jdbc:teiid:matviews");
+ }
+
+ @Test public void testSystemMatViews() throws Exception {
+ Statement s = conn.createStatement();
+ ResultSet rs = s.executeQuery("select * from SYS.MatViews order by name");
+ assertTrue(rs.next());
+ assertEquals("NOT_LOADED", rs.getString("state"));
+ assertEquals("#MAT_TEST.ERRORVIEW", rs.getString("targetName"));
+ assertTrue(rs.next());
+ assertEquals("NOT_LOADED", rs.getString("state"));
+ assertEquals("#MAT_TEST.MATVIEW", rs.getString("targetName"));
+ assertFalse(rs.next());
+ rs = s.executeQuery("select * from MatView");
+ assertTrue(rs.next());
+ rs = s.executeQuery("select * from SYS.MatViews where name = 'MatView'");
+ assertTrue(rs.next());
+ assertEquals("LOADED", rs.getString("state"));
+ try {
+ s.executeQuery("select * from ErrorView");
+ } catch (SQLException e) {
+
+ }
+ rs = s.executeQuery("select * from SYS.MatViews where name = 'ErrorView'");
+ assertTrue(rs.next());
+ assertEquals("FAILED_LOAD", rs.getString("state"));
+ }
+
+}
Property changes on: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestMatViews.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCSchema.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCSchema.java 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCSchema.java 2010-08-10 11:01:40 UTC (rev 2433)
@@ -1,5 +1,7 @@
package org.teiid.systemmodel;
+import static org.junit.Assert.*;
+
import org.junit.Before;
import org.junit.Test;
import org.teiid.core.util.UnitTestUtil;
@@ -76,5 +78,13 @@
@Test public void test_PG_USER() throws Exception {
execute("select * FROM pg_user"); //$NON-NLS-1$
TestMMDatabaseMetaData.compareResultSet(this.internalResultSet);
- }
+ }
+
+ @Test public void testOIDUniquness() throws Exception {
+ for (String table : new String[] {"Tables", "Columns", "Schemas", "DataTypes", "Keys", "Procedures", "ProcedureParams", "Properties"}) {
+ execute("select count(distinct oid), count(*) from SYS."+table);
+ internalResultSet.next();
+ assertEquals(internalResultSet.getInt(2), internalResultSet.getInt(1));
+ }
+ }
}
Modified: trunk/test-integration/common/src/test/resources/TestCase3473/testGetTables.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestCase3473/testGetTables.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestCase3473/testGetTables.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -22,10 +22,11 @@
test pg_catalog pg_trigger SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
test pg_catalog pg_type SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
test pg_catalog pg_user SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
+test SYS MatViews TABLE <null> <null> <null> <null> <null> <null> true
test test all_databases TABLE <null> <null> <null> <null> <null> <null> false
test test all_models TABLE <null> <null> <null> <null> <null> <null> false
test test all_tables TABLE <null> <null> <null> <null> <null> <null> false
-Row Count : 25
+Row Count : 26
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
TABLE_CAT 12 test java.lang.String TABLE_CAT string SYS Tables 255 255 0 false true false true 1 false true true true
TABLE_SCHEM 12 test java.lang.String TABLE_SCHEM string SYS Tables 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -363,6 +363,14 @@
QT_Ora9DS BQT2 LargeB BigDecimalValue 2 bigdecimal 20 <null> 0 10 1 <null> <null> <null> <null> 126 16 NO <null> <null> <null> !
<null> NO
QT_Ora9DS BQT1 LargeB ObjectValue 2000 object 2048 <null> 0 10 1 <null> <null> <null> <null> 2048 17 NO <null> <null> <null> !
<null> NO
QT_Ora9DS BQT2 LargeB ObjectValue 2000 object 2048 <null> 0 10 1 <null> <null> <null> <null> 2048 17 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS SYS MatViews VDBName 12 string 255 <null> 0 10 0 <null> <null> <null> <null> 255 1 YES <null> <null> <null> !
<null> NO
+QT_Ora9DS SYS MatViews SchemaName 12 string 255 <null> 0 10 0 <null> <null> <null> <null> 255 2 YES <null> <null> <null> !
<null> NO
+QT_Ora9DS SYS MatViews Name 12 string 255 <null> 0 10 0 <null> <null> <null> <null> 255 3 YES <null> <null> <null> !
<null> NO
+QT_Ora9DS SYS MatViews TargetSchemaName 12 string 255 <null> 0 10 1 <null> <null> <null> <null> 255 4 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS SYS MatViews TargetName 12 string 4000 <null> 0 10 1 <null> <null> <null> <null> 4000 5 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS SYS MatViews State 12 string 255 <null> 0 10 1 <null> <null> <null> <null> 255 6 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS SYS MatViews Updated 93 timestamp 29 <null> 0 10 1 <null> <null> <null> <null> 0 7 NO <null> <null> <null> !
<null> NO
+QT_Ora9DS SYS MatViews Cardinality 4 integer 10 <null> 0 10 1 <null> <null> <null> <null> 10 8 NO <null> <null> <null> !
<null> NO
QT_Ora9DS BQT1 MediumA IntKey 4 integer 22 <null> 0 10 0 <null> <null> <null> <null> 0 1 YES <null> <null> <null> !
<null> NO
QT_Ora9DS BQT2 MediumA IntKey 4 integer 22 <null> 0 10 0 <null> <null> <null> <null> 0 1 YES <null> <null> <null> !
<null> NO
QT_Ora9DS BQT1 MediumA StringKey 12 string 10 <null> 0 10 0 <null> <null> <null> <null> 10 2 YES <null> <null> <null> !
<null> NO
@@ -1057,7 +1065,7 @@
QT_Ora9DS XQT xqtFullData BigIntegerValue 2 biginteger 19 <null> 0 10 1 <null> <null> <null> <null> 28 15 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQT xqtFullData BigDecimalValue 2 bigdecimal 20 <null> 0 10 1 <null> <null> <null> <null> 126 16 NO <null> <null> <null> !
<null> NO
QT_Ora9DS XQT xqtFullData ObjectValue 2000 object 2048 <null> 0 10 1 <null> <null> <null> <null> 2048 17 NO <null> <null> <null> !
<null> NO
-Row Count : 1057
+Row Count : 1065
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
TABLE_CAT 12 QT_Ora9DS java.lang.String TABLE_CAT string SYS Columns 255 255 0 false false false false 0 true true false false
TABLE_SCHEM 12 QT_Ora9DS java.lang.String TABLE_SCHEM string SYS Columns 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -56,6 +56,7 @@
QT_Ora9DS BQT2 MediumB TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS BQT2 SmallA TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS BQT2 SmallB TABLE <null> <null> <null> <null> <null> <null> true
+QT_Ora9DS SYS MatViews TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS VQT Base.Agg1 TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS VQT Base.Agg2 TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS VQT Base.Agg3 TABLE <null> <null> <null> <null> <null> <null> false
@@ -132,7 +133,7 @@
QT_Ora9DS XQTNestedDoc testOptimizableTempTable.MappingClasses.moveToRootTempTable XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQTNestedDoc testRootTempTable.MappingClasses.TemporaryTable1 XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQTRecursiveDoc testSimpleTempTable.MappingClasses.TemporaryTable1 XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
-Row Count : 132
+Row Count : 133
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
TABLE_CAT 12 QT_Ora9DS java.lang.String TABLE_CAT string SYS Tables 255 255 0 false true false true 1 false true true true
TABLE_SCHEM 12 QT_Ora9DS java.lang.String TABLE_SCHEM string SYS Tables 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_allTables.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_allTables.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_allTables.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -56,6 +56,7 @@
QT_Ora9DS BQT2 MediumB TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS BQT2 SmallA TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS BQT2 SmallB TABLE <null> <null> <null> <null> <null> <null> true
+QT_Ora9DS SYS MatViews TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS VQT Base.Agg1 TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS VQT Base.Agg2 TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS VQT Base.Agg3 TABLE <null> <null> <null> <null> <null> <null> false
@@ -132,7 +133,7 @@
QT_Ora9DS XQTNestedDoc testOptimizableTempTable.MappingClasses.moveToRootTempTable XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQTNestedDoc testRootTempTable.MappingClasses.TemporaryTable1 XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQTRecursiveDoc testSimpleTempTable.MappingClasses.TemporaryTable1 XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
-Row Count : 132
+Row Count : 133
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
TABLE_CAT 12 QT_Ora9DS java.lang.String TABLE_CAT string SYS Tables 255 255 0 false true false true 1 false true true true
TABLE_SCHEM 12 QT_Ora9DS java.lang.String TABLE_SCHEM string SYS Tables 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_specificTableMultipleTypes.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_specificTableMultipleTypes.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_specificTableMultipleTypes.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -16,6 +16,7 @@
QT_Ora9DS BQT2 MediumB TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS BQT2 SmallA TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS BQT2 SmallB TABLE <null> <null> <null> <null> <null> <null> true
+QT_Ora9DS SYS MatViews TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS VQT Base.Agg1 TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS VQT Base.Agg2 TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS VQT Base.Agg3 TABLE <null> <null> <null> <null> <null> <null> false
@@ -49,7 +50,7 @@
QT_Ora9DS VQT Union.U9 TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQT xqtData TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQT xqtFullData TABLE <null> <null> <null> <null> <null> <null> false
-Row Count : 49
+Row Count : 50
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
TABLE_CAT 12 QT_Ora9DS java.lang.String TABLE_CAT string SYS Tables 255 255 0 false true false true 1 false true true true
TABLE_SCHEM 12 QT_Ora9DS java.lang.String TABLE_SCHEM string SYS Tables 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_specificTableTypes.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_specificTableTypes.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_specificTableTypes.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -16,6 +16,7 @@
QT_Ora9DS BQT2 MediumB TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS BQT2 SmallA TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS BQT2 SmallB TABLE <null> <null> <null> <null> <null> <null> true
+QT_Ora9DS SYS MatViews TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS VQT Base.Agg1 TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS VQT Base.Agg2 TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS VQT Base.Agg3 TABLE <null> <null> <null> <null> <null> <null> false
@@ -49,7 +50,7 @@
QT_Ora9DS VQT Union.U9 TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQT xqtData TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQT xqtFullData TABLE <null> <null> <null> <null> <null> <null> false
-Row Count : 49
+Row Count : 50
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
TABLE_CAT 12 QT_Ora9DS java.lang.String TABLE_CAT string SYS Tables 255 255 0 false true false true 1 false true true true
TABLE_SCHEM 12 QT_Ora9DS java.lang.String TABLE_SCHEM string SYS Tables 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -86,6 +86,14 @@
1957953763 -1056482755 RefKeyUID 1043 50 9 50 false false false
-1864727535 -1056482755 UID 1043 50 10 50 false false false
120374768 -1056482755 OID <null> 10 11 10 false false false
+1518497335 -2028080981 VDBName 1043 255 1 255 false false false
+-1436081057 -2028080981 SchemaName 1043 255 2 255 false false false
+829635174 -2028080981 Name 1043 255 3 255 false false false
+-1827861927 -2028080981 TargetSchemaName 1043 255 4 255 false false false
+-767393364 -2028080981 TargetName 1043 4000 5 4000 false false false
+-1140134170 -2028080981 State 1043 255 6 255 false false false
+107574265 -2028080981 Updated 1114 0 7 0 false false false
+-1942479773 -2028080981 Cardinality <null> 10 8 10 false false false
1975537358 1809992480 VDBName 1043 255 1 255 false false false
-944775923 1809992480 SchemaName 1043 255 2 255 false false false
2030457340 1809992480 ProcedureName 1043 255 3 255 false false false
@@ -225,7 +233,7 @@
717511814 -164161188 usename 1043 0 2 0 false false false
1288630002 -164161188 usecreatedb 16 0 3 0 false false false
1033115127 -164161188 usesuper 16 0 4 0 false false false
-Row Count : 225
+Row Count : 233
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
oid 4 PartsSupplier java.lang.Integer oid integer pg_catalog pg_attribute 11 10 0 false false false false 2 true true false false
attrelid 4 PartsSupplier java.lang.Integer attrelid integer pg_catalog pg_attribute 11 10 0 false false false false 2 true true false false
Modified: trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_CLASS.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_CLASS.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_CLASS.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -9,6 +9,7 @@
407729263 DataTypes -2075981161 r 0 0.0 0 false false
1906549043 KeyColumns -2075981161 r 0 0.0 0 false false
-1056482755 Keys -2075981161 r 0 0.0 0 false false
+-2028080981 MatViews -2075981161 r 0 0.0 0 false false
1809992480 ProcedureParams -2075981161 r 0 0.0 0 false false
-364939653 Procedures -2075981161 r 0 0.0 0 false false
-1169068629 Properties -2075981161 r 0 0.0 0 false false
@@ -27,7 +28,7 @@
1533609944 pg_attrdef -915078125 v 0 0.0 0 false false
209142477 pg_database -915078125 v 0 0.0 0 false false
-164161188 pg_user -915078125 v 0 0.0 0 false false
-Row Count : 27
+Row Count : 28
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
oid 4 PartsSupplier java.lang.Integer oid integer pg_catalog pg_class 11 10 0 false false false false 2 true true false false
relname 12 PartsSupplier java.lang.String relname string pg_catalog pg_class 4000 4000 0 false false false false 2 true true false false
Modified: trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testColumns.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testColumns.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testColumns.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -69,6 +69,14 @@
PartsSupplier SYS Keys RefKeyUID 12 string 50 <null> 0 10 1 <null> <null> <null> <null> 50 9 NO <null> <null> <null> !
<null> NO
PartsSupplier SYS Keys UID 12 string 50 <null> 0 10 0 <null> <null> <null> <null> 50 10 YES <null> <null> <null> !
<null> NO
PartsSupplier SYS Keys OID 4 integer 10 <null> 0 10 0 <null> <null> <null> <null> 10 11 YES <null> <null> <null> !
<null> NO
+PartsSupplier SYS MatViews VDBName 12 string 255 <null> 0 10 0 <null> <null> <null> <null> 255 1 YES <null> <null> <null> !
<null> NO
+PartsSupplier SYS MatViews SchemaName 12 string 255 <null> 0 10 0 <null> <null> <null> <null> 255 2 YES <null> <null> <null> !
<null> NO
+PartsSupplier SYS MatViews Name 12 string 255 <null> 0 10 0 <null> <null> <null> <null> 255 3 YES <null> <null> <null> !
<null> NO
+PartsSupplier SYS MatViews TargetSchemaName 12 string 255 <null> 0 10 1 <null> <null> <null> <null> 255 4 NO <null> <null> <null> !
<null> NO
+PartsSupplier SYS MatViews TargetName 12 string 4000 <null> 0 10 1 <null> <null> <null> <null> 4000 5 NO <null> <null> <null> !
<null> NO
+PartsSupplier SYS MatViews State 12 string 255 <null> 0 10 1 <null> <null> <null> <null> 255 6 NO <null> <null> <null> !
<null> NO
+PartsSupplier SYS MatViews Updated 93 timestamp 29 <null> 0 10 1 <null> <null> <null> <null> 0 7 NO <null> <null> <null> !
<null> NO
+PartsSupplier SYS MatViews Cardinality 4 integer 10 <null> 0 10 1 <null> <null> <null> <null> 10 8 NO <null> <null> <null> !
<null> NO
PartsSupplier PartsSupplier PARTSSUPPLIER.PARTS PART_ID 12 string 4 <null> 0 10 0 <null> <null> <null> <null> 4 1 YES <null> <null> <null> !
<null> NO
PartsSupplier PartsSupplier PARTSSUPPLIER.PARTS PART_NAME 12 string 255 <null> 0 10 1 <null> <null> <null> <null> 255 2 NO <null> <null> <null> !
<null> NO
PartsSupplier PartsSupplier PARTSSUPPLIER.PARTS PART_COLOR 12 string 30 <null> 0 10 1 <null> <null> <null> <null> 30 3 NO <null> <null> <null> !
<null> NO
@@ -225,7 +233,7 @@
PartsSupplier pg_catalog pg_user usename 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 2 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog pg_user usecreatedb -7 boolean 1 <null> 0 0 2 <null> <null> <null> <null> 0 3 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog pg_user usesuper -7 boolean 1 <null> 0 0 2 <null> <null> <null> <null> 0 4 <null> <null> <null> !
<null> NO
-Row Count : 225
+Row Count : 233
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
TABLE_CAT 12 PartsSupplier java.lang.String TABLE_CAT string SYS Columns 255 255 0 false false false false 0 true true false false
TABLE_SCHEM 12 PartsSupplier java.lang.String TABLE_SCHEM string SYS Columns 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTables.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTables.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTables.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -27,7 +27,8 @@
PartsSupplier PartsSupplier PARTSSUPPLIER.STATUS TABLE <null> <null> <null> <null> <null> <null> true
PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER TABLE <null> <null> <null> <null> <null> <null> true
PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER_PARTS TABLE <null> <null> <null> <null> <null> <null> true
-Row Count : 27
+PartsSupplier SYS MatViews TABLE <null> <null> <null> <null> <null> <null> true
+Row Count : 28
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
TABLE_CAT 12 PartsSupplier java.lang.String TABLE_CAT string SYS Tables 255 255 0 false true false true 1 false true true true
TABLE_SCHEM 12 PartsSupplier java.lang.String TABLE_SCHEM string SYS Tables 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -1,6 +1,7 @@
string string string string integer string string integer integer boolean boolean boolean boolean boolean boolean boolean string string string string string string string integer integer integer string !
string integer
VDBName SchemaName TableName Name Position NameInSource DataType Scale Length IsLengthFixed SupportsSelect SupportsUpdates IsCaseSensitive IsSigned IsCurrency IsAutoIncremented NullType MinRange MaxRange SearchType Format DefaultValue JavaClass Precision CharOctetLength Radix UID !
Description OID
PartsSupplier SYS DataTypes BaseType 17 <null> string 0 64 true true false true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 64 64 10 mmuuid:03beb57c-968b-4821-a6ae-cb1154cfadee !
<null> 449930315
+PartsSupplier SYS MatViews Cardinality 8 <null> integer 0 10 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.Integer 0 10 10 mmuuid:c20875ac-5df8-4a3f-89af-c766af8f81b6 !
<null> -1942479773
PartsSupplier SYS Tables Cardinality 9 <null> integer 0 10 false true false true true false false No Nulls <null> <null> All Except Like <null> <null> java.lang.Integer 10 10 10 mmuuid:24cdad3a-e8f7-4376-bb32-79f8bc8eeed2 !
<null> -827418434
PartsSupplier SYS Columns CharOctetLength 25 <null> integer 0 10 true true false false false false false Nullable <null> <null> Searchable <null> <null> java.lang.Integer 10 10 10 mmuuid:de5def94-2804-4c91-91ed-26d630ce8afe !
<null> 1904600238
PartsSupplier SYS ReferenceKeyColumns DEFERRABILITY 14 <null> integer 0 10 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.Integer 10 10 10 mmuuid:88380f55-2cbd-4325-b9a3-9dcaa88a690e !
<null> 1757202753
@@ -48,6 +49,7 @@
PartsSupplier SYS DataTypes Name 1 <null> string 0 100 true true false true true false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 100 100 10 mmuuid:17f7de33-e6f0-4b9c-b55e-a87f6b7bb9b3 !
<null> 988889238
PartsSupplier SYS KeyColumns Name 4 <null> string 0 255 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:08bda0c7-5f66-4fed-8285-d74b63eeb0e2 !
<null> 2034926350
PartsSupplier SYS Keys Name 4 <null> string 0 255 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:149de302-2107-45ca-839d-fc0dd1e7d7f4 !
<null> 425155393
+PartsSupplier SYS MatViews Name 3 <null> string 0 255 false true true true true false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:75bd4c7c-71f9-44ee-be3a-16f82af5dec7 !
<null> 829635174
PartsSupplier SYS ProcedureParams Name 4 <null> string 0 255 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:2bf20c6f-5a95-436d-8f30-a24d164e77a4 !
<null> -1008332542
PartsSupplier SYS Procedures Name 3 <null> string 0 255 true true false true false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:bd17e98a-c40a-43b1-93ac-88d62937c051 !
<null> -1887591430
PartsSupplier SYS Properties Name 1 <null> string 0 255 true true false true true false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:ba007c56-04b6-4981-ab89-3fdd33ff0de8 !
<null> 1640613833
@@ -114,17 +116,21 @@
PartsSupplier SYS Columns SchemaName 2 <null> string 0 255 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:859288c9-cd78-4407-90fc-61b5d310e2ab !
<null> 1944775942
PartsSupplier SYS KeyColumns SchemaName 2 <null> string 0 255 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:787be966-cf12-4956-907f-a8e6dc1009dc !
<null> -1759292119
PartsSupplier SYS Keys SchemaName 2 <null> string 0 255 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:4a7fc059-208e-4f98-b6ef-cb7c6102a327 !
<null> 1074685596
+PartsSupplier SYS MatViews SchemaName 2 <null> string 0 255 false true true true true false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:ee14b6ad-9b87-41e5-8eb5-90262f9e0ec4 !
<null> -1436081057
PartsSupplier SYS ProcedureParams SchemaName 2 <null> string 0 255 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:88497911-619c-4ca8-b482-8885d940706a !
<null> -944775923
PartsSupplier SYS Procedures SchemaName 2 <null> string 0 255 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:53a84865-334e-4750-b343-de2411d56e3e !
<null> -1162137751
PartsSupplier SYS Tables SchemaName 2 <null> string 0 255 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:95bd960c-fd84-44c9-9831-692376f69b46 !
<null> -1168783734
PartsSupplier SYS Columns SearchType 20 <null> string 0 20 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 20 20 10 mmuuid:3037138a-bb20-4485-ba01-75bc20b1a532 !
<null> -917271927
PartsSupplier SYS DataTypes SearchType 14 <null> string 0 20 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 20 20 10 mmuuid:d8494fa3-40e4-44cd-b0d8-da5c83685a75 !
<null> 920862690
+PartsSupplier SYS MatViews State 6 <null> string 0 255 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:d730c1a8-a8b1-4912-957d-f310506ec93b !
<null> -1140134170
PartsSupplier SYS Columns SupportsSelect 11 <null> boolean 0 1 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.Boolean 1 1 10 mmuuid:c2a50f93-0040-41ec-ad7b-e8511296555f !
<null> -1799446175
PartsSupplier SYS Columns SupportsUpdates 12 <null> boolean 0 1 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.Boolean 1 1 10 mmuuid:fab660d1-36bf-4a5b-bbe6-9a543e0ebd76 !
<null> 1376383558
PartsSupplier SYS Tables SupportsUpdates 7 <null> boolean 0 1 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.Boolean 1 1 10 mmuuid:5144d230-2b0e-4255-b321-65b9f6f6f76c !
<null> -1060614397
PartsSupplier SYS Columns TableName 3 <null> string 0 255 true true false true false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:2c09c9d1-2f25-45de-81cf-eeb2a5157d34 !
<null> 37248193
PartsSupplier SYS KeyColumns TableName 3 <null> string 0 2048 true true false true false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 2048 2048 10 mmuuid:c24fad72-0c0d-4260-96ae-f188ad77b137 !
<null> -1594935697
PartsSupplier SYS Keys TableName 3 <null> string 0 2048 true true false true false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 2048 2048 10 mmuuid:7d9540bd-b51f-4206-8c33-b39c5ba8bb8b !
<null> -1862131168
+PartsSupplier SYS MatViews TargetName 5 <null> string 0 4000 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 0 4000 10 mmuuid:9433bf0c-1046-4b83-9539-862fc0e190c6 !
<null> -767393364
+PartsSupplier SYS MatViews TargetSchemaName 4 <null> string 0 255 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:544b39f9-5243-43ce-a0cb-747d91fc5c5e !
<null> -1827861927
PartsSupplier SYS Keys Type 7 <null> string 0 20 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 20 20 10 mmuuid:29e73c18-afec-43a9-81ab-7378d6daf20b !
<null> 846555123
PartsSupplier SYS ProcedureParams Type 7 <null> string 0 100 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 100 100 10 mmuuid:76a1981b-1226-4a55-9acf-82a061cc8642 !
<null> 1405495099
PartsSupplier SYS Tables Type 4 <null> string 0 20 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 20 20 10 mmuuid:4814a0af-4e8f-4f55-9b25-3148d90d3d9b !
<null> 880927430
@@ -141,9 +147,11 @@
PartsSupplier SYS Schemas UID 4 <null> string 0 50 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 50 50 10 mmuuid:ad232e4d-9c01-4d0c-bc57-0459d9db918a !
<null> 1001441719
PartsSupplier SYS Tables UID 8 <null> string 0 50 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 50 50 10 mmuuid:6afe3737-26f9-43a8-88db-86531b5dc66c !
<null> -175171634
PartsSupplier SYS ReferenceKeyColumns UPDATE_RULE 10 <null> integer 0 10 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.Integer 10 10 10 mmuuid:30d5ae74-b19e-4186-97e1-aeff5801e44f !
<null> -449329715
+PartsSupplier SYS MatViews Updated 7 <null> timestamp 0 0 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.sql.Timestamp 0 0 10 mmuuid:8053993e-6653-473d-a8b5-7d73f26900b0 !
<null> 107574265
PartsSupplier SYS Columns VDBName 1 <null> string 0 255 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:83f19a81-1243-4751-8c99-daddbf37b1d7 !
<null> 625775649
PartsSupplier SYS KeyColumns VDBName 1 <null> string 0 255 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:f062eb9c-4854-47fb-b7bd-a4e23c782b62 !
<null> 854014254
PartsSupplier SYS Keys VDBName 1 <null> string 0 255 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:5785b523-7da3-42c1-8920-66daa1f7fa1d !
<null> -1451894484
+PartsSupplier SYS MatViews VDBName 1 <null> string 0 255 false true true true true false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:9498360d-1e16-4d16-b88f-d46cc75a03c2 !
<null> 1518497335
PartsSupplier SYS ProcedureParams VDBName 1 <null> string 0 255 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:f832f316-2403-43fa-9ccc-c3ab9d38acca !
<null> 1975537358
PartsSupplier SYS Procedures VDBName 1 <null> string 0 255 true true false false false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:1d664747-4a95-4605-8b28-381bed3121f1 !
<null> 675421827
PartsSupplier SYS Schemas VDBName 1 <null> string 0 255 false true true true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:73dbf95b-a283-4f0a-81b9-9b98e09c2906 !
<null> 1083046346
@@ -225,7 +233,7 @@
PartsSupplier pg_catalog pg_user usecreatedb 3 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuuid:7f20dc11-f376-4da5-9fe5-139c2562b4c2 !
<null> 1288630002
PartsSupplier pg_catalog pg_user usename 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuuid:8d148996-16a1-44d8-b5ff-06f9421415d4 !
<null> 717511814
PartsSupplier pg_catalog pg_user usesuper 4 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuuid:f3434529-3e9a-4f11-90c0-b74374947902 !
<null> 1033115127
-Row Count : 225
+Row Count : 233
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String VDBName string SYS Columns 255 255 0 false false false false 0 true true false false
SchemaName 12 PartsSupplier java.lang.String SchemaName string SYS Columns 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTableIsSystem.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTableIsSystem.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTableIsSystem.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -1,10 +1,11 @@
string
Name
+MatViews
PARTSSUPPLIER.PARTS
PARTSSUPPLIER.SHIP_VIA
PARTSSUPPLIER.STATUS
PARTSSUPPLIER.SUPPLIER
PARTSSUPPLIER.SUPPLIER_PARTS
-Row Count : 5
+Row Count : 6
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
Name 12 PartsSupplier java.lang.String Name string SYS Tables 255 255 0 false true false false 0 true true false false
Modified: trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected 2010-08-10 00:43:33 UTC (rev 2432)
+++ trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected 2010-08-10 11:01:40 UTC (rev 2433)
@@ -4,6 +4,7 @@
PartsSupplier SYS DataTypes Table <null> true false mmuuid:9a8794f9-66f8-49e8-8576-89d212d0f957 0 <null> true false 407729263
PartsSupplier SYS KeyColumns Table <null> true false mmuuid:14946083-3bd5-42d5-8283-1c0694347c29 0 <null> true false 1906549043
PartsSupplier SYS Keys Table <null> true false mmuuid:1e5135dc-ce5d-4b25-a8ff-63f5440b3108 0 <null> true false -1056482755
+PartsSupplier SYS MatViews Table <null> true true mmuuid:29f7718e-bd87-4fe0-8b8a-9fec44517de5 0 <null> false false -2028080981
PartsSupplier PartsSupplier PARTSSUPPLIER.PARTS Table PARTS true true mmuuid:f6276601-73fe-1edc-a81c-ecf397b10590 16 <null> false false 1623654648
PartsSupplier PartsSupplier PARTSSUPPLIER.SHIP_VIA Table SHIP_VIA true true mmuuid:0f4e9b80-73ff-1edc-a81c-ecf397b10590 4 <null> false false 1136825257
PartsSupplier PartsSupplier PARTSSUPPLIER.STATUS Table STATUS true true mmuuid:1f297200-73ff-1edc-a81c-ecf397b10590 3 <null> false false -1690137928
@@ -27,7 +28,7 @@
PartsSupplier pg_catalog pg_trigger Table <null> false false mmuuid:dbdacb28-7e78-4ae5-8a99-3e3e1c59f641 0 <null> true false -77334293
PartsSupplier pg_catalog pg_type Table <null> false false mmuuid:8024e6eb-ba32-41a0-a250-95a36eb4b71f 0 <null> true false -136764222
PartsSupplier pg_catalog pg_user Table <null> false false mmuuid:0da462b7-bacf-41da-9335-9a12224c462a 0 <null> true false -164161188
-Row Count : 27
+Row Count : 28
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String VDBName string SYS Tables 255 255 0 false true false true 1 false true true true
SchemaName 12 PartsSupplier java.lang.String SchemaName string SYS Tables 255 255 0 false true false true 1 false true true true
Added: trunk/test-integration/common/src/test/resources/matviews.vdb
===================================================================
(Binary files differ)
Property changes on: trunk/test-integration/common/src/test/resources/matviews.vdb
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 8 months
teiid SVN: r2432 - trunk/client/src/test/java/org/teiid/adminapi/impl.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-08-09 20:43:33 -0400 (Mon, 09 Aug 2010)
New Revision: 2432
Modified:
trunk/client/src/test/java/org/teiid/adminapi/impl/TestDataPolicyMetaData.java
trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
Log:
TEIID-1071 updating unit tests
Modified: trunk/client/src/test/java/org/teiid/adminapi/impl/TestDataPolicyMetaData.java
===================================================================
--- trunk/client/src/test/java/org/teiid/adminapi/impl/TestDataPolicyMetaData.java 2010-08-09 20:13:40 UTC (rev 2431)
+++ trunk/client/src/test/java/org/teiid/adminapi/impl/TestDataPolicyMetaData.java 2010-08-10 00:43:33 UTC (rev 2432)
@@ -39,45 +39,45 @@
PermissionMetaData perm1 = new PermissionMetaData();
- perm1.setResourceName("schema.catalog.Table1"); //$NON-NLS-1$
+ perm1.setResourceName("catalog.schema.Table1"); //$NON-NLS-1$
perm1.setAllowRead(true);
PermissionMetaData perm2 = new PermissionMetaData();
- perm2.setResourceName("schema.catalog.Table2"); //$NON-NLS-1$
+ perm2.setResourceName("catalog.schema.Table2"); //$NON-NLS-1$
perm2.setAllowRead(false);
PermissionMetaData perm3 = new PermissionMetaData();
- perm3.setResourceName("schema.catalog.Table3.*"); //$NON-NLS-1$
+ perm3.setResourceName("catalog.schema.Table3"); //$NON-NLS-1$
perm3.setAllowRead(true);
PermissionMetaData perm4 = new PermissionMetaData();
- perm4.setResourceName("schema.catalog.Table4*"); //$NON-NLS-1$
+ perm4.setResourceName("catalog.schema.Table4"); //$NON-NLS-1$
perm4.setAllowRead(true);
PermissionMetaData perm5 = new PermissionMetaData();
- perm5.setResourceName("schema.catalog.Table5.column1"); //$NON-NLS-1$
+ perm5.setResourceName("catalog.schema.Table5.column1"); //$NON-NLS-1$
perm5.setAllowRead(true);
policy.addPermission(perm1, perm2, perm3, perm4, perm5);
- assertTrue(policy.allows("schema.catalog.Table1", PermissionType.READ)); //$NON-NLS-1$
- assertFalse(policy.allows("schema.catalog.Table1", PermissionType.CREATE)); //$NON-NLS-1$
+ assertTrue(policy.allows("catalog.schema.Table1", PermissionType.READ)); //$NON-NLS-1$
+ assertFalse(policy.allows("catalog.schema.Table1", PermissionType.CREATE)); //$NON-NLS-1$
- assertFalse(policy.allows("schema.catalog", PermissionType.READ)); //$NON-NLS-1$
+ assertFalse(policy.allows("catalog.schema", PermissionType.READ)); //$NON-NLS-1$
- assertFalse(policy.allows("schema.catalog.Table2.column", PermissionType.READ)); //$NON-NLS-1$
- assertFalse(policy.allows("schema.catalog.Table2", PermissionType.READ)); //$NON-NLS-1$
+ assertFalse(policy.allows("catalog.schema.Table2.column", PermissionType.READ)); //$NON-NLS-1$
+ assertFalse(policy.allows("catalog.schema.Table2", PermissionType.READ)); //$NON-NLS-1$
- assertTrue(policy.allows("schema.catalog.Table3.column", PermissionType.READ)); //$NON-NLS-1$
- assertTrue(policy.allows("schema.catalog.Table3", PermissionType.READ)); //$NON-NLS-1$
+ assertTrue(policy.allows("catalog.schema.Table3.column", PermissionType.READ)); //$NON-NLS-1$
+ assertTrue(policy.allows("catalog.schema.Table3", PermissionType.READ)); //$NON-NLS-1$
- assertTrue(policy.allows("schema.catalog.Table4.column", PermissionType.READ)); //$NON-NLS-1$
- assertTrue(policy.allows("schema.catalog.Table4", PermissionType.READ)); //$NON-NLS-1$
- assertFalse(policy.allows("schema.catalog.Table4", PermissionType.DELETE)); //$NON-NLS-1$
+ assertTrue(policy.allows("catalog.schema.Table4.column", PermissionType.READ)); //$NON-NLS-1$
+ assertTrue(policy.allows("catalog.schema.Table4", PermissionType.READ)); //$NON-NLS-1$
+ assertFalse(policy.allows("catalog.schema.Table4", PermissionType.DELETE)); //$NON-NLS-1$
- assertTrue(policy.allows("schema.catalog.Table5.column1", PermissionType.READ)); //$NON-NLS-1$
- assertFalse(policy.allows("schema.catalog.Table5.column2", PermissionType.READ)); //$NON-NLS-1$
- assertFalse(policy.allows("schema.catalog.Table5", PermissionType.READ)); //$NON-NLS-1$
+ assertTrue(policy.allows("catalog.schema.Table5.column1", PermissionType.READ)); //$NON-NLS-1$
+ assertFalse(policy.allows("catalog.schema.Table5.column2", PermissionType.READ)); //$NON-NLS-1$
+ assertFalse(policy.allows("catalog.schema.Table5", PermissionType.READ)); //$NON-NLS-1$
}
}
Modified: trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
===================================================================
--- trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-08-09 20:13:40 UTC (rev 2431)
+++ trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-08-10 00:43:33 UTC (rev 2432)
@@ -174,7 +174,7 @@
for (DataPolicy.DataPermission p: permissions) {
if (p.getResourceName().equalsIgnoreCase("myTable.T1")) { //$NON-NLS-1$
assertTrue(p.isAllowRead());
- assertFalse(p.isAllowDelete());
+ assertNull(p.isAllowDelete());
}
else {
assertFalse(p.isAllowRead());
15 years, 8 months