teiid SVN: r2270 - branches/7.0.x/engine/src/test/java/org/teiid/query/validator.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-21 16:28:17 -0400 (Mon, 21 Jun 2010)
New Revision: 2270
Modified:
branches/7.0.x/engine/src/test/java/org/teiid/query/validator/TestValidator.java
Log:
TEIID-171 ensuring that xmlagg is not pushed down and correcting the validation.
Modified: branches/7.0.x/engine/src/test/java/org/teiid/query/validator/TestValidator.java
===================================================================
--- branches/7.0.x/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2010-06-21 20:26:14 UTC (rev 2269)
+++ branches/7.0.x/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2010-06-21 20:28:17 UTC (rev 2270)
@@ -2038,5 +2038,9 @@
@Test public void testDecode() throws Exception {
helpValidate("select to_bytes(e1, '?') from pm1.g1", new String[] {"to_bytes(e1, '?')"}, FakeMetadataFactory.example1Cached());
}
+
+ @Test public void testValidateXMLAGG() {
+ helpValidate("SELECT XMLAGG(e1) from pm1.g1", new String[] {"XMLAGG(e1)"}, FakeMetadataFactory.example1Cached()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
14 years, 6 months
teiid SVN: r2269 - in branches/7.0.x/metadata/src: test/java/org/teiid/metadata/index and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-21 16:26:14 -0400 (Mon, 21 Jun 2010)
New Revision: 2269
Added:
branches/7.0.x/metadata/src/test/java/org/teiid/metadata/index/TestMultipleModelIndexes.java
branches/7.0.x/metadata/src/test/resources/ZZZ.vdb
Modified:
branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
Log:
TEIID-1129 fix for multiple model index files.
Modified: branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
===================================================================
--- branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java 2010-06-21 20:21:08 UTC (rev 2268)
+++ branches/7.0.x/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java 2010-06-21 20:26:14 UTC (rev 2269)
@@ -538,7 +538,7 @@
// Query based on fully qualified name
else {
String prefixString = getPrefixPattern(recordType,entityName);
- results = queryIndex(recordType, prefixString.toCharArray(), true, true, true);
+ results = queryIndex(recordType, prefixString.toCharArray(), true, true, entityName != null);
}
return results;
Added: branches/7.0.x/metadata/src/test/java/org/teiid/metadata/index/TestMultipleModelIndexes.java
===================================================================
--- branches/7.0.x/metadata/src/test/java/org/teiid/metadata/index/TestMultipleModelIndexes.java (rev 0)
+++ branches/7.0.x/metadata/src/test/java/org/teiid/metadata/index/TestMultipleModelIndexes.java 2010-06-21 20:26:14 UTC (rev 2269)
@@ -0,0 +1,44 @@
+/*
+ * 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.metadata.index;
+
+import static org.junit.Assert.*;
+
+import java.util.Collection;
+
+import org.junit.Test;
+import org.teiid.core.util.UnitTestUtil;
+import org.teiid.metadata.TransformationMetadata;
+
+@SuppressWarnings("nls")
+public class TestMultipleModelIndexes {
+
+ @Test public void testMultiple() throws Exception {
+ TransformationMetadata tm = VDBMetadataFactory.getVDBMetadata(UnitTestUtil.getTestDataPath() + "/ZZZ.vdb");
+ Collection<String> names = tm.getGroupsForPartialName("PRODUCTDATA");
+ assertEquals(1, names.size());
+ names = tm.getGroupsForPartialName("PARTS");
+ assertEquals(1, names.size());
+ }
+
+}
Property changes on: branches/7.0.x/metadata/src/test/java/org/teiid/metadata/index/TestMultipleModelIndexes.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/7.0.x/metadata/src/test/resources/ZZZ.vdb
===================================================================
(Binary files differ)
Property changes on: branches/7.0.x/metadata/src/test/resources/ZZZ.vdb
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 6 months
teiid SVN: r2268 - in branches/7.0.x/engine/src/main/java/org/teiid/query: validator and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-21 16:21:08 -0400 (Mon, 21 Jun 2010)
New Revision: 2268
Modified:
branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
branches/7.0.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java
Log:
TEIID-171 ensuring that xmlagg is not pushed down and correcting the validation.
Modified: branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
===================================================================
--- branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-06-21 20:02:43 UTC (rev 2267)
+++ branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-06-21 20:21:08 UTC (rev 2268)
@@ -171,6 +171,8 @@
if(! caps.supportsCapability(Capability.QUERY_AGGREGATES_MAX)) {
return false;
}
+ } else {
+ return false;
}
// Check DISTINCT if necessary
Modified: branches/7.0.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java
===================================================================
--- branches/7.0.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java 2010-06-21 20:02:43 UTC (rev 2267)
+++ branches/7.0.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java 2010-06-21 20:21:08 UTC (rev 2268)
@@ -75,8 +75,10 @@
String aggregateFunction = obj.getAggregateFunction();
if((aggregateFunction.equals(NonReserved.SUM) || aggregateFunction.equals(NonReserved.AVG)) && obj.getType() == null) {
handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0041, new Object[] {aggregateFunction, obj}), obj);
- } else if (aggregateFunction.equals(Reserved.XMLAGG) && obj.getType() != DataTypeManager.DefaultDataClasses.XML) {
- handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_xml", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
+ } else if (obj.getType() != DataTypeManager.DefaultDataClasses.NULL) {
+ if (aggregateFunction.equals(Reserved.XMLAGG) && aggExp.getType() != DataTypeManager.DefaultDataClasses.XML) {
+ handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_xml", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
+ }
}
if((obj.isDistinct() || aggregateFunction.equals(NonReserved.MIN) || aggregateFunction.equals(NonReserved.MAX)) && DataTypeManager.isNonComparable(DataTypeManager.getDataTypeName(aggExp.getType()))) {
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_comparable", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
14 years, 6 months
teiid SVN: r2267 - in branches/7.0.x: client/src/main/java/org/teiid/adminapi and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-21 16:02:43 -0400 (Mon, 21 Jun 2010)
New Revision: 2267
Modified:
branches/7.0.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
branches/7.0.x/client/src/main/java/org/teiid/adminapi/Admin.java
branches/7.0.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
branches/7.0.x/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
Log:
TEIID-1130 removing export vdb
Modified: branches/7.0.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
===================================================================
--- branches/7.0.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2010-06-19 11:33:35 UTC (rev 2266)
+++ branches/7.0.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2010-06-21 20:02:43 UTC (rev 2267)
@@ -310,15 +310,6 @@
ObjectConverterUtil.write(contents, fileName);
}
- @Doc(text = "Export a VDB to file")
- public static void exportVDB(
- @Doc(text = "vdb name") String vdbName,
- @Doc(text = "vdb version") int vdbVersion,
- @Doc(text = "file name") String fileName) throws AdminException, IOException{
- InputStream contents = getAdmin().exportVDB(vdbName, vdbVersion);
- writeFile(vdbName, fileName, contents);
- }
-
@Doc(text = "Deploy a VDB from file")
public static void deployVDB(
@Doc(text = "file name") String vdbFile) throws AdminException, FileNotFoundException {
Modified: branches/7.0.x/client/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- branches/7.0.x/client/src/main/java/org/teiid/adminapi/Admin.java 2010-06-19 11:33:35 UTC (rev 2266)
+++ branches/7.0.x/client/src/main/java/org/teiid/adminapi/Admin.java 2010-06-21 20:02:43 UTC (rev 2267)
@@ -64,16 +64,6 @@
void deleteVDB(String vdbName, int vdbVersion) throws AdminException;
/**
- * Export VDB to byte array
- *
- * @param vdbName identifier of the {@link VDB}
- * @param vdbVersion {@link VDB} version
- * @return InputStream of the VDB
- * @throws AdminException
- */
- InputStream exportVDB(String vdbName, int vdbVersion) throws AdminException;
-
- /**
* Set a process level property.
* @param propertyName - name of the property
* @param propertyValue - value of the property
Modified: branches/7.0.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
===================================================================
--- branches/7.0.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-06-19 11:33:35 UTC (rev 2266)
+++ branches/7.0.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-06-21 20:02:43 UTC (rev 2267)
@@ -22,10 +22,7 @@
package org.teiid.adminapi.jboss;
-import java.io.IOException;
import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -172,17 +169,6 @@
}
}
- private InputStream exportDeployment(String url) throws AdminComponentException {
- try {
- URL contentURL = new URL(url);
- return contentURL.openStream();
- } catch (MalformedURLException e) {
- throw new AdminComponentException(e);
- } catch (IOException e) {
- throw new AdminComponentException(e);
- }
- }
-
boolean matches(String regEx, String value) {
regEx = regEx.replaceAll(AdminObject.ESCAPED_WILDCARD, ".*"); //$NON-NLS-1$
regEx = regEx.replaceAll(AdminObject.ESCAPED_DELIMITER, ""); //$NON-NLS-1$
@@ -207,15 +193,6 @@
}
@Override
- public InputStream exportVDB(String vdbName, int vdbVersion) throws AdminException{
- ManagedComponent mc = getVDBManagedComponent(vdbName, vdbVersion);
- if (mc != null) {
- return exportDeployment(mc.getDeployment().getName());
- }
- return null;
- }
-
- @Override
public VDB getVDB(String vdbName, int vdbVersion) throws AdminException{
ManagedComponent mc = getVDBManagedComponent(vdbName, vdbVersion);
if (mc != null) {
Modified: branches/7.0.x/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
===================================================================
--- branches/7.0.x/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-06-19 11:33:35 UTC (rev 2266)
+++ branches/7.0.x/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-06-21 20:02:43 UTC (rev 2267)
@@ -1,18 +1,12 @@
package org.teiid.adminapi.jboss;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
+import static junit.framework.Assert.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.InputStream;
import java.sql.Connection;
import java.util.Collection;
import java.util.List;
@@ -34,7 +28,6 @@
import org.teiid.adminapi.Transaction;
import org.teiid.adminapi.Translator;
import org.teiid.adminapi.VDB;
-import org.teiid.core.util.ObjectConverterUtil;
import org.teiid.core.util.UnitTestUtil;
@Ignore
@@ -292,21 +285,6 @@
assertEquals(false, translator.getPropertyValue("XaCapable"));
}
- @Test
- public void testExportVDB() throws Exception{
- File f = new File(UnitTestUtil.getTestScratchPath()+"/TransactionsRevisited.vdb"); //$NON-NLS-1$
-
- assertTrue(!f.exists());
-
- InputStream contents = admin.exportVDB("TransactionsRevisited", 1); //$NON-NLS-1$
- if (contents != null) {
- ObjectConverterUtil.write(contents, f.getCanonicalPath());
- }
-
- assertTrue(f.exists());
- f.delete();
- }
-
@Test public void testAssignConnectorBinding() throws Exception {
admin.assignToModel("TransactionsRevisited", 1, "pm1", "mysql", "mysql", "jndi:FOO"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
14 years, 6 months
teiid SVN: r2266 - in branches/7.0.x: documentation/quick-start-example and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-19 07:33:35 -0400 (Sat, 19 Jun 2010)
New Revision: 2266
Modified:
branches/7.0.x/documentation/caching-guide/pom.xml
branches/7.0.x/documentation/quick-start-example/pom.xml
branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
Log:
TEIID-171 ensuring that objects without connector representations cannot be pushed
Modified: branches/7.0.x/documentation/caching-guide/pom.xml
===================================================================
--- branches/7.0.x/documentation/caching-guide/pom.xml 2010-06-19 11:06:05 UTC (rev 2265)
+++ branches/7.0.x/documentation/caching-guide/pom.xml 2010-06-19 11:33:35 UTC (rev 2266)
@@ -1,12 +1,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.jboss.teiid.documentation</groupId>
+ <groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>caching-guide</artifactId>
+ <groupId>org.jboss.teiid.documentation</groupId>
<packaging>jdocbook</packaging>
<name>Teiid Caching Guide</name>
<description>The Teiid Caching Guide</description>
Modified: branches/7.0.x/documentation/quick-start-example/pom.xml
===================================================================
--- branches/7.0.x/documentation/quick-start-example/pom.xml 2010-06-19 11:06:05 UTC (rev 2265)
+++ branches/7.0.x/documentation/quick-start-example/pom.xml 2010-06-19 11:33:35 UTC (rev 2266)
@@ -1,12 +1,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.jboss.teiid.documentation</groupId>
+ <groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quick-start-example</artifactId>
+ <groupId>org.jboss.teiid.documentation</groupId>
<packaging>jdocbook</packaging>
<name>Quick Start Guide</name>
<description>The Teiid Quick Start guide</description>
Modified: branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
===================================================================
--- branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2010-06-19 11:06:05 UTC (rev 2265)
+++ branches/7.0.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2010-06-19 11:33:35 UTC (rev 2266)
@@ -60,12 +60,16 @@
import org.teiid.query.sql.symbol.CaseExpression;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.symbol.QueryString;
import org.teiid.query.sql.symbol.ScalarSubquery;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
import org.teiid.query.sql.symbol.XMLAttributes;
import org.teiid.query.sql.symbol.XMLElement;
import org.teiid.query.sql.symbol.XMLForest;
import org.teiid.query.sql.symbol.XMLNamespaces;
+import org.teiid.query.sql.symbol.XMLParse;
+import org.teiid.query.sql.symbol.XMLQuery;
+import org.teiid.query.sql.symbol.XMLSerialize;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.EvaluatableVisitor;
import org.teiid.query.sql.visitor.GroupCollectorVisitor;
@@ -119,6 +123,26 @@
markInvalid();
}
+ @Override
+ public void visit(XMLSerialize obj) {
+ markInvalid();
+ }
+
+ @Override
+ public void visit(XMLParse obj) {
+ markInvalid();
+ }
+
+ @Override
+ public void visit(XMLQuery obj) {
+ markInvalid();
+ }
+
+ @Override
+ public void visit(QueryString obj) {
+ markInvalid();
+ }
+
public void visit(AggregateSymbol obj) {
try {
if(! CapabilitiesUtil.supportsAggregateFunction(modelID, obj, metadata, capFinder)) {
14 years, 6 months
teiid SVN: r2265 - in trunk: documentation/caching-guide and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-19 07:06:05 -0400 (Sat, 19 Jun 2010)
New Revision: 2265
Modified:
trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java
trunk/documentation/caching-guide/pom.xml
trunk/documentation/client-developers-guide/pom.xml
trunk/documentation/developer-guide/pom.xml
Log:
fixing poms
Modified: trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java
===================================================================
--- trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java 2010-06-19 02:54:56 UTC (rev 2264)
+++ trunk/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSExecutionFactory.java 2010-06-19 11:06:05 UTC (rev 2265)
@@ -120,45 +120,45 @@
public void getMetadata(MetadataFactory metadataFactory,
WSConnection conn) throws TranslatorException {
Procedure p = metadataFactory.addProcedure("invoke"); //$NON-NLS-1$
- p.setAnnotation("Invokes a webservice that returns an XML result");
+ p.setAnnotation("Invokes a webservice that returns an XML result"); //$NON-NLS-1$
ProcedureParameter param = metadataFactory.addProcedureParameter("binding", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
- param.setAnnotation("The invocation binding (HTTP, SOAP11, SOAP12). May be set or allowed to default to null to use the default binding.");
+ param.setAnnotation("The invocation binding (HTTP, SOAP11, SOAP12). May be set or allowed to default to null to use the default binding."); //$NON-NLS-1$
param.setNullType(NullType.Nullable);
param = metadataFactory.addProcedureParameter("action", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
- param.setAnnotation("With a SOAP invocation, action sets the SOAPAction. With HTTP it sets the HTTP Method (GET, POST - default, etc.).");
+ param.setAnnotation("With a SOAP invocation, action sets the SOAPAction. With HTTP it sets the HTTP Method (GET, POST - default, etc.)."); //$NON-NLS-1$
param.setNullType(NullType.Nullable);
//can be one of string, xml, clob
param = metadataFactory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.XML, Type.In, p); //$NON-NLS-1$
- param.setAnnotation("The XML document or root element that represents the request. If the ExecutionFactory is configured in with a DefaultServiceMode or MESSAGE then SOAP request must contain the entire SOAP message.");
+ param.setAnnotation("The XML document or root element that represents the request. If the ExecutionFactory is configured in with a DefaultServiceMode or MESSAGE then SOAP request must contain the entire SOAP message."); //$NON-NLS-1$
param.setNullType(NullType.Nullable);
param = metadataFactory.addProcedureParameter("endpoint", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
- param.setAnnotation("The relative or abolute endpoint to use. May be set or allowed to default to null to use the default endpoint address.");
+ param.setAnnotation("The relative or abolute endpoint to use. May be set or allowed to default to null to use the default endpoint address."); //$NON-NLS-1$
param.setNullType(NullType.Nullable);
metadataFactory.addProcedureParameter("result", TypeFacility.RUNTIME_NAMES.XML, Type.ReturnValue, p); //$NON-NLS-1$
- /*p = metadataFactory.addProcedure("invokeHttp"); //$NON-NLS-1$
- p.setAnnotation("Invokes a webservice that returns an binary result");
+ p = metadataFactory.addProcedure("invokeHttp"); //$NON-NLS-1$
+ p.setAnnotation("Invokes a webservice that returns an binary result"); //$NON-NLS-1$
param = metadataFactory.addProcedureParameter("method", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
- param.setAnnotation("Sets the HTTP Method (GET, POST - default, etc.).");
+ param.setAnnotation("Sets the HTTP Method (GET, POST - default, etc.)."); //$NON-NLS-1$
param.setNullType(NullType.Nullable);
//can be one of string, xml, clob
param = metadataFactory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$
- param.setAnnotation("The String, XML, BLOB, or CLOB value containing a payload request.");
+ param.setAnnotation("The String, XML, BLOB, or CLOB value containing a payload request."); //$NON-NLS-1$
param.setNullType(NullType.Nullable);
param = metadataFactory.addProcedureParameter("endpoint", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
- param.setAnnotation("The relative or abolute endpoint to use. May be set or allowed to default to null to use the default endpoint address.");
+ param.setAnnotation("The relative or abolute endpoint to use. May be set or allowed to default to null to use the default endpoint address."); //$NON-NLS-1$
param.setNullType(NullType.Nullable);
metadataFactory.addProcedureParameter("result", TypeFacility.RUNTIME_NAMES.BLOB, Type.ReturnValue, p); //$NON-NLS-1$
- metadataFactory.addProcedureParameter("contentType", TypeFacility.RUNTIME_NAMES.STRING, Type.Out, p); //$NON-NLS-1$*/
+ metadataFactory.addProcedureParameter("contentType", TypeFacility.RUNTIME_NAMES.STRING, Type.Out, p); //$NON-NLS-1$
}
}
Modified: trunk/documentation/caching-guide/pom.xml
===================================================================
--- trunk/documentation/caching-guide/pom.xml 2010-06-19 02:54:56 UTC (rev 2264)
+++ trunk/documentation/caching-guide/pom.xml 2010-06-19 11:06:05 UTC (rev 2265)
@@ -1,12 +1,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.jboss.teiid.documentation</groupId>
+ <groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
<version>7.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>caching-guide</artifactId>
+ <groupId>org.jboss.teiid.documentation</groupId>
<packaging>jdocbook</packaging>
<name>Teiid Caching Guide</name>
<description>The Teiid Caching Guide</description>
Modified: trunk/documentation/client-developers-guide/pom.xml
===================================================================
--- trunk/documentation/client-developers-guide/pom.xml 2010-06-19 02:54:56 UTC (rev 2264)
+++ trunk/documentation/client-developers-guide/pom.xml 2010-06-19 11:06:05 UTC (rev 2265)
@@ -1,12 +1,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.jboss.teiid.documentation</groupId>
+ <groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
<version>7.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>client-developers-guide</artifactId>
+ <groupId>org.jboss.teiid.documentation</groupId>
<packaging>jdocbook</packaging>
<name>Teiid Client Developers Guide</name>
<description>The Client Developers Guide</description>
Modified: trunk/documentation/developer-guide/pom.xml
===================================================================
--- trunk/documentation/developer-guide/pom.xml 2010-06-19 02:54:56 UTC (rev 2264)
+++ trunk/documentation/developer-guide/pom.xml 2010-06-19 11:06:05 UTC (rev 2265)
@@ -1,12 +1,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.jboss.teiid.documentation</groupId>
+ <groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
<version>7.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>developer-guide</artifactId>
+ <groupId>org.jboss.teiid.documentation</groupId>
<packaging>jdocbook</packaging>
<name>Developer's Guide</name>
<description>The Teiid Developer's Guide</description>
14 years, 6 months
teiid SVN: r2264 - in trunk: engine/src/main/java/org/teiid/common/buffer and 4 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-06-18 22:54:56 -0400 (Fri, 18 Jun 2010)
New Revision: 2264
Modified:
trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
trunk/engine/src/main/java/org/teiid/common/buffer/FileStore.java
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
trunk/engine/src/main/java/org/teiid/common/buffer/impl/FileStorageManager.java
trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties
trunk/engine/src/test/java/org/teiid/common/buffer/impl/TestFileStorageManager.java
trunk/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java
Log:
TEIID-954 adding the ability to limit the amount of disk buffer space used. also adding buffermanager stats to the bufferservice for monitoring.
Modified: trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-06-18 23:56:02 UTC (rev 2263)
+++ trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-06-19 02:54:56 UTC (rev 2264)
@@ -56,6 +56,8 @@
<property name="maxProcessingBatchesColumns">128</property>
<!-- Max File size in MB (default 2GB)-->
<property name="maxFileSize">2048</property>
+ <!-- Max storage space, in MB, to be used for buffer files (default 50G) -->
+ <property name="maxBufferSpace">51200</property>
<!-- Max open buffer files (default 64) -->
<property name="maxOpenFiles">64</property>
</bean>
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/FileStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/FileStore.java 2010-06-18 23:56:02 UTC (rev 2263)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/FileStore.java 2010-06-19 02:54:56 UTC (rev 2264)
@@ -132,7 +132,7 @@
}
private boolean removed;
- private long len;
+ protected long len;
public void setCleanupReference(Object o) {
REFERENCES.add(new CleanupReference(o, this));
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2010-06-18 23:56:02 UTC (rev 2263)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2010-06-19 02:54:56 UTC (rev 2264)
@@ -274,6 +274,22 @@
private AtomicInteger readAttempts = new AtomicInteger();
private AtomicInteger referenceHit = new AtomicInteger();
+ public long getBatchesAdded() {
+ return batchAdded.get();
+ }
+
+ public long getReadCount() {
+ return readCount.get();
+ }
+
+ public long getWriteCount() {
+ return writeCount.get();
+ }
+
+ public long getReadAttempts() {
+ return readAttempts.get();
+ }
+
@Override
public int getMaxProcessingBatchColumns() {
return maxProcessingBatches;
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/impl/FileStorageManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/impl/FileStorageManager.java 2010-06-18 23:56:02 UTC (rev 2263)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/impl/FileStorageManager.java 2010-06-19 02:54:56 UTC (rev 2264)
@@ -30,6 +30,7 @@
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;
+import java.util.concurrent.atomic.AtomicLong;
import org.teiid.common.buffer.FileStore;
import org.teiid.common.buffer.StorageManager;
@@ -47,8 +48,12 @@
public static final int DEFAULT_MAX_OPEN_FILES = 64;
public static final long DEFAULT_MAX_FILESIZE = 2L * 1024L;
+ public static final long DEFAULT_MAX_BUFFERSPACE = 50L * 1024L * 1024L * 1024L;
private static final String FILE_PREFIX = "b_"; //$NON-NLS-1$
+ private long maxBufferSpace = DEFAULT_MAX_BUFFERSPACE;
+ private AtomicLong usedBufferSpace = new AtomicLong();
+
private class FileInfo {
private File file;
private RandomAccessFile fileData; // may be null if not open
@@ -122,6 +127,11 @@
* Concurrent writes are prevented by FileStore, but in general should not happen since processing is single threaded.
*/
public void writeDirect(byte[] bytes, int offset, int length) throws TeiidComponentException {
+ long used = usedBufferSpace.addAndGet(length);
+ if (used > maxBufferSpace) {
+ usedBufferSpace.addAndGet(-length);
+ throw new TeiidComponentException(QueryExecPlugin.Util.getString("FileStoreageManager.space_exhausted", maxBufferSpace)); //$NON-NLS-1$
+ }
Map.Entry<Long, FileInfo> entry = this.storageFiles.lastEntry();
boolean createNew = false;
FileInfo fileInfo = null;
@@ -157,6 +167,7 @@
}
public synchronized void removeDirect() {
+ usedBufferSpace.addAndGet(-len);
for (FileInfo info : storageFiles.values()) {
info.delete();
}
@@ -252,5 +263,21 @@
public int getOpenFiles() {
return this.fileCache.size();
}
+
+ /**
+ * Get the used buffer space in bytes
+ * @return
+ */
+ public long getUsedBufferSpace() {
+ return usedBufferSpace.get();
+ }
+
+ /**
+ * Set the max amount of buffer space in bytes
+ * @param maxBufferSpace
+ */
+ public void setMaxBufferSpace(long maxBufferSpace) {
+ this.maxBufferSpace = maxBufferSpace;
+ }
}
Modified: trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties 2010-06-18 23:56:02 UTC (rev 2263)
+++ trunk/engine/src/main/resources/org/teiid/query/execution/i18n.properties 2010-06-19 02:54:56 UTC (rev 2264)
@@ -208,6 +208,7 @@
FileStorageManager.error_getting_free_disk_space=Error while seeking free disk space for directory: {0}
FileStorageManager.can_not_save_lobs=Can not save *Reference Lobs* into persistent disk storage.
FileStorageManager.batch_error=Error while converting batched data to file storage.
+FileStoreageManager.space_exhausted=Max buffer space of {0} bytes has been exceed. The current operation will be aborted.
TextTableNode.no_value=No value found for column \"{0}\" in the row ending on text line {1} in {2}.
TextTableNode.conversion_error=Could not convert value for column \"{0}\" in the row ending on text line {1} in {2}.
Modified: trunk/engine/src/test/java/org/teiid/common/buffer/impl/TestFileStorageManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/common/buffer/impl/TestFileStorageManager.java 2010-06-18 23:56:02 UTC (rev 2263)
+++ trunk/engine/src/test/java/org/teiid/common/buffer/impl/TestFileStorageManager.java 2010-06-19 02:54:56 UTC (rev 2264)
@@ -32,12 +32,9 @@
import org.junit.Test;
import org.teiid.common.buffer.FileStore;
-import org.teiid.common.buffer.StorageManager;
-import org.teiid.common.buffer.impl.FileStorageManager;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.util.UnitTestUtil;
-
public class TestFileStorageManager {
public FileStorageManager getStorageManager(Integer maxFileSize, Integer openFiles, String dir) throws TeiidComponentException {
@@ -53,14 +50,14 @@
return sm;
}
- @Test public void testAddGetBatch1() throws Exception {
- StorageManager sm = getStorageManager(null, null, null);
+ @Test public void testWrite() throws Exception {
+ FileStorageManager sm = getStorageManager(null, null, null);
String tsID = "0"; //$NON-NLS-1$
- // Add one batch
FileStore store = sm.createFileStore(tsID);
writeBytes(store);
- // Get that batch
+ assertEquals(2048, sm.getUsedBufferSpace());
store.remove();
+ assertEquals(0, sm.getUsedBufferSpace());
}
@Test public void testCreatesSpillFiles() throws Exception {
@@ -81,6 +78,15 @@
assertEquals(0, cache.size());
}
+
+ @Test(expected=TeiidComponentException.class) public void testMaxSpace() throws Exception {
+ FileStorageManager sm = getStorageManager(null, null, null);
+ sm.setMaxBufferSpace(1);
+ String tsID = "0"; //$NON-NLS-1$
+ // Add one batch
+ FileStore store = sm.createFileStore(tsID);
+ writeBytes(store);
+ }
static Random r = new Random();
Modified: trunk/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java 2010-06-18 23:56:02 UTC (rev 2263)
+++ trunk/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java 2010-06-19 02:54:56 UTC (rev 2264)
@@ -44,14 +44,15 @@
/**
- * Implement the BufferService for the DQP Embedded component. This implementation
- * may use either an all-memory model (which is prone to OutOfMemoryErrors) or
+ * Implements the BufferService. This implementation
+ * may use either an all-memory model (which is typically only for testing) or
* a mixed disk/memory model which requires use of a directory on the disk
* for file service access.
*/
@ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
public class BufferServiceImpl implements BufferService, Serializable {
private static final long serialVersionUID = -6217808623863643531L;
+ private static final long MB = 1<<20;
// Instance
private BufferManagerImpl bufferMgr;
@@ -65,6 +66,8 @@
private long maxFileSize = FileStorageManager.DEFAULT_MAX_FILESIZE; // 2GB
private int maxProcessingBatchesColumns = BufferManager.DEFAULT_MAX_PROCESSING_BATCHES;
private int maxReserveBatchColumns = BufferManager.DEFAULT_RESERVE_BUFFERS;
+ private long maxBufferSpace = FileStorageManager.DEFAULT_MAX_BUFFERSPACE;
+ private FileStorageManager fsm;
/**
* Clean the file storage directory on startup
@@ -90,10 +93,11 @@
// If necessary, add disk storage manager
if(useDisk) {
// Get the properties for FileStorageManager and create.
- FileStorageManager fsm = new FileStorageManager();
+ fsm = new FileStorageManager();
fsm.setStorageDirectory(bufferDir.getCanonicalPath());
fsm.setMaxFileSize(maxFileSize);
fsm.setMaxOpenFiles(maxOpenFiles);
+ fsm.setMaxBufferSpace(maxBufferSpace*MB);
fsm.initialize();
this.bufferMgr.setStorageManager(fsm);
@@ -139,7 +143,7 @@
}
public void setDiskDirectory(String dir) {
- this.bufferDir = new File(dir, "buffer");
+ this.bufferDir = new File(dir, "buffer"); //$NON-NLS-1$
if (!bufferDir.exists()) {
this.bufferDir.mkdirs();
}
@@ -191,7 +195,7 @@
this.maxProcessingBatchesColumns = value;
}
- @ManagementProperty(description="Max file size for buffer files (default 2GB)")
+ @ManagementProperty(description="Max file size, in MB, for buffer files (default 2GB)")
public long getMaxFileSize() {
return maxFileSize;
}
@@ -201,17 +205,54 @@
this.maxOpenFiles = maxOpenFiles;
}
- @ManagementProperty(description="#The number of batch columns guarenteed to a processing operation. Set this value lower if the workload typically" +
+ @ManagementProperty(description="The number of batch columns guarenteed to a processing operation. Set this value lower if the workload typically" +
"processes larger numbers of concurrent queries with large intermediate results from operations such as sorting, " +
"grouping, etc. (default 128)")
public int getMaxProcessingBatchesColumns() {
return maxProcessingBatchesColumns;
}
- @ManagementProperty(description="#The number of batch columns to allow in memory (default 16384). " +
+ @ManagementProperty(description="The number of batch columns to allow in memory (default 16384). " +
"This value should be set lower or higher depending on the available memory to Teiid in the VM. " +
"16384 is considered a good default for a dedicated 32-bit VM running Teiid with a 1 gig heap.")
public int getMaxReserveBatchColumns() {
return maxReserveBatchColumns;
}
+
+ @ManagementProperty(description="Max file storage space, in MB, to be used for buffer files (default 256G)")
+ public long getMaxBufferSpace() {
+ return maxBufferSpace;
+ }
+
+ public void setMaxBufferSpace(long maxBufferSpace) {
+ this.maxBufferSpace = maxBufferSpace;
+ }
+
+ @ManagementProperty(description="The currently used file buffer space in MB.", readOnly=true)
+ public long getUserBufferSpace() {
+ if (fsm != null) {
+ return fsm.getUsedBufferSpace()/MB;
+ }
+ return 0;
+ }
+
+ @ManagementProperty(description="The total number of batches added to the buffer mananger.", readOnly=true)
+ public long getBatchesAdded() {
+ return bufferMgr.getBatchesAdded();
+ }
+
+ @ManagementProperty(description="The total number of batches read from storage.", readOnly=true)
+ public long getReadCount() {
+ return bufferMgr.getReadCount();
+ }
+
+ @ManagementProperty(description="The total number of batches written to storage.", readOnly=true)
+ public long getWriteCount() {
+ return bufferMgr.getWriteCount();
+ }
+
+ @ManagementProperty(description="The total number of batch read attempts.", readOnly=true)
+ public long getReadAttempts() {
+ return bufferMgr.getReadAttempts();
+ }
}
14 years, 6 months