teiid SVN: r3673 - in branches/7.6.x: engine/src/main/java/org/teiid/dqp/internal/datamgr and 6 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-11-18 15:03:35 -0500 (Fri, 18 Nov 2011)
New Revision: 3673
Modified:
branches/7.6.x/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
branches/7.6.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
branches/7.6.x/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestConnectorManager.java
branches/7.6.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
branches/7.6.x/runtime/src/main/resources/org/teiid/runtime/i18n.properties
branches/7.6.x/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java
branches/7.6.x/test-integration/common/src/test/java/org/teiid/jdbc/TestLocalConnections.java
Log:
TEIID-1832: adding code to switch datasource or translator that has been modified on the VDB
Modified: branches/7.6.x/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
===================================================================
--- branches/7.6.x/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml 2011-11-18 18:01:18 UTC (rev 3672)
+++ branches/7.6.x/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml 2011-11-18 20:03:35 UTC (rev 3673)
@@ -88,6 +88,7 @@
<bean name="VDBStatusChecker" class="org.teiid.deployers.VDBStatusChecker">
<property name="VDBRepository"><inject bean="VDBRepository"/></property>
<property name="threadPool"><inject bean="jboss.system:service=ThreadPool"/></property>
+ <property name="translatorRepository"><inject bean="translatorRepository"/></property>
</bean>
<!-- Persistence class for the VDB deployment file -->
Modified: branches/7.6.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
===================================================================
--- branches/7.6.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java 2011-11-18 18:01:18 UTC (rev 3672)
+++ branches/7.6.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java 2011-11-18 20:03:35 UTC (rev 3673)
@@ -233,7 +233,7 @@
* Get the <code>Translator</code> object managed by this manager.
* @return the <code>ExecutionFactory</code>.
*/
- protected ExecutionFactory<Object, Object> getExecutionFactory() {
+ public ExecutionFactory<Object, Object> getExecutionFactory() {
return this.executionFactory;
}
Modified: branches/7.6.x/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestConnectorManager.java
===================================================================
--- branches/7.6.x/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestConnectorManager.java 2011-11-18 18:01:18 UTC (rev 3672)
+++ branches/7.6.x/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestConnectorManager.java 2011-11-18 20:03:35 UTC (rev 3673)
@@ -46,7 +46,7 @@
static ConnectorManager getConnectorManager() throws Exception {
final FakeConnector c = new FakeConnector();
ConnectorManager cm = new ConnectorManager("FakeConnector","FakeConnector") { //$NON-NLS-1$ //$NON-NLS-2$
- protected ExecutionFactory getExecutionFactory() {
+ public ExecutionFactory getExecutionFactory() {
return c;
}
protected Object getConnectionFactory(){
Modified: branches/7.6.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
===================================================================
--- branches/7.6.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2011-11-18 18:01:18 UTC (rev 3672)
+++ branches/7.6.x/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2011-11-18 20:03:35 UTC (rev 3673)
@@ -533,7 +533,10 @@
getView().updateComponent(mc);
} catch (Exception e) {
throw new AdminComponentException(e.getMessage(), e);
- }
+ }
+
+ // enforce the changes in the engine.
+ this.statusChecker.dataSourceReplaced(vdbName, vdbVersion, modelName, sourceName, translatorName, dsName);
}
private void manageRoleToDataPolicy(String vdbName, int vdbVersion, String policyName, String role, boolean add) throws AdminException {
Modified: branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
===================================================================
--- branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-11-18 18:01:18 UTC (rev 3672)
+++ branches/7.6.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-11-18 20:03:35 UTC (rev 3673)
@@ -23,22 +23,29 @@
import java.util.LinkedList;
+import org.jboss.deployers.spi.DeploymentException;
import org.jboss.util.threadpool.ThreadPool;
+import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.AdminProcessingException;
import org.teiid.adminapi.Model;
+import org.teiid.adminapi.Translator;
import org.teiid.adminapi.VDB;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.dqp.internal.datamgr.ConnectorManager;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
+import org.teiid.dqp.internal.datamgr.TranslatorRepository;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.runtime.RuntimePlugin;
+import org.teiid.translator.ExecutionFactory;
public class VDBStatusChecker {
private static final String JAVA_CONTEXT = "java:"; //$NON-NLS-1$
private VDBRepository vdbRepository;
private ThreadPool threadPool;
+ private TranslatorRepository translatorRepository;
public void translatorAdded(String translatorName) {
resourceAdded(translatorName, true);
@@ -62,6 +69,49 @@
resourceremoved(dataSourceName, false);
}
+ public void dataSourceReplaced(String vdbName, int vdbVersion,
+ String modelName, String sourceName, String translatorName,
+ String dsName) throws AdminException {
+ if (dsName.startsWith(JAVA_CONTEXT)) {
+ dsName = dsName.substring(5);
+ }
+
+ VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
+ ModelMetaData model = vdb.getModel(modelName);
+
+ synchronized (vdb) {
+ ConnectorManagerRepository cmr = vdb.getAttachment(ConnectorManagerRepository.class);
+ ConnectorManager cm = cmr.getConnectorManager(sourceName);
+ ExecutionFactory<Object, Object> ef = cm.getExecutionFactory();
+
+ boolean dsReplaced = false;
+ if (!cm.getConnectionName().equals(dsName)){
+ vdb.setStatus(VDB.Status.INACTIVE);
+ String msg = RuntimePlugin.Util.getString("datasource_replaced", vdb.getName(), vdb.getVersion(), model.getSourceTranslatorName(sourceName), dsName); //$NON-NLS-1$
+ model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), msg);
+ cm = new ConnectorManager(translatorName, dsName);
+ cm.setExecutionFactory(ef);
+ cm.setModelName(modelName);
+ cmr.addConnectorManager(sourceName, cm);
+ dsReplaced = true;
+ }
+
+ if (!cm.getTranslatorName().equals(translatorName)) {
+ try {
+ Translator t = this.translatorRepository.getTranslatorMetaData(translatorName);
+ ef = TranslatorUtil.buildExecutionFactory(t);
+ cm.setExecutionFactory(ef);
+ } catch (DeploymentException e) {
+ throw new AdminProcessingException(e.getCause());
+ }
+ }
+
+ if (dsReplaced) {
+ resourceAdded(dsName, false);
+ }
+ }
+ }
+
public void setVDBRepository(VDBRepository repo) {
this.vdbRepository = repo;
}
@@ -173,4 +223,8 @@
public void setThreadPool(ThreadPool threadPool) {
this.threadPool = threadPool;
}
+
+ public void setTranslatorRepository(TranslatorRepository repo) {
+ this.translatorRepository = repo;
+ }
}
Modified: branches/7.6.x/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- branches/7.6.x/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2011-11-18 18:01:18 UTC (rev 3672)
+++ branches/7.6.x/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2011-11-18 20:03:35 UTC (rev 3673)
@@ -70,6 +70,7 @@
translator_not_found=For {0}.{1} VDB, Translator "{2}" not found.
recursive_delegation=For {0}.{1} VDB, recursive delegation {2} found.
datasource_not_found=For {0}.{1} VDB, Data Source "{2}" not found.
+datasource_replaced=For {0}.{1} VDB, Data Source "{2}" replaced with "{3}"
vdb_activated={0}.{1} status has been changed to active
vdb_inactivated={0}.{1} status has been changed to inactive. Check the required translators and data sources!
translator_added=Teiid translator "{0}" has been added.
Modified: branches/7.6.x/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java
===================================================================
--- branches/7.6.x/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java 2011-11-18 18:01:18 UTC (rev 3672)
+++ branches/7.6.x/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java 2011-11-18 20:03:35 UTC (rev 3673)
@@ -78,7 +78,7 @@
Mockito.stub(ef.getPushDownFunctions()).toReturn(funcs);
ConnectorManager cm = new ConnectorManager(translatorName,connectionName) {
- protected ExecutionFactory getExecutionFactory() {
+ public ExecutionFactory getExecutionFactory() {
return ef;
}
};
Modified: branches/7.6.x/test-integration/common/src/test/java/org/teiid/jdbc/TestLocalConnections.java
===================================================================
--- branches/7.6.x/test-integration/common/src/test/java/org/teiid/jdbc/TestLocalConnections.java 2011-11-18 18:01:18 UTC (rev 3672)
+++ branches/7.6.x/test-integration/common/src/test/java/org/teiid/jdbc/TestLocalConnections.java 2011-11-18 20:03:35 UTC (rev 3673)
@@ -102,7 +102,7 @@
public ConnectorManager getConnectorManager(String connectorName) {
return new ConnectorManager(connectorName, connectorName) {
@Override
- protected ExecutionFactory<Object, Object> getExecutionFactory() {
+ public ExecutionFactory<Object, Object> getExecutionFactory() {
return new ExecutionFactory<Object, Object>() {
@Override
public Execution createExecution(Command command,
13 years, 1 month
teiid SVN: r3672 - in trunk: client/src/main/resources/org/teiid/jdbc and 4 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-11-18 13:01:18 -0500 (Fri, 18 Nov 2011)
New Revision: 3672
Modified:
trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java
trunk/client/src/main/java/org/teiid/jdbc/ParameterMetaDataImpl.java
trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java
trunk/client/src/main/java/org/teiid/jdbc/TeiidStatement.java
trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties
trunk/client/src/test/java/org/teiid/jdbc/TestCallableStatement.java
trunk/common-core/src/main/java/org/teiid/core/util/SqlUtil.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
Log:
TEIID-174 adding support for callablestatement named get/set methods
Modified: trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -31,17 +31,18 @@
import java.sql.CallableStatement;
import java.sql.Clob;
import java.sql.Date;
+import java.sql.NClob;
import java.sql.Ref;
+import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLXML;
-import java.sql.NClob;
-import java.sql.RowId;
-
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Map;
+import javax.sql.rowset.serial.SerialBlob;
+
import org.teiid.client.RequestMessage;
import org.teiid.client.RequestMessage.ResultsMode;
import org.teiid.client.RequestMessage.StatementType;
@@ -87,6 +88,12 @@
}
@Override
+ protected void resetExecutionState() throws SQLException {
+ super.resetExecutionState();
+ parameterValue = null;
+ }
+
+ @Override
protected RequestMessage createRequestMessage(String[] commands,
boolean isBatchedCommand, ResultsMode resultsMode) {
RequestMessage message = super.createRequestMessage(commands, isBatchedCommand, resultsMode);
@@ -160,27 +167,18 @@
return DataTypeTransformer.getClob(getObject(parameterIndex));
}
- /**
- * <p>Gets the value of a OUTPUT parameter as a java.sql.Date object.
- * @param parameterIndex whose value is to be fetched from the result.
- * @return The parameter at the given index is returned as a Date object.
- * @throws SQLException if param datatype is not DATE
- */
public java.sql.Date getDate(int parameterIndex) throws SQLException {
return getDate(parameterIndex, null);
}
- /**
- * <p>Gets the value of a OUTPUT parameter as a java.sql.Date object. Calender
- * object contains the timezone info for the Date.
- * @param parameterIndex whose value is to be fetched from the result.
- * @param Calendar object used to construct the Date object.
- * @return The parameter at the given index is returned as a Date object.
- * @throws SQLException if param datatype is not DATE
- */
public java.sql.Date getDate(int parameterIndex, Calendar cal) throws SQLException {
- Date value = DataTypeTransformer.getDate(getObject(parameterIndex));
+ Object val = getObject(parameterIndex);
+ return getDate(cal, val);
+ }
+ private java.sql.Date getDate(Calendar cal, Object val) throws SQLException {
+ Date value = DataTypeTransformer.getDate(val);
+
if (value == null) {
return null;
}
@@ -190,7 +188,7 @@
}
return value;
- }
+ }
/**
* <p>Gets the value of a OUTPUT parameter as a double.
@@ -232,66 +230,46 @@
return DataTypeTransformer.getLong(getObject(parameterIndex));
}
- /**
- * <p>Gets the value of a OUTPUT parameter as an object.
- * @param parameterIndex whose value is to be fetched from the result.
- * @return The parameter at the given index is returned as an object.
- * @throws SQLException
- */
public Object getObject(int parameterIndex) throws SQLException {
- //checkParameter(parameterIndex);
-
- Object indexInResults = this.outParamIndexMap.get(new Integer(parameterIndex));
+ return getObject(Integer.valueOf(parameterIndex));
+ }
+
+ Object getObject(Object parameterIndex) throws SQLException {
+ Integer indexInResults = null;
+ if (parameterIndex instanceof String) {
+ indexInResults = this.outParamByName.get(parameterIndex);
+ } else {
+ indexInResults = this.outParamIndexMap.get(parameterIndex);
+ }
if(indexInResults == null){
- throw new IllegalArgumentException(JDBCPlugin.Util.getString("MMCallableStatement.Param_not_found", parameterIndex)); //$NON-NLS-1$
+ throw new TeiidSQLException(JDBCPlugin.Util.getString("MMCallableStatement.Param_not_found", parameterIndex)); //$NON-NLS-1$
}
checkStatement();
- parameterValue = resultSet.getOutputParamValue(((Integer)indexInResults).intValue());
+ parameterValue = resultSet.getOutputParamValue(indexInResults);
return parameterValue;
}
- /**
- * <p>Gets the value of a OUTPUT parameter as a short.
- * @param parameterIndex whose value is to be fetched from the result.
- * @return The parameter at the given index is returned as a short value.
- * @throws SQLException if param datatype is not SMALLINT
- */
public short getShort(int parameterIndex) throws SQLException {
return DataTypeTransformer.getShort(getObject(parameterIndex));
}
- /**
- * <p>Gets the value of a OUTPUT parameter as a String.
- * @param parameterIndex whose value is to be fetched from the result.
- * @return The parameter at the given index is returned as a String object.
- * @throws SQLException if param datatype is not CHAR, VARCHAR, LONGVARCHAR
- */
public String getString(int parameterIndex) throws SQLException {
- // return the parameter value a String object
- return getObject(parameterIndex).toString();
+ return DataTypeTransformer.getString(getObject(parameterIndex));
}
- /**
- * <p>Gets the value of a OUTPUT parameter as a java.sql.Time object.
- * @param parameterIndex whose value is to be fetched from the result.
- * @return The parameter at the given index is returned as a Time object.
- * @throws SQLException if param datatype is not TIME
- */
public Time getTime(int parameterIndex) throws SQLException {
return getTime(parameterIndex, null);
}
- /**
- * <p>Gets the value of a OUTPUT parameter as a java.sql.Timestamp object. Calendar
- * object contains the timezone information.
- * @param parameterIndex whose value is to be fetched from the result.
- * @param Calendar object used to construct the Date object.
- * @return The parameter at the given index is returned as a Time object.
- * @throws SQLException if param datatype is not TIME
- */
public Time getTime(int parameterIndex, java.util.Calendar cal) throws SQLException {
- Time value = DataTypeTransformer.getTime(getObject(parameterIndex));
+ Object val = getObject(parameterIndex);
+ return getTime(cal, val);
+ }
+ private Time getTime(java.util.Calendar cal, Object val)
+ throws SQLException {
+ Time value = DataTypeTransformer.getTime(val);
+
if (value == null) {
return null;
}
@@ -301,29 +279,21 @@
}
return value;
- }
+ }
- /**
- * <p>Gets the value of a OUTPUT parameter as a java.sql.Timestamp object.
- * @param parameterIndex whose value is to be fetched from the result.
- * @return The parameter at the given index is returned as a Timestamp object.
- * @throws SQLException if param datatype is not TIMESTAMP
- */
public Timestamp getTimestamp(int parameterIndex) throws SQLException {
return getTimestamp(parameterIndex, null);
}
- /**
- * <p>Gets the value of a OUTPUT parameter as a java.sql.Timestamp object. Calendar
- * object contains the timezone information.
- * @param parameterIndex whose value is to be fetched from the result.
- * @param Calendar object used to construct the Date object.
- * @return The parameter at the given index is returned as a Timestamp object.
- * @throws SQLException if param datatype is not TIMESTAMP
- */
public Timestamp getTimestamp(int parameterIndex, java.util.Calendar cal) throws SQLException {
- Timestamp value = DataTypeTransformer.getTimestamp(getObject(parameterIndex));
+ Object val = getObject(parameterIndex);
+ return getTimestamp(cal, val);
+ }
+ private Timestamp getTimestamp(java.util.Calendar cal, Object val)
+ throws SQLException {
+ Timestamp value = DataTypeTransformer.getTimestamp(val);
+
if (value == null) {
return null;
}
@@ -333,49 +303,20 @@
}
return value;
- }
+ }
- /**
- * <p>Register the OUT parameter in the ordinal position parameterIndex to jdbcsql
- * type. Scale is used by setXXX methods to determine number of decimals.
- * @param parameterIndex. Index of the OUT parameter in the stored procedure.
- * @param jdbcSqlType. SQL type codes from java.sql.Types
- * @param SQLException, should never occur
- */
public void registerOutParameter(int parameterIndex, int jdbcSqlType) throws SQLException {
// ignore - we don't care
}
- /**
- * <p>Register the OUT parameter in the ordinal position parameterIndex to jdbcsql
- * type. Scale is used by setXXX methods to determine number of decimals.
- * @param parameterIndex. Index of the OUT parameter in the stored procedure.
- * @param jdbcSqlType. SQL type codes from java.sql.Types
- * @param scale. The number of decimal digits on the OUT param.
- * @param SQLException, should never occur
- */
public void registerOutParameter(int parameterIndex, int jdbcSqlType, int scale) throws SQLException {
// ignore - we don't care
}
- /**
- * <p>Register the OUT parameter in the ordinal position parameterIndex to jdbcsql
- * type. The param typename(SQL name for user-named type) is ignored as SQL3
- * datatypes are not supported.
- * @param parameterIndex. Index of the OUT parameter in the stored procedure.
- * @param jdbcSqlType. SQL type codes from java.sql.Types
- * @param typeName. SQL name of user-named type being used
- * @param SQLException, should never occur
- */
public void registerOutParameter (int parameterIndex, int jdbcSqlType, String typeName) throws SQLException {
// ignore - we don't care
}
- /**
- * <p>Indicates whether the last OUT parameter read was a return null.
- * @return true if the last param read was null else false.
- * @throws SQLException, if the statement is already closed.
- */
public boolean wasNull() throws SQLException {
checkStatement();
@@ -395,19 +336,19 @@
}
public BigDecimal getBigDecimal(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getBigDecimal(getObject(parameterName));
}
public Blob getBlob(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getBlob(getObject(parameterName));
}
public boolean getBoolean(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getBoolean(getObject(parameterName));
}
public byte getByte(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getByte(getObject(parameterName));
}
public byte[] getBytes(int parameterIndex) throws SQLException {
@@ -415,7 +356,7 @@
}
public byte[] getBytes(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getBytes(getObject(parameterName));
}
public Reader getCharacterStream(int parameterIndex) throws SQLException {
@@ -423,43 +364,43 @@
}
public Reader getCharacterStream(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getCharacterStream(getObject(parameterName));
}
public Clob getClob(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getClob(getObject(parameterName));
}
public Date getDate(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getDate(getObject(parameterName));
}
public Date getDate(String parameterName, Calendar cal) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return getDate(cal, getObject(parameterName));
}
public double getDouble(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getDouble(getObject(parameterName));
}
public float getFloat(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getFloat(getObject(parameterName));
}
public int getInt(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getInteger(getObject(parameterName));
}
public long getLong(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getLong(getObject(parameterName));
}
public Reader getNCharacterStream(int parameterIndex) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getCharacterStream(getObject(parameterIndex));
}
public Reader getNCharacterStream(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getCharacterStream(getObject(parameterName));
}
public NClob getNClob(int parameterIndex) throws SQLException {
@@ -467,19 +408,19 @@
}
public NClob getNClob(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getNClob(getObject(parameterName));
}
public String getNString(int parameterIndex) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getString(getObject(parameterIndex));
}
public String getNString(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getString(getObject(parameterName));
}
public Object getObject(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return getObject((Object)parameterName);
}
public Object getObject(int parameterIndex, Map<String, Class<?>> map) throws SQLException {
@@ -507,31 +448,31 @@
}
public SQLXML getSQLXML(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getSQLXML(getObject(parameterName));
}
public short getShort(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getShort(getObject(parameterName));
}
public String getString(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getString(getObject(parameterName));
}
public Time getTime(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getTime(getObject(parameterName));
}
public Time getTime(String parameterName, Calendar cal) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return getTime(cal, getObject(parameterName));
}
public Timestamp getTimestamp(String parameterName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getTimestamp(getObject(parameterName));
}
public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return getTimestamp(cal, getObject(parameterName));
}
public URL getURL(int parameterIndex) throws SQLException {
@@ -543,176 +484,174 @@
}
public void registerOutParameter(String parameterName, int sqlType) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
}
public void registerOutParameter(String parameterName, int sqlType,int scale) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
}
public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
}
public void setAsciiStream(String parameterName, InputStream x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setAsciiStream((Object)parameterName, x);
}
public void setAsciiStream(String parameterName, InputStream x, int length) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setAsciiStream((Object)parameterName, x);
}
public void setAsciiStream(String parameterName, InputStream x, long length) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setAsciiStream((Object)parameterName, x);
}
public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject(parameterName, x);
}
public void setBinaryStream(String parameterName, InputStream x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setBlob((Object)parameterName, x);
}
public void setBinaryStream(String parameterName, InputStream x, int length)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setBinaryStream(parameterName, x);
}
public void setBinaryStream(String parameterName, InputStream x, long length)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setBinaryStream(parameterName, x);
}
public void setBlob(String parameterName, Blob x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject(parameterName, x);
}
public void setBlob(String parameterName, InputStream inputStream)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setBlob((Object)parameterName, inputStream);
}
public void setBlob(String parameterName, InputStream inputStream,
long length) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setBlob((Object)parameterName, inputStream);
}
public void setBoolean(String parameterName, boolean x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setByte(String parameterName, byte x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setBytes(String parameterName, byte[] x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, new SerialBlob(x));
}
public void setCharacterStream(String parameterName, Reader reader)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException(); }
+ setClob(parameterName, reader);
+ }
public void setCharacterStream(String parameterName, Reader reader,
int length) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setClob(parameterName, reader);
}
public void setCharacterStream(String parameterName, Reader reader,
long length) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setClob(parameterName, reader);
}
public void setClob(String parameterName, Clob x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setClob(String parameterName, Reader reader)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setClob((Object)parameterName, reader);
}
public void setClob(String parameterName, Reader reader, long length)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setClob((Object)parameterName, reader);
}
public void setDate(String parameterName, Date x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setDate(String parameterName, Date x, Calendar cal)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setDate((Object)parameterName, x, cal);
}
public void setDouble(String parameterName, double x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setFloat(String parameterName, float x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setInt(String parameterName, int x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setLong(String parameterName, long x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setNCharacterStream(String parameterName, Reader value)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setClob((Object)parameterName, value);
}
public void setNCharacterStream(String parameterName, Reader value,
long length) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setClob((Object)parameterName, value);
}
public void setNClob(String parameterName, NClob value) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, value);
}
public void setNClob(String parameterName, Reader reader)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setClob((Object)parameterName, reader);
}
public void setNClob(String parameterName, Reader reader, long length)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setClob((Object)parameterName, reader);
}
public void setNString(String parameterName, String value)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, null);
}
public void setNull(String parameterName, int sqlType) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, null);
}
public void setNull(String parameterName, int sqlType, String typeName)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, null);
}
public void setObject(String parameterName, Object x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setObject(String parameterName, Object x, int targetSqlType)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x, targetSqlType);
}
public void setObject(String parameterName, Object x, int targetSqlType,
int scale) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x, targetSqlType, scale);
}
public void setRowId(String parameterName, RowId x) throws SQLException {
@@ -721,39 +660,38 @@
public void setSQLXML(String parameterName, SQLXML xmlObject)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, xmlObject);
}
-
public void setShort(String parameterName, short x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setString(String parameterName, String x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setTime(String parameterName, Time x) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setTime(String parameterName, Time x, Calendar cal)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setTime((Object)parameterName, x, cal);
}
public void setTimestamp(String parameterName, Timestamp x)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, x);
}
public void setTimestamp(String parameterName, Timestamp x, Calendar cal)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setTimestamp((Object)parameterName, x, cal);
}
public void setURL(String parameterName, URL val) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject((Object)parameterName, val);
}
}
\ No newline at end of file
Modified: trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -22,12 +22,20 @@
package org.teiid.jdbc;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
import java.math.BigDecimal;
+import java.nio.charset.Charset;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
+import java.sql.NClob;
import java.sql.SQLException;
import java.sql.SQLXML;
import java.sql.Time;
@@ -36,6 +44,7 @@
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.TransformationException;
import org.teiid.core.types.DataTypeManager.DefaultDataClasses;
+import org.teiid.core.util.ReaderInputStream;
/**
@@ -281,4 +290,41 @@
return new StringReader(getString(value));
}
+
+ static final InputStream getAsciiStream(Object value) throws SQLException {
+ if (value == null) {
+ return null;
+ }
+
+ if (value instanceof Clob) {
+ return ((Clob) value).getAsciiStream();
+ }
+
+ if (value instanceof SQLXML) {
+ //TODO: could check the SQLXML encoding
+ return new ReaderInputStream(((SQLXML)value).getCharacterStream(), Charset.forName("ASCII")); //$NON-NLS-1$
+ }
+
+ return new ByteArrayInputStream(getString(value).getBytes(Charset.forName("ASCII"))); //$NON-NLS-1$
+ }
+
+ static final NClob getNClob(Object value) throws SQLException {
+ final Clob clob = getClob(value);
+ if (clob == null) {
+ return null;
+ }
+ return (NClob) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {NClob.class}, new InvocationHandler() {
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ try {
+ return method.invoke(clob, args);
+ } catch (InvocationTargetException e) {
+ throw e.getCause();
+ }
+ }
+ });
+ }
+
}
\ No newline at end of file
Modified: trunk/client/src/main/java/org/teiid/jdbc/ParameterMetaDataImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/ParameterMetaDataImpl.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/client/src/main/java/org/teiid/jdbc/ParameterMetaDataImpl.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -86,5 +86,9 @@
public boolean isSigned(int param) throws SQLException {
return metadata.isSigned(param);
}
+
+ public String getParameterName(int param) throws SQLException {
+ return metadata.getColumnName(param);
+ }
}
Modified: trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -32,7 +32,6 @@
import java.sql.Blob;
import java.sql.Clob;
import java.sql.NClob;
-import java.sql.ParameterMetaData;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
@@ -62,7 +61,6 @@
import org.teiid.core.types.InputStreamFactory;
import org.teiid.core.types.JDBCSQLTypeInfo;
import org.teiid.core.types.Streamable;
-import org.teiid.core.util.ArgCheck;
import org.teiid.core.util.ReaderInputStream;
import org.teiid.core.util.SqlUtil;
import org.teiid.core.util.TimestampWithTimezone;
@@ -80,11 +78,12 @@
*/
public class PreparedStatementImpl extends StatementImpl implements TeiidPreparedStatement {
- // sql, which this prepared statement is operating on
+ // sql, which this prepared statement is operating on
protected String prepareSql;
//map that holds parameter index to values for prepared statements
private Map<Integer, Object> parameterMap;
+ private TreeMap<String, Integer> paramsByName;
//a list of map that holds parameter index to values for prepared statements
protected List<List<Object>> batchParameterList;
@@ -92,7 +91,7 @@
// metadata
private MetadataResult metadataResults;
private ResultSetMetaData metadata;
- private ParameterMetaData parameterMetaData;
+ private ParameterMetaDataImpl parameterMetaData;
private Calendar serverCalendar;
@@ -115,8 +114,9 @@
PreparedStatementImpl(ConnectionImpl connection, String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
super(connection, resultSetType, resultSetConcurrency);
- // this sql is for callable statement, don't check any more
- ArgCheck.isNotNull(sql, JDBCPlugin.Util.getString("MMPreparedStatement.Err_prep_sql")); //$NON-NLS-1$
+ if (sql == null) {
+ throw new TeiidSQLException(JDBCPlugin.Util.getString("MMPreparedStatement.Err_prep_sql")); //$NON-NLS-1$
+ }
this.prepareSql = sql;
TimeZone timezone = connection.getServerConnection().getLogonResult().getTimeZone();
@@ -299,7 +299,7 @@
}
public void setBoolean (int parameterIndex, boolean value) throws SQLException {
- setObject(parameterIndex, value);
+ setObject(parameterIndex, Boolean.valueOf(value));
}
public void setByte(int parameterIndex, byte value) throws SQLException {
@@ -321,9 +321,13 @@
public void setDate(int parameterIndex, java.sql.Date value) throws SQLException {
setDate(parameterIndex, value, null);
}
-
+
public void setDate(int parameterIndex, java.sql.Date x ,java.util.Calendar cal) throws SQLException {
+ setDate(Integer.valueOf(parameterIndex), x, cal);
+ }
+ void setDate(Object parameterIndex, java.sql.Date x ,java.util.Calendar cal) throws SQLException {
+
if (cal == null || x == null) {
setObject(parameterIndex, x);
return;
@@ -356,9 +360,13 @@
public void setNull(int parameterIndex, int jdbcType, String typeName) throws SQLException {
setObject(parameterIndex, null);
}
-
+
public void setObject (int parameterIndex, Object value, int targetJdbcType, int scale) throws SQLException {
+ setObject(parameterIndex, value, targetJdbcType, scale);
+ }
+ void setObject (Object parameterIndex, Object value, int targetJdbcType, int scale) throws SQLException {
+
if(value == null) {
setObject(parameterIndex, null);
return;
@@ -366,7 +374,7 @@
if(targetJdbcType != Types.DECIMAL || targetJdbcType != Types.NUMERIC) {
setObject(parameterIndex, value, targetJdbcType);
- // Decimal and NUMERIC types correspong to java.math.BigDecimal
+ // Decimal and NUMERIC types correspond to java.math.BigDecimal
} else {
// transform the object to a BigDecimal
BigDecimal bigDecimalObject = DataTypeTransformer.getBigDecimal(value);
@@ -376,10 +384,13 @@
}
public void setObject(int parameterIndex, Object value, int targetJdbcType) throws SQLException {
+ setObject(Integer.valueOf(parameterIndex), value, targetJdbcType);
+ }
+ void setObject(Object parameterIndex, Object value, int targetJdbcType) throws SQLException {
Object targetObject = null;
- if(value == null) {
+ if(value == null) {
setObject(parameterIndex, null);
return;
}
@@ -387,8 +398,10 @@
// get the java class name for the given JDBC type
String javaClassName = JDBCSQLTypeInfo.getJavaClassName(targetJdbcType);
// transform the value to the target datatype
- if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.STRING_CLASS)) {
- targetObject = value.toString();
+ if (targetJdbcType == Types.JAVA_OBJECT) {
+ targetObject = value;
+ } else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.STRING_CLASS)) {
+ targetObject = DataTypeTransformer.getString(value);
} else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.CHAR_CLASS)) {
targetObject = DataTypeTransformer.getCharacter(value);
} else if(javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.INTEGER_CLASS)) {
@@ -417,6 +430,8 @@
targetObject = DataTypeTransformer.getBlob(value);
} else if (javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.CLOB_CLASS)) {
targetObject = DataTypeTransformer.getClob(value);
+ } else if (javaClassName.equalsIgnoreCase(JDBCSQLTypeInfo.XML_CLASS)) {
+ targetObject = DataTypeTransformer.getSQLXML(value);
} else {
String msg = JDBCPlugin.Util.getString("MMPreparedStatement.Err_transform_obj"); //$NON-NLS-1$
throw new TeiidSQLException(msg);
@@ -424,10 +439,31 @@
setObject(parameterIndex, targetObject);
}
-
+
public void setObject(int parameterIndex, Object value) throws SQLException {
- ArgCheck.isPositive(parameterIndex, JDBCPlugin.Util.getString("MMPreparedStatement.Invalid_param_index")); //$NON-NLS-1$
+ setObject(Integer.valueOf(parameterIndex), value);
+ }
+ void setObject(Object parameterIndex, Object value) throws SQLException {
+ if (parameterIndex instanceof String) {
+ String s = (String)parameterIndex;
+ if (paramsByName == null) {
+ paramsByName = new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER);
+ ParameterMetaDataImpl pmdi = getParameterMetaData();
+ for (int i = 1; i <= pmdi.getParameterCount(); i++) {
+ String name = pmdi.getParameterName(i);
+ paramsByName.put(name, i);
+ }
+ }
+ parameterIndex = paramsByName.get(s);
+ if (parameterIndex == null) {
+ throw new TeiidSQLException(JDBCPlugin.Util.getString("MMCallableStatement.Param_not_found", s)); //$NON-NLS-1$
+ }
+ }
+ if ((Integer)parameterIndex < 1) {
+ throw new TeiidSQLException(JDBCPlugin.Util.getString("MMPreparedStatement.Invalid_param_index")); //$NON-NLS-1$
+ }
+
if(parameterMap == null){
parameterMap = new TreeMap<Integer, Object>();
}
@@ -435,11 +471,11 @@
if (serverCalendar != null && value instanceof java.util.Date) {
value = TimestampWithTimezone.create((java.util.Date)value, getDefaultCalendar().getTimeZone(), serverCalendar, value.getClass());
}
- parameterMap.put(parameterIndex, value);
+ parameterMap.put((Integer)parameterIndex, value);
}
public void setShort(int parameterIndex, short value) throws SQLException {
- setObject(parameterIndex, value);
+ setObject(parameterIndex, Short.valueOf(value));
}
public void setString(int parameterIndex, String value) throws SQLException {
@@ -449,9 +485,13 @@
public void setTime(int parameterIndex, java.sql.Time value) throws SQLException {
setTime(parameterIndex, value, null);
}
-
+
public void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal) throws SQLException {
+ setTime(Integer.valueOf(parameterIndex), x, cal);
+ }
+ void setTime(Object parameterIndex, java.sql.Time x, java.util.Calendar cal) throws SQLException {
+
if (cal == null || x == null) {
setObject(parameterIndex, x);
return;
@@ -464,9 +504,13 @@
public void setTimestamp(int parameterIndex, java.sql.Timestamp value) throws SQLException {
setTimestamp(parameterIndex, value, null);
}
-
+
public void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal) throws SQLException {
+ setTimestamp(Integer.valueOf(parameterIndex), x, cal);
+ }
+ void setTimestamp(Object parameterIndex, java.sql.Timestamp x, java.util.Calendar cal) throws SQLException {
+
if (cal == null || x == null) {
setObject(parameterIndex, x);
return;
@@ -494,7 +538,7 @@
return new ArrayList<Object>(parameterMap.values());
}
- public ParameterMetaData getParameterMetaData() throws SQLException {
+ public ParameterMetaDataImpl getParameterMetaData() throws SQLException {
if (parameterMetaData == null) {
//TODO: some of the base implementation of ResultSetMetadata could be on the MetadataProvider
this.parameterMetaData = new ParameterMetaDataImpl(new ResultSetMetaDataImpl(new MetadataProvider(getMetadataResults().getParameterMetadata()), this.getExecutionProperty(ExecutionProperties.JDBC4COLUMNNAMEANDLABELSEMANTICS)));
@@ -517,8 +561,18 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- public void setAsciiStream(int parameterIndex, final InputStream x)
+ @Override
+ public void setAsciiStream(int parameterIndex, final InputStream x)
+ throws SQLException {
+ setAsciiStream(Integer.valueOf(parameterIndex), x);
+ }
+
+ void setAsciiStream(Object parameterIndex, final InputStream x)
throws SQLException {
+ if (x == null) {
+ this.setObject(parameterIndex, null);
+ return;
+ }
this.setObject(parameterIndex, new ClobImpl(new InputStreamFactory() {
@Override
public InputStream getInputStream() throws IOException {
@@ -543,6 +597,11 @@
}
public void setBlob(int parameterIndex, final InputStream inputStream)
+ throws SQLException {
+ setBlob(parameterIndex, inputStream);
+ }
+
+ void setBlob(Object parameterIndex, final InputStream inputStream)
throws SQLException {
if (inputStream == null) {
this.setObject(parameterIndex, null);
@@ -569,8 +628,12 @@
long length) throws SQLException {
setCharacterStream(parameterIndex, reader);
}
+
+ public void setClob(int parameterIndex, final Reader reader) throws SQLException {
+ setClob(Integer.valueOf(parameterIndex), reader);
+ }
- public void setClob(int parameterIndex, final Reader reader) throws SQLException {
+ void setClob(Object parameterIndex, final Reader reader) throws SQLException {
if (reader == null) {
this.setObject(parameterIndex, null);
return;
@@ -591,30 +654,30 @@
public void setNCharacterStream(int parameterIndex, Reader value)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setClob(parameterIndex, value);
}
public void setNCharacterStream(int parameterIndex, Reader value,
long length) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setCharacterStream(parameterIndex, value);
}
public void setNClob(int parameterIndex, NClob value) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject(parameterIndex, value);
}
public void setNClob(int parameterIndex, Reader reader) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setClob(parameterIndex, reader);
}
public void setNClob(int parameterIndex, Reader reader, long length)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setClob(parameterIndex, reader);
}
public void setNString(int parameterIndex, String value)
throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ setObject(parameterIndex, value);
}
public void setRef(int parameterIndex, Ref x) throws SQLException {
Modified: trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -529,31 +529,10 @@
return getByte(findColumn(columnName));
}
- /**
- * This method will return the value in the current row as an array of byte
- * values
- *
- * @param columnIndex
- * The column position in the current row whose value is to be read.
- * @return The value of the column at columnIndex as an array of bytes.
- * @throws SQLException
- * if there is an error accessing or converting the result value
- */
public byte[] getBytes(int columnIndex) throws SQLException {
return DataTypeTransformer.getBytes(getObject(columnIndex));
}
- /**
- * This method will return the value in the current row as an array of byte
- * values
- *
- * @param columnName
- * The column name in the current row whose value is to be updated.
- * @return byte[]. The value of the column at columnIndex as an array of
- * bytes.
- * @throws SQLException
- * if there is an error accessing or converting the result value
- */
public byte[] getBytes(String columnName) throws SQLException {
return getBytes(findColumn(columnName));
}
@@ -574,28 +553,12 @@
return ResultSet.CONCUR_READ_ONLY;
}
- /**
- * This method will attempt to return the value contained at the index as a
- * java.io.Reader object.
- *
- * @param columnIndex
- * The column position in the current row whose value is to be read.
- * @return The value of the column as a java.io.Reader object.
- */
public java.io.Reader getCharacterStream(int columnIndex)
throws SQLException {
Object value = getObject(columnIndex);
return DataTypeTransformer.getCharacterStream(value);
}
- /**
- * This method will attempt to return the value at the designated column
- * determined by the columName as a java.io.Reader object.
- *
- * @param columnName
- * The column name in the current row whose value is to be updated.
- * @return The value of the column as a java.io.Reader object.
- */
public java.io.Reader getCharacterStream(String columnName)
throws SQLException {
return getCharacterStream(findColumn(columnName));
@@ -640,54 +603,19 @@
return getDate(findColumn(columnName), cal);
}
- /**
- * This method will return the value in the current row as a Date object.
- * This will assume the default timeZone.
- *
- * @param The
- * index of the column whose value needs to be fetched.
- * @return The value of the column as a Date object.
- * @throws SQLException
- * if a results access error occurs or transform fails.
- */
public Date getDate(int columnIndex) throws SQLException {
return getDate(columnIndex, null);
}
- /**
- * Get the column value as a Date object
- *
- * @param name
- * of the column in the resultset whose value is to be fetched.
- * @return value of the column as an int.
- * @throw a SQLException if a resultSet access error occurs.
- */
public Date getDate(String columnName) throws SQLException {
// find the columnIndex for the given column name.
return getDate(findColumn(columnName));
}
- /**
- * This method will return the value in the current row as a double value.
- *
- * @param The
- * index of the column whose value needs to be fetched.
- * @return The value of the column as a double value.
- * @throws SQLException
- * if a results access error occurs or transform fails.
- */
public double getDouble(int columnIndex) throws SQLException {
return DataTypeTransformer.getDouble(getObject(columnIndex));
}
- /**
- * Get a double value based on the column name.
- *
- * @param name
- * of the column in the resultset whose value is to be fetched.
- * @return value of the column as a double.
- * @throw a SQLException if a resultSet access error occurs.
- */
public double getDouble(String columnName) throws SQLException {
// find the columnIndex for the given column name.
return getDouble(findColumn(columnName));
@@ -1233,11 +1161,11 @@
}
public InputStream getAsciiStream(int columnIndex) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getAsciiStream(getObject(columnIndex));
}
public InputStream getAsciiStream(String columnLabel) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return getAsciiStream(findColumn(columnLabel));
}
public Clob getClob(int columnIndex) throws SQLException {
@@ -1251,34 +1179,33 @@
public Clob getClob(String columnLabel) throws SQLException {
return getClob(findColumn(columnLabel));
}
-
public int getHoldability() throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
public Reader getNCharacterStream(int columnIndex) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return getCharacterStream(columnIndex);
}
public Reader getNCharacterStream(String columnLabel) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return getCharacterStream(columnLabel);
}
public NClob getNClob(int columnIndex) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return DataTypeTransformer.getNClob(getObject(columnIndex));
}
public NClob getNClob(String columnLabel) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return getNClob(findColumn(columnLabel));
}
public String getNString(int columnIndex) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return getString(columnIndex);
}
public String getNString(String columnLabel) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return getString(columnLabel);
}
public Object getObject(int columnIndex, Map<String, Class<?>> map)
@@ -1308,7 +1235,7 @@
}
public SQLXML getSQLXML(String columnLabel) throws SQLException {
- throw SqlUtil.createFeatureNotSupportedException();
+ return getSQLXML(findColumn(columnLabel));
}
public InputStream getUnicodeStream(int columnIndex) throws SQLException {
Modified: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -39,6 +39,7 @@
import java.util.Map;
import java.util.Properties;
import java.util.TimeZone;
+import java.util.TreeMap;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -160,7 +161,8 @@
private int maxFieldSize = NO_LIMIT;
//Map<out/inout/return param index --> index in results>
- protected Map outParamIndexMap = new HashMap();
+ protected Map<Integer, Integer> outParamIndexMap = new HashMap<Integer, Integer>();
+ protected Map<String, Integer> outParamByName = new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER);
private static Pattern TRANSACTION_STATEMENT = Pattern.compile("\\s*(commit|rollback|(start\\s+transaction))\\s*;?", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
private static Pattern SET_STATEMENT = Pattern.compile("\\s*set\\s+((?:session authorization)|(?:\\w+))\\s+(?:([a-zA-Z](?:\\w|_)*)|((?:'[^']*')+));?", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
@@ -239,6 +241,7 @@
this.batchedUpdates = null;
this.updateCounts = null;
this.outParamIndexMap.clear();
+ this.outParamByName.clear();
this.commandStatus = State.RUNNING;
}
@@ -375,7 +378,9 @@
if(parameter.getType() == ParameterInfo.RETURN_VALUE){
count++;
index++;
- outParamIndexMap.put(new Integer(index), new Integer(resultSetSize + count));
+ int resultIndex = resultSetSize + count;
+ outParamIndexMap.put(index, resultIndex);
+ outParamByName.put(resultsMsg.getColumnNames()[resultIndex - 1].toUpperCase(), resultIndex);
break;
}
}
@@ -387,7 +392,9 @@
index++;
if(parameter.getType() == ParameterInfo.OUT || parameter.getType() == ParameterInfo.INOUT){
count++;
- outParamIndexMap.put(new Integer(index), new Integer(resultSetSize + count));
+ int resultIndex = resultSetSize + count;
+ outParamIndexMap.put(index, resultIndex);
+ outParamByName.put(resultsMsg.getColumnNames()[resultIndex - 1].toUpperCase(), resultIndex);
}
}
}
Modified: trunk/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -34,6 +34,9 @@
/**
* Execute the given statement using a non-blocking callback.
* This method is only valid for use with embedded connections.
+ *
+ * Note that a single Statement may only have 1 asynch query executing at a time.
+ *
* @param callback
* @throws SQLException
*/
Modified: trunk/client/src/main/java/org/teiid/jdbc/TeiidStatement.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/TeiidStatement.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/client/src/main/java/org/teiid/jdbc/TeiidStatement.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -104,6 +104,9 @@
/**
* Execute the given statement using a non-blocking callback.
* This method is only valid for use with embedded connections.
+ *
+ * Note that a single Statement may only have 1 asynch query executing at a time.
+ *
* @param callback
* @throws SQLException
*/
Modified: trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties
===================================================================
--- trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/client/src/main/resources/org/teiid/jdbc/i18n.properties 2011-11-18 18:01:18 UTC (rev 3672)
@@ -25,7 +25,7 @@
DataTypeTransformer.Err_converting=Unable to transform the column value {0} to a {1}.
JDBC.Method_not_supported=This method is not supported.
MMPreparedStatement.Err_transform_obj=Unable to transform the object into the target JDBC type.
-MMCallableStatement.Param_not_found=Parameter is not found at index {0}.
+MMCallableStatement.Param_not_found=Parameter {0} was not found.
MMConnection.Err_closing_stmts=Error trying to close statements on this connection.
MMConnection.Cant_use_closed_connection=Cannot perform operations on a closed connection.
MMConnection.Scrollable_type_not_supported=Scrollable type {0} is not supported.
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestCallableStatement.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestCallableStatement.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestCallableStatement.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -23,6 +23,8 @@
package org.teiid.jdbc;
+import static org.junit.Assert.*;
+
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Arrays;
@@ -30,8 +32,7 @@
import java.util.List;
import java.util.Map;
-import junit.framework.TestCase;
-
+import org.junit.Test;
import org.mockito.Mockito;
import org.teiid.client.RequestMessage;
import org.teiid.client.ResultsMessage;
@@ -40,10 +41,10 @@
import org.teiid.core.types.JDBCSQLTypeInfo;
import org.teiid.net.ServerConnection;
-
-public class TestCallableStatement extends TestCase {
+@SuppressWarnings("nls")
+public class TestCallableStatement {
- public void testWasNull() throws Exception {
+ @Test public void testWasNull() throws Exception {
CallableStatementImpl mmcs = getCallableStatement();
Map<Integer, Integer> params = new HashMap<Integer, Integer>();
@@ -60,13 +61,13 @@
assertFalse(mmcs.wasNull());
}
- public void testGetOutputParameter() throws Exception {
+ @Test public void testGetOutputParameter() throws Exception {
CallableStatementImpl mmcs = getCallableStatement();
RequestMessage request = new RequestMessage();
request.setExecutionId(1);
ResultsMessage resultsMsg = new ResultsMessage();
- List[] results = new List[] {Arrays.asList(null, null, null), Arrays.asList(null, 1, 2)};
+ List<?>[] results = new List[] {Arrays.asList(null, null, null), Arrays.asList(null, 1, 2)};
resultsMsg.setResults(results);
resultsMsg.setColumnNames(new String[] { "IntNum", "Out1", "Out2" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
resultsMsg.setDataTypes(new String[] { JDBCSQLTypeInfo.INTEGER, JDBCSQLTypeInfo.INTEGER, JDBCSQLTypeInfo.INTEGER });
@@ -77,9 +78,11 @@
mmcs.createResultSet(resultsMsg);
assertEquals(1, mmcs.getInt(1));
assertEquals(2, mmcs.getInt(2));
+ assertEquals(1, mmcs.getInt("Out1"));
+ assertEquals(2, mmcs.getInt("Out2"));
}
- public void testUnknownIndex() throws Exception {
+ @Test public void testUnknownIndex() throws Exception {
CallableStatementImpl mmcs = getCallableStatement();
mmcs.outParamIndexMap = new HashMap<Integer, Integer>();
@@ -87,8 +90,8 @@
try {
mmcs.getBoolean(0);
fail("expected exception"); //$NON-NLS-1$
- } catch (IllegalArgumentException e) {
- assertEquals("Parameter is not found at index 0.", e.getMessage());
+ } catch (SQLException e) {
+ assertEquals("Parameter 0 was not found.", e.getMessage());
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/util/SqlUtil.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/util/SqlUtil.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/common-core/src/main/java/org/teiid/core/util/SqlUtil.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -85,6 +85,8 @@
}
public static SQLException createFeatureNotSupportedException() {
- return new SQLFeatureNotSupportedException();
+ StackTraceElement ste = new Exception().getStackTrace()[1];
+ String methodName = ste.getMethodName();
+ return new SQLFeatureNotSupportedException(methodName + " is not supported");
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -22,6 +22,7 @@
package org.teiid.dqp.internal.process;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -43,6 +44,7 @@
import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
import org.teiid.dqp.internal.process.multisource.MultiSourceMetadataWrapper;
import org.teiid.dqp.message.RequestID;
+import org.teiid.query.function.FunctionLibrary;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.SupportConstants;
import org.teiid.query.metadata.TempMetadataAdapter;
@@ -52,10 +54,13 @@
import org.teiid.query.resolver.QueryResolver;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Query;
+import org.teiid.query.sql.lang.SPParameter;
+import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.symbol.AggregateSymbol;
import org.teiid.query.sql.symbol.AliasSymbol;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
+import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.SingleElementSymbol;
@@ -165,10 +170,31 @@
columnMetadata = createProjectedSymbolMetadata(originalCommand);
}
+ Map<Reference, String> paramMap = Collections.emptyMap();
+ if (originalCommand instanceof StoredProcedure) {
+ StoredProcedure sp = (StoredProcedure)originalCommand;
+ paramMap = new HashMap<Reference, String>();
+ List<SPParameter> params = sp.getParameters();
+ for (SPParameter spParameter : params) {
+ if (spParameter.getParameterType() != SPParameter.INOUT
+ && spParameter.getParameterType() != SPParameter.IN
+ && spParameter.getParameterType() != SPParameter.RETURN_VALUE) {
+ continue;
+ }
+ Expression ex = spParameter.getExpression();
+ if (ex instanceof Function && FunctionLibrary.isConvert((Function)ex)) {
+ ex = ((Function)ex).getArg(0);
+ }
+ if (ex instanceof Reference) {
+ paramMap.put((Reference)ex, SingleElementSymbol.getShortName(spParameter.getName()));
+ }
+ }
+ }
List<Reference> params = ReferenceCollectorVisitor.getReferences(originalCommand);
Map[] paramMetadata = new Map[params.size()];
for (int i = 0; i < params.size(); i++) {
- paramMetadata[i] = getDefaultColumn(null, null, params.get(i).getType());
+ Reference param = params.get(i);
+ paramMetadata[i] = getDefaultColumn(null, paramMap.get(param), param.getType());
}
return new MetadataResult(columnMetadata, paramMetadata);
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -270,8 +270,7 @@
Reference param = params.get(i);
Object value = values.get(i);
- //TODO: why is the list check in here
- if(value != null && !(value instanceof List)) {
+ if(value != null) {
try {
String targetTypeName = DataTypeManager.getDataTypeName(param.getType());
Expression expr = ResolverUtil.convertExpression(new Constant(value), targetTypeName, metadata);
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -483,7 +483,7 @@
if (rsCache != null) {
if (!canUseCached) {
- LogManager.logDetail(LogConstants.CTX_DQP, requestID, "No cache directive"); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_DQP, requestID, "Non-cachable command."); //$NON-NLS-1$
} else {
ParseInfo pi = Request.createParseInfo(requestMsg);
cacheId = new CacheID(this.dqpWorkContext, pi, requestMsg.getCommandString());
Modified: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2011-11-18 17:54:46 UTC (rev 3671)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2011-11-18 18:01:18 UTC (rev 3672)
@@ -25,9 +25,12 @@
import static org.junit.Assert.*;
import java.io.IOException;
+import java.sql.CallableStatement;
+import java.sql.ParameterMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
+import java.sql.Types;
import org.junit.Before;
import org.junit.Test;
@@ -211,4 +214,24 @@
});
assertEquals(4, result.get().intValue());
}
+
+ @Test public void testCallableParametersByName() throws Exception {
+ CallableStatement cs = this.internalConnection.prepareCall("{? = call logMsg(?, ?, ?)}");
+ ParameterMetaData pmd = cs.getParameterMetaData();
+ assertEquals(3, pmd.getParameterCount());
+ cs.registerOutParameter("logged", Types.BOOLEAN);
+ //different case
+ cs.setString("LEVEL", "DEBUG");
+ try {
+ //invalid param
+ cs.setString("n", "");
+ fail();
+ } catch (SQLException e) {
+ }
+ cs.setString("context", "org.teiid.foo");
+ cs.setString("msg", "hello world");
+ cs.execute();
+ assertEquals(cs.getBoolean(1), cs.getBoolean("logged"));
+ }
+
}
13 years, 1 month
teiid SVN: r3671 - in trunk: cache-jbosscache/src/main/java/org/teiid/replication/jboss and 4 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-11-18 12:54:46 -0500 (Fri, 18 Nov 2011)
New Revision: 3671
Modified:
trunk/api/src/main/java/org/teiid/Replicated.java
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
trunk/engine/src/main/java/org/teiid/common/buffer/BufferManager.java
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
trunk/engine/src/main/java/org/teiid/query/tempdata/GlobalTableStore.java
trunk/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java
Log:
TEIID-1720 switching resultset caching to use cluster pull, instead of push semantics.
Modified: trunk/api/src/main/java/org/teiid/Replicated.java
===================================================================
--- trunk/api/src/main/java/org/teiid/Replicated.java 2011-11-18 02:09:05 UTC (rev 3670)
+++ trunk/api/src/main/java/org/teiid/Replicated.java 2011-11-18 17:54:46 UTC (rev 3671)
@@ -37,6 +37,13 @@
@Inherited
@Documented
public @interface Replicated {
+
+ enum ReplicationMode {
+ PUSH,
+ PULL,
+ NONE
+ }
+
/**
* @return true if members should be called asynchronously. asynch methods should be void.
*/
@@ -50,9 +57,12 @@
*/
boolean remoteOnly() default false;
/**
- * @return true if the remote members should have a partial state replication called using the first argument as the state after
- * the local method has been invoked. should not be used with remoteOnly.
+ * Should not be used with remoteOnly.
+ *
+ * @return PUSH if the remote members should have a partial state replication called using the first argument as the state after
+ * the local method has been invoked, or PULL if the local member should initial a partial state pull using the first argument
+ * as the state after the local method returns null
*/
- boolean replicateState() default false;
+ ReplicationMode replicateState() default ReplicationMode.NONE;
}
\ No newline at end of file
Modified: trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java 2011-11-18 02:09:05 UTC (rev 3670)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java 2011-11-18 17:54:46 UTC (rev 3671)
@@ -29,21 +29,34 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import org.jboss.as.clustering.jgroups.ChannelFactory;
-import org.jgroups.*;
+import org.jgroups.Address;
+import org.jgroups.Channel;
+import org.jgroups.ExtendedReceiverAdapter;
+import org.jgroups.Message;
+import org.jgroups.View;
import org.jgroups.blocks.GroupRequest;
import org.jgroups.blocks.MethodCall;
import org.jgroups.blocks.MethodLookup;
+import org.jgroups.blocks.RequestOptions;
import org.jgroups.blocks.RpcDispatcher;
import org.jgroups.util.Promise;
import org.jgroups.util.RspList;
import org.jgroups.util.Util;
import org.teiid.Replicated;
+import org.teiid.Replicated.ReplicationMode;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.query.ObjectReplicator;
@@ -89,6 +102,11 @@
private final HashMap<Method, Short> methodMap;
protected Vector<Address> remoteMembers = new Vector<Address>();
protected final transient Promise<Boolean> state_promise=new Promise<Boolean>();
+ protected transient ThreadLocal<Promise<Boolean>> threadLocalPromise = new ThreadLocal<Promise<Boolean>>() {
+ protected org.jgroups.util.Promise<Boolean> initialValue() {
+ return new Promise<Boolean>();
+ }
+ };
private ReplicatedInvocationHandler(S object,
HashMap<Method, Short> methodMap) {
@@ -119,7 +137,7 @@
}
try {
Replicated annotation = method.getAnnotation(Replicated.class);
- if (annotation.replicateState()) {
+ if (annotation.replicateState() != ReplicationMode.NONE) {
Object result = null;
try {
result = method.invoke(object, args);
@@ -132,13 +150,34 @@
}
ReplicatedObject ro = (ReplicatedObject)object;
String stateId = (String)args[0];
- LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "replicating state", stateId); //$NON-NLS-1$
- JGroupsOutputStream oStream = new JGroupsOutputStream(disp, dests, stateId, (short)(methodMap.size() - 3));
- try {
- ro.getState(stateId, oStream);
- } finally {
- oStream.close();
+ if (annotation.replicateState() == ReplicationMode.PUSH) {
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "replicating state", stateId); //$NON-NLS-1$
+ JGroupsOutputStream oStream = new JGroupsOutputStream(disp, dests, stateId, (short)(methodMap.size() - 3));
+ try {
+ ro.getState(stateId, oStream);
+ } finally {
+ oStream.close();
+ }
+ LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "sent state", stateId); //$NON-NLS-1$
+ return result;
}
+ if (result != null) {
+ return result;
+ }
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "pulling state", stateId); //$NON-NLS-1$
+ long timeout = annotation.timeout();
+ threadLocalPromise.set(new Promise<Boolean>());
+ boolean getState = this.disp.getChannel().getState(null, stateId, timeout);
+ if (getState) {
+ Boolean loaded = threadLocalPromise.get().getResult(timeout);
+ if (Boolean.TRUE.equals(loaded)) {
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "loaded", stateId); //$NON-NLS-1$
+ } else {
+ LogManager.logWarning(LogConstants.CTX_RUNTIME, object + " load error or timeout " + stateId); //$NON-NLS-1$
+ }
+ } else {
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, object + " first member or timeout exceeded " + stateId); //$NON-NLS-1$
+ }
LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "sent state", stateId); //$NON-NLS-1$
return result;
}
@@ -149,7 +188,7 @@
dests = new Vector<Address>(remoteMembers);
}
}
- RspList responses = disp.callRemoteMethods(dests, call, annotation.asynch()?GroupRequest.GET_NONE:GroupRequest.GET_ALL, annotation.timeout());
+ RspList responses = disp.callRemoteMethods(dests, call, new RequestOptions().setMode(annotation.asynch()?GroupRequest.GET_NONE:GroupRequest.GET_ALL).setTimeout(annotation.timeout()));
if (annotation.asynch()) {
return null;
}
@@ -184,7 +223,7 @@
}
remoteMembers.clear();
remoteMembers.addAll(newView.getMembers());
- remoteMembers.remove(this.disp.getChannel().getLocalAddress());
+ remoteMembers.remove(this.disp.getChannel().getAddress());
}
}
}
@@ -214,6 +253,32 @@
Util.close(ostream);
}
}
+
+ @Override
+ public void setState(String stateId, InputStream istream) {
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "loading state"); //$NON-NLS-1$
+ try {
+ ((ReplicatedObject)object).setState(stateId, istream);
+ threadLocalPromise.get().setResult(Boolean.TRUE);
+ } catch (Exception e) {
+ threadLocalPromise.get().setResult(Boolean.FALSE);
+ LogManager.logError(LogConstants.CTX_RUNTIME, e, "error loading state"); //$NON-NLS-1$
+ } finally {
+ Util.close(istream);
+ }
+ }
+
+ @Override
+ public void getState(String stateId, OutputStream ostream) {
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "getting state"); //$NON-NLS-1$
+ try {
+ ((ReplicatedObject)object).getState(stateId, ostream);
+ } catch (Exception e) {
+ LogManager.logError(LogConstants.CTX_RUNTIME, e, "error gettting state"); //$NON-NLS-1$
+ } finally {
+ Util.close(ostream);
+ }
+ }
}
private interface Streaming {
@@ -222,13 +287,10 @@
void finishState(String id);
}
-
- private String clusterName;
//TODO: this should be configurable, or use a common executor
private transient Executor executor = Executors.newCachedThreadPool();
- public JGroupsObjectReplicator(String clusterName) {
- this.clusterName = clusterName;
+ public JGroupsObjectReplicator(@SuppressWarnings("unused") String clusterName) {
}
public abstract ChannelFactory getChannelFactory();
@@ -368,14 +430,14 @@
try {
channel.connect(mux_id);
if (object instanceof ReplicatedObject) {
- ((ReplicatedObject)object).setLocalAddress(channel.getLocalAddress());
+ ((ReplicatedObject)object).setLocalAddress(channel.getAddress());
boolean getState = channel.getState(null, startTimeout);
if (getState) {
- boolean loaded = proxy.state_promise.getResult(startTimeout);
- if (loaded) {
+ Boolean loaded = proxy.state_promise.getResult(startTimeout);
+ if (Boolean.TRUE.equals(loaded)) {
LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "loaded"); //$NON-NLS-1$
} else {
- LogManager.logWarning(LogConstants.CTX_RUNTIME, object + " load timeout"); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_RUNTIME, object + " load error or timeout"); //$NON-NLS-1$
}
} else {
LogManager.logInfo(LogConstants.CTX_RUNTIME, object + " first member or timeout exceeded"); //$NON-NLS-1$
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/BufferManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/BufferManager.java 2011-11-18 02:09:05 UTC (rev 3670)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/BufferManager.java 2011-11-18 17:54:46 UTC (rev 3671)
@@ -25,6 +25,7 @@
import java.util.List;
import org.teiid.Replicated;
+import org.teiid.Replicated.ReplicationMode;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.sql.symbol.Expression;
@@ -126,6 +127,7 @@
void addTupleBuffer(TupleBuffer tb);
+ @Replicated(replicateState=ReplicationMode.PULL)
TupleBuffer getTupleBuffer(String id);
/**
@@ -141,6 +143,5 @@
*/
int reserveAdditionalBuffers(int additional);
- @Replicated(replicateState=true)
void distributeTupleBuffer(String uuid, TupleBuffer tb);
}
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 2011-11-18 02:09:05 UTC (rev 3670)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2011-11-18 17:54:46 UTC (rev 3671)
@@ -975,21 +975,6 @@
@Override
public void getState(OutputStream ostream) {
- try {
- ObjectOutputStream out = new ObjectOutputStream(ostream);
- for(String id:this.tupleBufferMap.keySet()) {
- TupleReference tr = this.tupleBufferMap.get(id);
- TupleBuffer tb = tr.get();
- if (tb != null) {
- out.writeObject(tb.getId());
- getTupleBufferState(out, tb);
- }
- }
- } catch (TeiidComponentException e) {
- throw new TeiidRuntimeException(e);
- } catch (IOException e) {
- throw new TeiidRuntimeException(e);
- }
}
@Override
@@ -1019,27 +1004,6 @@
@Override
public void setState(InputStream istream) {
- try {
- ObjectInputStream in = new ObjectInputStream(istream);
- while (true) {
- String state_id = null;
- try {
- state_id = (String)in.readObject();
- } catch (IOException e) {
- break;
- }
- if (state_id != null) {
- setTupleBufferState(state_id, in);
- }
- }
- } catch (IOException e) {
- throw new TeiidRuntimeException(e);
- } catch(ClassNotFoundException e) {
- throw new TeiidRuntimeException(e);
- } catch(TeiidComponentException e) {
- throw new TeiidRuntimeException(e);
- }
-
}
@Override
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/GlobalTableStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/GlobalTableStore.java 2011-11-18 02:09:05 UTC (rev 3670)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/GlobalTableStore.java 2011-11-18 17:54:46 UTC (rev 3671)
@@ -26,6 +26,7 @@
import java.util.List;
import org.teiid.Replicated;
+import org.teiid.Replicated.ReplicationMode;
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.api.exception.query.QueryValidatorException;
@@ -62,7 +63,7 @@
boolean needsLoading(String matTableName, Serializable loadingAddress,
boolean firstPass, boolean refresh, boolean invalidate);
- @Replicated(replicateState=true)
+ @Replicated(replicateState=ReplicationMode.PUSH)
void loaded(String matTableName, TempTable table);
}
Modified: trunk/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java 2011-11-18 02:09:05 UTC (rev 3670)
+++ trunk/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java 2011-11-18 17:54:46 UTC (rev 3671)
@@ -22,9 +22,7 @@
package org.teiid.dqp.service.buffer;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -34,9 +32,9 @@
import org.junit.Test;
import org.teiid.common.buffer.BufferManager;
-import org.teiid.common.buffer.BufferManager.TupleSourceType;
import org.teiid.common.buffer.TupleBatch;
import org.teiid.common.buffer.TupleBuffer;
+import org.teiid.common.buffer.BufferManager.TupleSourceType;
import org.teiid.common.buffer.impl.BufferFrontedFileStoreCache;
import org.teiid.common.buffer.impl.BufferManagerImpl;
import org.teiid.common.buffer.impl.FileStorageManager;
@@ -125,23 +123,21 @@
es2.setType(DataTypeManager.getDataTypeClass(DefaultDataTypes.INTEGER));
schema.add(es2);
- for (int i = 0; i < 5; i++) {
- TupleBuffer buffer = mgr.createTupleBuffer(schema, "cached", TupleSourceType.FINAL); //$NON-NLS-1$
- buffer.setBatchSize(50);
- buffer.setId("state_id"+i);
-
- for (int batch=0; batch<3; batch++) {
- for (int row = 0; row < 50; row++) {
- int val = (i*150)+(batch*50)+row;
- buffer.addTuple(Arrays.asList(new Object[] {"String"+val, new Integer(val)}));
- }
+ TupleBuffer buffer = mgr.createTupleBuffer(schema, "cached", TupleSourceType.FINAL); //$NON-NLS-1$
+ buffer.setBatchSize(50);
+ buffer.setId("state_id");
+
+ for (int batch=0; batch<3; batch++) {
+ for (int row = 0; row < 50; row++) {
+ int val = (batch*50)+row;
+ buffer.addTuple(Arrays.asList(new Object[] {"String"+val, new Integer(val)}));
}
- buffer.close();
- mgr.distributeTupleBuffer(buffer.getId(), buffer);
}
+ buffer.close();
+ mgr.distributeTupleBuffer(buffer.getId(), buffer);
FileOutputStream fo = new FileOutputStream(UnitTestUtil.getTestScratchPath()+"/teiid/statetest");
- ((BufferManagerImpl)mgr).getState(fo);
+ ((BufferManagerImpl)mgr).getState(buffer.getId(), fo);
fo.close();
svc.stop();
@@ -153,20 +149,18 @@
BufferManagerImpl mgr2 = svc2.getBufferManager();
FileInputStream fis = new FileInputStream(UnitTestUtil.getTestScratchPath()+"/teiid/statetest");
- mgr2.setState(fis);
+ mgr2.setState(buffer.getId(), fis);
fis.close();
- for (int i = 0; i < 5; i++) {
- String id = "state_id"+i;
- TupleBuffer buffer = mgr2.getTupleBuffer(id);
- for (int batch=0; batch<3; batch++) {
- TupleBatch tb = buffer.getBatch((batch*50)+1);
- List[] rows = tb.getAllTuples();
- for (int row = 0; row < 50; row++) {
- int val = (i*150)+(batch*50)+row;
- assertEquals("String"+val, rows[row].get(0));
- assertEquals(val, rows[row].get(1));
- }
+ String id = "state_id";
+ buffer = mgr2.getTupleBuffer(id);
+ for (int batch=0; batch<3; batch++) {
+ TupleBatch tb = buffer.getBatch((batch*50)+1);
+ List[] rows = tb.getAllTuples();
+ for (int row = 0; row < 50; row++) {
+ int val = (batch*50)+row;
+ assertEquals("String"+val, rows[row].get(0));
+ assertEquals(val, rows[row].get(1));
}
}
svc2.stop();
13 years, 1 month
teiid SVN: r3670 - /.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-11-17 21:09:05 -0500 (Thu, 17 Nov 2011)
New Revision: 3670
Added:
trunk/
Log:
promoting as7 to trunk
13 years, 1 month
teiid SVN: r3669 - /.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-11-17 21:08:09 -0500 (Thu, 17 Nov 2011)
New Revision: 3669
Added:
trunk-old/
Removed:
trunk/
Log:
renaming trunk
13 years, 1 month
teiid SVN: r3668 - branches/as7/connectors/translator-hive/src/main/resources/META-INF.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-11-17 17:49:29 -0500 (Thu, 17 Nov 2011)
New Revision: 3668
Removed:
branches/as7/connectors/translator-hive/src/main/resources/META-INF/jboss-beans.xml
Log:
TEIID-1720: Forward merging trunk; merge -r 3597:3666 https://svn.jboss.org/repos/teiid/trunk .
Deleted: branches/as7/connectors/translator-hive/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- branches/as7/connectors/translator-hive/src/main/resources/META-INF/jboss-beans.xml 2011-11-17 22:30:19 UTC (rev 3667)
+++ branches/as7/connectors/translator-hive/src/main/resources/META-INF/jboss-beans.xml 2011-11-17 22:49:29 UTC (rev 3668)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean name="translator-hive-template" class="org.teiid.templates.TranslatorDeploymentTemplate">
- <property name="info"><inject bean="translator-hive"/></property>
- <property name="managedObjectFactory"><inject bean="ManagedObjectFactory"/></property>
- </bean>
-
- <bean name="translator-hive" class="org.teiid.templates.TranslatorTemplateInfo">
- <constructor factoryMethod="createTemplateInfo">
- <factory bean="TranslatorDeploymentTemplateInfoFactory"/>
- <parameter class="java.lang.Class">org.teiid.templates.TranslatorTemplateInfo</parameter>
- <parameter class="java.lang.Class">org.teiid.translator.hive.HiveExecutionFactory</parameter>
- <parameter class="java.lang.String">translator-hive</parameter>
- <parameter class="java.lang.String">Hive</parameter>
- </constructor>
- </bean>
-
-</deployment>
13 years, 1 month
teiid SVN: r3667 - in branches/as7: admin and 293 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-11-17 17:30:19 -0500 (Thu, 17 Nov 2011)
New Revision: 3667
Added:
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/hive/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/hive/main/
branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/hive/main/module.xml
branches/as7/build/kits/jboss-container/teiid-examples/jca/hive-ds.xml
branches/as7/client/src/main/java/org/teiid/jdbc/NonBlockingRowProcessor.java
branches/as7/client/src/main/java/org/teiid/jdbc/StatementCallback.java
branches/as7/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java
branches/as7/client/src/main/java/org/teiid/jdbc/TeiidSQLWarning.java
branches/as7/client/src/main/java/org/teiid/net/socket/AuthenticationType.java
branches/as7/connectors/translator-hive/
branches/as7/connectors/translator-hive/pom.xml
branches/as7/connectors/translator-hive/src/
branches/as7/connectors/translator-hive/src/main/
branches/as7/connectors/translator-hive/src/main/java/
branches/as7/connectors/translator-hive/src/main/java/org/
branches/as7/connectors/translator-hive/src/main/java/org/teiid/
branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/
branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/
branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveExecutionFactory.java
branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveMetadataProcessor.java
branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveSQLConversionVisitor.java
branches/as7/connectors/translator-hive/src/main/resources/
branches/as7/connectors/translator-hive/src/main/resources/META-INF/
branches/as7/connectors/translator-hive/src/main/resources/META-INF/services/
branches/as7/connectors/translator-hive/src/main/resources/META-INF/services/org.teiid.translator.ExecutionFactory
branches/as7/connectors/translator-hive/src/test/
branches/as7/connectors/translator-hive/src/test/java/
branches/as7/connectors/translator-hive/src/test/java/org/
branches/as7/connectors/translator-hive/src/test/java/org/teiid/
branches/as7/connectors/translator-hive/src/test/java/org/teiid/translator/
branches/as7/connectors/translator-hive/src/test/java/org/teiid/translator/hive/
branches/as7/connectors/translator-hive/src/test/java/org/teiid/translator/hive/TestHiveExecutionFactory.java
branches/as7/engine/src/main/java/org/teiid/query/sql/lang/SourceHint.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestSourceHints.java
Removed:
branches/as7/connectors/sandbox/translator-yahoo/src/main/resources/META-INF/MANIFEST.MF
branches/as7/connectors/translator-file/src/main/resources/META-INF/MANIFEST.MF
branches/as7/connectors/translator-hive/pom.xml
branches/as7/connectors/translator-hive/src/
branches/as7/connectors/translator-hive/src/main/
branches/as7/connectors/translator-hive/src/main/java/
branches/as7/connectors/translator-hive/src/main/java/org/
branches/as7/connectors/translator-hive/src/main/java/org/teiid/
branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/
branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/
branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveExecutionFactory.java
branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveMetadataProcessor.java
branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveSQLConversionVisitor.java
branches/as7/connectors/translator-hive/src/main/resources/
branches/as7/connectors/translator-hive/src/main/resources/META-INF/
branches/as7/connectors/translator-hive/src/test/
branches/as7/connectors/translator-hive/src/test/java/
branches/as7/connectors/translator-hive/src/test/java/org/
branches/as7/connectors/translator-hive/src/test/java/org/teiid/
branches/as7/connectors/translator-hive/src/test/java/org/teiid/translator/
branches/as7/connectors/translator-hive/src/test/java/org/teiid/translator/hive/
branches/as7/connectors/translator-hive/src/test/java/org/teiid/translator/hive/TestHiveExecutionFactory.java
branches/as7/connectors/translator-jdbc/src/main/resources/META-INF/MANIFEST.MF
branches/as7/connectors/translator-ldap/src/main/resources/META-INF/MANIFEST.MF
branches/as7/connectors/translator-loopback/src/main/resources/META-INF/MANIFEST.MF
branches/as7/connectors/translator-olap/src/main/resources/META-INF/MANIFEST.MF
branches/as7/connectors/translator-salesforce/src/main/resources/META-INF/MANIFEST.MF
branches/as7/connectors/translator-ws/src/main/resources/META-INF/MANIFEST.MF
branches/as7/connectors/translator-ws/src/main/resources/META-INF/jboss-beans.xml
Modified:
branches/as7/
branches/as7/admin/pom.xml
branches/as7/adminshell/pom.xml
branches/as7/adminshell/src/main/java/groovy/
branches/as7/adminshell/src/main/java/groovy/sql/
branches/as7/adminshell/src/main/java/groovy/sql/TeiidSql.java
branches/as7/adminshell/src/main/java/org/teiid/adminshell/
branches/as7/adminshell/src/main/java/org/teiid/adminshell/AdminHelpCommand.java
branches/as7/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
branches/as7/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminConsole.java
branches/as7/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminShell.java
branches/as7/adminshell/src/main/java/org/teiid/adminshell/GroovySqlExtensions.java
branches/as7/adminshell/src/main/java/org/teiid/adminshell/Help.java
branches/as7/adminshell/src/main/java/org/teiid/adminshell/MigrationUtil.java
branches/as7/adminshell/src/main/java/org/teiid/adminshell/SqlHelpCommand.java
branches/as7/adminshell/src/main/resources/org/
branches/as7/adminshell/src/main/resources/org/codehaus/
branches/as7/adminshell/src/main/resources/org/codehaus/groovy/
branches/as7/adminshell/src/main/resources/org/codehaus/groovy/tools/
branches/as7/adminshell/src/main/resources/org/codehaus/groovy/tools/shell/
branches/as7/adminshell/src/main/resources/org/codehaus/groovy/tools/shell/commands.xml
branches/as7/adminshell/src/main/resources/org/teiid/
branches/as7/adminshell/src/main/resources/org/teiid/adminshell/
branches/as7/adminshell/src/main/resources/org/teiid/adminshell/AdminHelpCommand.properties
branches/as7/adminshell/src/main/resources/org/teiid/adminshell/SqlHelpCommand.properties
branches/as7/adminshell/src/test/java/org/
branches/as7/adminshell/src/test/java/org/teiid/
branches/as7/adminshell/src/test/java/org/teiid/adminshell/
branches/as7/adminshell/src/test/java/org/teiid/adminshell/TestAdminShell.java
branches/as7/adminshell/src/test/resources/foo/
branches/as7/adminshell/src/test/resources/foo/bar.txt
branches/as7/api/pom.xml
branches/as7/api/src/main/java/org/teiid/events/
branches/as7/api/src/main/java/org/teiid/events/EventDistributor.java
branches/as7/api/src/main/java/org/teiid/events/EventDistributorFactory.java
branches/as7/api/src/main/java/org/teiid/language/visitor/SQLStringVisitor.java
branches/as7/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java
branches/as7/api/src/main/java/org/teiid/translator/DataNotAvailableException.java
branches/as7/api/src/main/java/org/teiid/translator/ExecutionContext.java
branches/as7/build/assembly/jboss-as7/dist.xml
branches/as7/build/assembly/jboss-container/dist.xml
branches/as7/build/kits/
branches/as7/build/kits/adminshell/
branches/as7/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
branches/as7/build/kits/jboss-container/
branches/as7/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
branches/as7/build/kits/jboss-container/teiid-releasenotes.html
branches/as7/build/pom.xml
branches/as7/cache-jbosscache/pom.xml
branches/as7/cache-jbosscache/src/main/java/org/
branches/as7/cache-jbosscache/src/main/java/org/teiid/
branches/as7/cache-jbosscache/src/main/java/org/teiid/cache/
branches/as7/cache-jbosscache/src/main/java/org/teiid/cache/jboss/
branches/as7/cache-jbosscache/src/main/java/org/teiid/events/
branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/
branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/jboss/
branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java
branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java
branches/as7/cache-jbosscache/src/test/java/
branches/as7/client-jdk15/pom.xml
branches/as7/client/pom.xml
branches/as7/client/src/main/java/org/teiid/client/util/
branches/as7/client/src/main/java/org/teiid/client/util/ExceptionHolder.java
branches/as7/client/src/main/java/org/teiid/client/util/ExceptionUtil.java
branches/as7/client/src/main/java/org/teiid/client/util/ResultsFuture.java
branches/as7/client/src/main/java/org/teiid/client/util/ResultsReceiver.java
branches/as7/client/src/main/java/org/teiid/jdbc/
branches/as7/client/src/main/java/org/teiid/jdbc/BaseDataSource.java
branches/as7/client/src/main/java/org/teiid/jdbc/BatchResults.java
branches/as7/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
branches/as7/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
branches/as7/client/src/main/java/org/teiid/jdbc/ConnectionListener.java
branches/as7/client/src/main/java/org/teiid/jdbc/ConnectionProfile.java
branches/as7/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java
branches/as7/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
branches/as7/client/src/main/java/org/teiid/jdbc/DeferredMetadataProvider.java
branches/as7/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
branches/as7/client/src/main/java/org/teiid/jdbc/EnhancedTimer.java
branches/as7/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java
branches/as7/client/src/main/java/org/teiid/jdbc/FilteredResultsMetadata.java
branches/as7/client/src/main/java/org/teiid/jdbc/JDBCColumnNames.java
branches/as7/client/src/main/java/org/teiid/jdbc/JDBCColumnPositions.java
branches/as7/client/src/main/java/org/teiid/jdbc/JDBCPlugin.java
branches/as7/client/src/main/java/org/teiid/jdbc/JDBCURL.java
branches/as7/client/src/main/java/org/teiid/jdbc/MetadataProvider.java
branches/as7/client/src/main/java/org/teiid/jdbc/ParameterMetaDataImpl.java
branches/as7/client/src/main/java/org/teiid/jdbc/PartialResultsWarning.java
branches/as7/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
branches/as7/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
branches/as7/client/src/main/java/org/teiid/jdbc/ResultSetMetaDataImpl.java
branches/as7/client/src/main/java/org/teiid/jdbc/SQLStates.java
branches/as7/client/src/main/java/org/teiid/jdbc/SocketProfile.java
branches/as7/client/src/main/java/org/teiid/jdbc/StatementImpl.java
branches/as7/client/src/main/java/org/teiid/jdbc/TeiidConnection.java
branches/as7/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java
branches/as7/client/src/main/java/org/teiid/jdbc/TeiidDriver.java
branches/as7/client/src/main/java/org/teiid/jdbc/TeiidSQLException.java
branches/as7/client/src/main/java/org/teiid/jdbc/TeiidStatement.java
branches/as7/client/src/main/java/org/teiid/jdbc/WarningUtil.java
branches/as7/client/src/main/java/org/teiid/jdbc/WrapperImpl.java
branches/as7/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java
branches/as7/client/src/main/java/org/teiid/jdbc/XAResourceImpl.java
branches/as7/client/src/main/java/org/teiid/net/TeiidURL.java
branches/as7/client/src/main/java/org/teiid/net/socket/
branches/as7/client/src/main/java/org/teiid/net/socket/Handshake.java
branches/as7/client/src/main/java/org/teiid/net/socket/Message.java
branches/as7/client/src/main/java/org/teiid/net/socket/ObjectChannel.java
branches/as7/client/src/main/java/org/teiid/net/socket/ObjectChannelFactory.java
branches/as7/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java
branches/as7/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java
branches/as7/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java
branches/as7/client/src/main/java/org/teiid/net/socket/SingleInstanceCommunicationException.java
branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java
branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java
branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
branches/as7/client/src/main/java/org/teiid/net/socket/SocketUtil.java
branches/as7/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java
branches/as7/client/src/main/resources/org/
branches/as7/client/src/main/resources/org/teiid/
branches/as7/client/src/main/resources/org/teiid/jdbc/
branches/as7/client/src/main/resources/org/teiid/net/
branches/as7/client/src/test/java/org/teiid/client/plan/
branches/as7/client/src/test/java/org/teiid/client/plan/TestPlanNode.java
branches/as7/client/src/test/java/org/teiid/client/util/
branches/as7/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java
branches/as7/client/src/test/java/org/teiid/client/util/TestResultsFuture.java
branches/as7/client/src/test/java/org/teiid/jdbc/
branches/as7/client/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestBatchResults.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestCallableStatement.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestConnection.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestDataTypeTransformer.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestEnhancedTimer.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestJDBCURL.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestPreparedStatement.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestResultSet.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestSQLException.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestStatement.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java
branches/as7/client/src/test/java/org/teiid/jdbc/TestXAConnection.java
branches/as7/client/src/test/java/org/teiid/jdbc/util/
branches/as7/client/src/test/java/org/teiid/net/
branches/as7/client/src/test/java/org/teiid/net/TestTeiidURL.java
branches/as7/client/src/test/java/org/teiid/net/socket/
branches/as7/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java
branches/as7/common-core/pom.xml
branches/as7/common-core/src/main/java/org/
branches/as7/common-core/src/main/java/org/teiid/
branches/as7/common-core/src/main/java/org/teiid/core/
branches/as7/common-core/src/main/java/org/teiid/core/BundleUtil.java
branches/as7/common-core/src/main/java/org/teiid/core/ComponentNotFoundException.java
branches/as7/common-core/src/main/java/org/teiid/core/CoreConstants.java
branches/as7/common-core/src/main/java/org/teiid/core/CorePlugin.java
branches/as7/common-core/src/main/java/org/teiid/core/TeiidComponentException.java
branches/as7/common-core/src/main/java/org/teiid/core/TeiidException.java
branches/as7/common-core/src/main/java/org/teiid/core/TeiidProcessingException.java
branches/as7/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java
branches/as7/common-core/src/main/java/org/teiid/core/crypto/
branches/as7/common-core/src/main/java/org/teiid/core/types/
branches/as7/common-core/src/main/java/org/teiid/core/types/BaseLob.java
branches/as7/common-core/src/main/java/org/teiid/core/types/BlobImpl.java
branches/as7/common-core/src/main/java/org/teiid/core/types/BlobType.java
branches/as7/common-core/src/main/java/org/teiid/core/types/ClobImpl.java
branches/as7/common-core/src/main/java/org/teiid/core/types/ClobType.java
branches/as7/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
branches/as7/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java
branches/as7/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java
branches/as7/common-core/src/main/java/org/teiid/core/types/LobSearchUtil.java
branches/as7/common-core/src/main/java/org/teiid/core/types/NullType.java
branches/as7/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java
branches/as7/common-core/src/main/java/org/teiid/core/types/Sequencable.java
branches/as7/common-core/src/main/java/org/teiid/core/types/SourceTransform.java
branches/as7/common-core/src/main/java/org/teiid/core/types/StandardXMLTranslator.java
branches/as7/common-core/src/main/java/org/teiid/core/types/Streamable.java
branches/as7/common-core/src/main/java/org/teiid/core/types/Transform.java
branches/as7/common-core/src/main/java/org/teiid/core/types/TransformationException.java
branches/as7/common-core/src/main/java/org/teiid/core/types/XMLTranslator.java
branches/as7/common-core/src/main/java/org/teiid/core/types/XMLType.java
branches/as7/common-core/src/main/java/org/teiid/core/types/basic/
branches/as7/common-core/src/main/java/org/teiid/core/util/
branches/as7/common-core/src/main/java/org/teiid/core/util/SqlUtil.java
branches/as7/common-core/src/test/java/org/
branches/as7/common-core/src/test/java/org/teiid/
branches/as7/common-core/src/test/java/org/teiid/core/
branches/as7/common-core/src/test/java/org/teiid/core/TestMetaMatrixException.java
branches/as7/common-core/src/test/java/org/teiid/core/TestMetaMatrixRuntimeException.java
branches/as7/common-core/src/test/java/org/teiid/core/crypto/
branches/as7/common-core/src/test/java/org/teiid/core/types/
branches/as7/common-core/src/test/java/org/teiid/core/types/TestBlobValue.java
branches/as7/common-core/src/test/java/org/teiid/core/types/TestClobValue.java
branches/as7/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java
branches/as7/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java
branches/as7/common-core/src/test/java/org/teiid/core/types/TestXMLStreamSourceTranslator.java
branches/as7/common-core/src/test/java/org/teiid/core/types/TestXMLValue.java
branches/as7/common-core/src/test/java/org/teiid/core/types/basic/
branches/as7/common-core/src/test/java/org/teiid/core/util/
branches/as7/common-core/src/test/java/org/teiid/core/util/TestSqlUtil.java
branches/as7/common-core/src/test/java/org/teiid/query/
branches/as7/common-core/src/test/java/org/teiid/query/unittest/
branches/as7/connectors/connector-file/pom.xml
branches/as7/connectors/connector-file/src/main/java/org/teiid/resource/adapter/
branches/as7/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/
branches/as7/connectors/connector-file/src/main/resources/org/
branches/as7/connectors/connector-file/src/main/resources/org/teiid/
branches/as7/connectors/connector-file/src/main/resources/org/teiid/resource/
branches/as7/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/
branches/as7/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/
branches/as7/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties
branches/as7/connectors/connector-file/src/test/java/org/
branches/as7/connectors/connector-file/src/test/java/org/teiid/
branches/as7/connectors/connector-file/src/test/java/org/teiid/resource/
branches/as7/connectors/connector-file/src/test/java/org/teiid/resource/adapter/
branches/as7/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/
branches/as7/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/TestFileConnection.java
branches/as7/connectors/connector-ldap/pom.xml
branches/as7/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/
branches/as7/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/
branches/as7/connectors/connector-salesforce/pom.xml
branches/as7/connectors/connector-ws/pom.xml
branches/as7/connectors/connector-ws/src/main/resources/org/
branches/as7/connectors/connector-ws/src/main/resources/org/teiid/
branches/as7/connectors/connector-ws/src/main/resources/org/teiid/resource/
branches/as7/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/
branches/as7/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/
branches/as7/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties
branches/as7/connectors/pom.xml
branches/as7/connectors/salesforce-api/pom.xml
branches/as7/connectors/sandbox/pom.xml
branches/as7/connectors/sandbox/translator-yahoo/pom.xml
branches/as7/connectors/translator-file/pom.xml
branches/as7/connectors/translator-jdbc/pom.xml
branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ConvertModifier.java
branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/FunctionModifier.java
branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java
branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
branches/as7/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties
branches/as7/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/
branches/as7/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresConvertModifier.java
branches/as7/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresExecutionFactory.java
branches/as7/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
branches/as7/connectors/translator-ldap/pom.xml
branches/as7/connectors/translator-ldap/src/main/java/org/teiid/translator/
branches/as7/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/
branches/as7/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
branches/as7/connectors/translator-loopback/pom.xml
branches/as7/connectors/translator-olap/pom.xml
branches/as7/connectors/translator-salesforce/pom.xml
branches/as7/connectors/translator-ws/pom.xml
branches/as7/console/pom.xml
branches/as7/documentation/admin-guide/pom.xml
branches/as7/documentation/admin-guide/src/main/docbook/en-US/content/security.xml
branches/as7/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml
branches/as7/documentation/caching-guide/pom.xml
branches/as7/documentation/client-developers-guide/pom.xml
branches/as7/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
branches/as7/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml
branches/as7/documentation/developer-guide/pom.xml
branches/as7/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
branches/as7/documentation/pom.xml
branches/as7/documentation/quick-start-example/pom.xml
branches/as7/documentation/reference/pom.xml
branches/as7/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
branches/as7/documentation/reference/src/main/docbook/en-US/content/sql_clauses.xml
branches/as7/documentation/reference/src/main/docbook/en-US/content/translators.xml
branches/as7/engine/pom.xml
branches/as7/engine/src/main/java/org/teiid/api/
branches/as7/engine/src/main/java/org/teiid/api/exception/
branches/as7/engine/src/main/java/org/teiid/api/exception/query/
branches/as7/engine/src/main/java/org/teiid/api/exception/query/ExpressionEvaluationException.java
branches/as7/engine/src/main/java/org/teiid/api/exception/query/FunctionExecutionException.java
branches/as7/engine/src/main/java/org/teiid/api/exception/query/FunctionMetadataException.java
branches/as7/engine/src/main/java/org/teiid/api/exception/query/InvalidFunctionException.java
branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryMetadataException.java
branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryParserException.java
branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryPlannerException.java
branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryProcessingException.java
branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryResolverException.java
branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryValidatorException.java
branches/as7/engine/src/main/java/org/teiid/api/exception/query/UnresolvedSymbolDescription.java
branches/as7/engine/src/main/java/org/teiid/common/
branches/as7/engine/src/main/java/org/teiid/common/buffer/
branches/as7/engine/src/main/java/org/teiid/common/buffer/AbstractTupleSource.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/AutoCleanupUtil.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/BaseCacheEntry.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/BatchManager.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/BlockedException.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/BufferManager.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/Cache.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/CacheEntry.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/CacheKey.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/ExtensibleBufferedInputStream.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/FileStore.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/IndexedTupleSource.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/LightWeightCopyOnWriteList.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/LobManager.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/SPage.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/STree.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/Serializer.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/StorageManager.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/TupleBatch.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/TupleBrowser.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/TupleSource.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/
branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java
branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
branches/as7/engine/src/main/java/org/teiid/core/
branches/as7/engine/src/main/java/org/teiid/core/id/
branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWork.java
branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java
branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
branches/as7/engine/src/main/java/org/teiid/dqp/message/AtomicRequestMessage.java
branches/as7/engine/src/main/java/org/teiid/dqp/service/SessionService.java
branches/as7/engine/src/main/java/org/teiid/query/
branches/as7/engine/src/main/java/org/teiid/query/ObjectReplicator.java
branches/as7/engine/src/main/java/org/teiid/query/QueryPlugin.java
branches/as7/engine/src/main/java/org/teiid/query/ReplicatedObject.java
branches/as7/engine/src/main/java/org/teiid/query/analysis/
branches/as7/engine/src/main/java/org/teiid/query/eval/
branches/as7/engine/src/main/java/org/teiid/query/eval/Evaluator.java
branches/as7/engine/src/main/java/org/teiid/query/function/
branches/as7/engine/src/main/java/org/teiid/query/function/CharsetUtils.java
branches/as7/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java
branches/as7/engine/src/main/java/org/teiid/query/function/FunctionForm.java
branches/as7/engine/src/main/java/org/teiid/query/function/FunctionLibrary.java
branches/as7/engine/src/main/java/org/teiid/query/function/FunctionMetadataSource.java
branches/as7/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
branches/as7/engine/src/main/java/org/teiid/query/function/FunctionTree.java
branches/as7/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java
branches/as7/engine/src/main/java/org/teiid/query/function/UDFSource.java
branches/as7/engine/src/main/java/org/teiid/query/function/aggregate/
branches/as7/engine/src/main/java/org/teiid/query/function/metadata/
branches/as7/engine/src/main/java/org/teiid/query/function/source/
branches/as7/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java
branches/as7/engine/src/main/java/org/teiid/query/mapping/
branches/as7/engine/src/main/java/org/teiid/query/mapping/relational/
branches/as7/engine/src/main/java/org/teiid/query/mapping/xml/
branches/as7/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java
branches/as7/engine/src/main/java/org/teiid/query/metadata/
branches/as7/engine/src/main/java/org/teiid/query/optimizer/
branches/as7/engine/src/main/java/org/teiid/query/optimizer/BatchedUpdatePlanner.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/CommandPlanner.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/DdlPlanner.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/TriggerActionPlanner.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/capabilities/
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/AliasGenerator.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/OptimizerRule.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/PartitionAnalyzer.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/PlanHints.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/RuleStack.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/NodeConstants.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleChooseDependent.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushLimit.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java
branches/as7/engine/src/main/java/org/teiid/query/optimizer/xml/
branches/as7/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java
branches/as7/engine/src/main/java/org/teiid/query/parser/
branches/as7/engine/src/main/java/org/teiid/query/parser/ParseInfo.java
branches/as7/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java
branches/as7/engine/src/main/java/org/teiid/query/processor/
branches/as7/engine/src/main/java/org/teiid/query/processor/BatchCollector.java
branches/as7/engine/src/main/java/org/teiid/query/processor/BatchIterator.java
branches/as7/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java
branches/as7/engine/src/main/java/org/teiid/query/processor/CollectionTupleSource.java
branches/as7/engine/src/main/java/org/teiid/query/processor/DdlPlan.java
branches/as7/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java
branches/as7/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java
branches/as7/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
branches/as7/engine/src/main/java/org/teiid/query/processor/proc/
branches/as7/engine/src/main/java/org/teiid/query/processor/relational/
branches/as7/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java
branches/as7/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
branches/as7/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java
branches/as7/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java
branches/as7/engine/src/main/java/org/teiid/query/processor/xml/
branches/as7/engine/src/main/java/org/teiid/query/report/
branches/as7/engine/src/main/java/org/teiid/query/resolver/
branches/as7/engine/src/main/java/org/teiid/query/resolver/CommandResolver.java
branches/as7/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java
branches/as7/engine/src/main/java/org/teiid/query/resolver/QueryResolver.java
branches/as7/engine/src/main/java/org/teiid/query/resolver/VariableResolver.java
branches/as7/engine/src/main/java/org/teiid/query/resolver/command/
branches/as7/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java
branches/as7/engine/src/main/java/org/teiid/query/resolver/util/
branches/as7/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
branches/as7/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
branches/as7/engine/src/main/java/org/teiid/query/rewriter/
branches/as7/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
branches/as7/engine/src/main/java/org/teiid/query/sql/
branches/as7/engine/src/main/java/org/teiid/query/sql/LanguageObject.java
branches/as7/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java
branches/as7/engine/src/main/java/org/teiid/query/sql/ProcedureReservedWords.java
branches/as7/engine/src/main/java/org/teiid/query/sql/lang/
branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Command.java
branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Delete.java
branches/as7/engine/src/main/java/org/teiid/query/sql/lang/FromClause.java
branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Insert.java
branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Limit.java
branches/as7/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java
branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Update.java
branches/as7/engine/src/main/java/org/teiid/query/sql/navigator/
branches/as7/engine/src/main/java/org/teiid/query/sql/proc/
branches/as7/engine/src/main/java/org/teiid/query/sql/symbol/
branches/as7/engine/src/main/java/org/teiid/query/sql/util/
branches/as7/engine/src/main/java/org/teiid/query/sql/visitor/
branches/as7/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
branches/as7/engine/src/main/java/org/teiid/query/tempdata/
branches/as7/engine/src/main/java/org/teiid/query/util/
branches/as7/engine/src/main/java/org/teiid/query/util/CommandContext.java
branches/as7/engine/src/main/java/org/teiid/query/validator/
branches/as7/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
branches/as7/engine/src/main/java/org/teiid/query/xquery/
branches/as7/engine/src/main/java/org/teiid/query/xquery/saxon/
branches/as7/engine/src/main/java/org/teiid/vdb/
branches/as7/engine/src/main/java/org/teiid/vdb/runtime/
branches/as7/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
branches/as7/engine/src/main/resources/org/teiid/query/i18n.properties
branches/as7/engine/src/test/java/org/teiid/cache/
branches/as7/engine/src/test/java/org/teiid/cache/TestDefaultCache.java
branches/as7/engine/src/test/java/org/teiid/common/
branches/as7/engine/src/test/java/org/teiid/common/buffer/
branches/as7/engine/src/test/java/org/teiid/common/buffer/impl/TestBufferFrontedFileStoreCache.java
branches/as7/engine/src/test/java/org/teiid/common/queue/
branches/as7/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
branches/as7/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
branches/as7/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
branches/as7/engine/src/test/java/org/teiid/query/
branches/as7/engine/src/test/java/org/teiid/query/analysis/
branches/as7/engine/src/test/java/org/teiid/query/function/
branches/as7/engine/src/test/java/org/teiid/query/function/TestFunction.java
branches/as7/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java
branches/as7/engine/src/test/java/org/teiid/query/function/TestFunctionMetadataReader.java
branches/as7/engine/src/test/java/org/teiid/query/function/TestFunctionMethods.java
branches/as7/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java
branches/as7/engine/src/test/java/org/teiid/query/function/TestResolvedFunctions.java
branches/as7/engine/src/test/java/org/teiid/query/function/metadata/
branches/as7/engine/src/test/java/org/teiid/query/function/source/
branches/as7/engine/src/test/java/org/teiid/query/mapping/
branches/as7/engine/src/test/java/org/teiid/query/mapping/xml/
branches/as7/engine/src/test/java/org/teiid/query/metadata/
branches/as7/engine/src/test/java/org/teiid/query/optimizer/
branches/as7/engine/src/test/java/org/teiid/query/optimizer/FakeFunctionMetadataSource.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/InlineViewCase.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestAccessPatterns.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestAnsiJoinPushdown.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestBatchedUpdatePlanner.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestComparableMetadataPushdown.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestDependentJoins.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestExpressionsInGroupBy.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestInlineView.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestJoinOptimization.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestJoinWithFunction.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestLimit.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestPartitionedJoinPlanning.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleRaiseNull.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleRemoveSorts.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestSortOptimization.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestStoredProcedurePlanning.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestSubqueryPushdown.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestUnionPlanning.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/capabilities/
branches/as7/engine/src/test/java/org/teiid/query/optimizer/proc/
branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/
branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/TestAliasGenerator.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/TestRuleStack.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/plantree/
branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/rules/
branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/rules/TestRuleAccessPatternValidation.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/rules/TestRulePushSelectCriteria.java
branches/as7/engine/src/test/java/org/teiid/query/optimizer/xml/
branches/as7/engine/src/test/java/org/teiid/query/parser/
branches/as7/engine/src/test/java/org/teiid/query/parser/TestOptionsAndHints.java
branches/as7/engine/src/test/java/org/teiid/query/processor/
branches/as7/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java
branches/as7/engine/src/test/java/org/teiid/query/processor/FakeDataStore.java
branches/as7/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java
branches/as7/engine/src/test/java/org/teiid/query/processor/FakeTupleSource.java
branches/as7/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestArrayTable.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestBaseProcessorPlan.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestBatchIterator.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestBatchedUpdatePlan.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestCollectionTupleSource.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestDependentJoins.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestFunctionPushdown.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestInherintlyUpdatableViews.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestInsertProcessing.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestJoinWithFunction.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestMaterialization.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestOptionalJoins.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestOrderByProcessing.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestQueryProcessor.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestSecurityFunctions.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestSetProcessing.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestTempTables.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestTextTable.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestTriggerActions.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestWindowFunctions.java
branches/as7/engine/src/test/java/org/teiid/query/processor/TestWithClauseProcessing.java
branches/as7/engine/src/test/java/org/teiid/query/processor/eval/
branches/as7/engine/src/test/java/org/teiid/query/processor/eval/TestCriteriaEvaluator.java
branches/as7/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java
branches/as7/engine/src/test/java/org/teiid/query/processor/proc/
branches/as7/engine/src/test/java/org/teiid/query/processor/relational/
branches/as7/engine/src/test/java/org/teiid/query/processor/xml/
branches/as7/engine/src/test/java/org/teiid/query/resolver/
branches/as7/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
branches/as7/engine/src/test/java/org/teiid/query/rewriter/
branches/as7/engine/src/test/java/org/teiid/query/sql/
branches/as7/engine/src/test/java/org/teiid/query/sql/lang/
branches/as7/engine/src/test/java/org/teiid/query/sql/proc/
branches/as7/engine/src/test/java/org/teiid/query/sql/symbol/
branches/as7/engine/src/test/java/org/teiid/query/sql/util/
branches/as7/engine/src/test/java/org/teiid/query/sql/visitor/
branches/as7/engine/src/test/java/org/teiid/query/unittest/
branches/as7/engine/src/test/java/org/teiid/query/util/
branches/as7/engine/src/test/java/org/teiid/query/validator/
branches/as7/engine/src/test/java/org/teiid/query/validator/TestValidator.java
branches/as7/engine/src/test/java/org/teiid/vdb/
branches/as7/engine/src/test/java/org/teiid/vdb/runtime/
branches/as7/engine/src/test/resources/text/
branches/as7/engine/src/test/resources/text/TextParts_HeaderRow2.csv
branches/as7/engine/src/test/resources/text/cdm_dos.txt
branches/as7/engine/src/test/resources/text/cdm_dos_win.txt
branches/as7/engine/src/test/resources/text/test-file.txt.csv
branches/as7/hibernate-dialect/pom.xml
branches/as7/jboss-integration/pom.xml
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/AssosiateCallerIdentityLoginModule.java
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Transport.java
branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java
branches/as7/metadata/pom.xml
branches/as7/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
branches/as7/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
branches/as7/metadata/src/test/java/org/teiid/cdk/
branches/as7/metadata/src/test/java/org/teiid/cdk/api/
branches/as7/metadata/src/test/java/org/teiid/cdk/unittest/
branches/as7/metadata/src/test/java/org/teiid/core/
branches/as7/metadata/src/test/java/org/teiid/core/util/
branches/as7/metadata/src/test/java/org/teiid/internal/
branches/as7/metadata/src/test/java/org/teiid/internal/core/
branches/as7/metadata/src/test/java/org/teiid/internal/core/index/
branches/as7/pom.xml
branches/as7/runtime/pom.xml
branches/as7/runtime/src/main/java/org/teiid/odbc/ODBCClientRemote.java
branches/as7/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
branches/as7/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java
branches/as7/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java
branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistryImpl.java
branches/as7/runtime/src/main/java/org/teiid/transport/LogonImpl.java
branches/as7/runtime/src/main/java/org/teiid/transport/ODBCClientInstance.java
branches/as7/runtime/src/main/java/org/teiid/transport/ODBCSocketListener.java
branches/as7/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
branches/as7/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java
branches/as7/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
branches/as7/runtime/src/main/java/org/teiid/transport/pg/
branches/as7/runtime/src/main/java/org/teiid/transport/pg/PGbytea.java
branches/as7/runtime/src/main/resources/org/teiid/runtime/i18n.properties
branches/as7/runtime/src/main/resources/org/teiid/transport/
branches/as7/runtime/src/test/java/org/teiid/dqp/
branches/as7/runtime/src/test/java/org/teiid/dqp/service/
branches/as7/runtime/src/test/java/org/teiid/dqp/service/buffer/
branches/as7/runtime/src/test/java/org/teiid/transport/TestLogonImpl.java
branches/as7/test-integration/common/pom.xml
branches/as7/test-integration/common/src/test/java/org/teiid/cdk/
branches/as7/test-integration/common/src/test/java/org/teiid/cdk/api/
branches/as7/test-integration/common/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java
branches/as7/test-integration/common/src/test/java/org/teiid/dqp/
branches/as7/test-integration/common/src/test/java/org/teiid/dqp/internal/
branches/as7/test-integration/common/src/test/java/org/teiid/dqp/internal/process/
branches/as7/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
branches/as7/test-integration/common/src/test/java/org/teiid/transport/
branches/as7/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java
branches/as7/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java
branches/as7/test-integration/common/src/test/resources/TestJDBCSocketTransport/
branches/as7/test-integration/common/src/test/resources/TestJDBCSocketTransport/testSelect.expected
branches/as7/test-integration/common/src/test/resources/TestODBCSocketTransport/
branches/as7/test-integration/common/src/test/resources/TestODBCSocketTransport/testColumnMetadataWithAlias.expected
branches/as7/test-integration/common/src/test/resources/TestODBCSocketTransport/testPk.expected
branches/as7/test-integration/common/src/test/resources/TestODBCSocketTransport/testPkPrepared.expected
branches/as7/test-integration/common/src/test/resources/TestODBCSocketTransport/testSelect.expected
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testDataTypes.expected
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeyColumns.expected
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeys.expected
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedureParams.expected
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedures.expected
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testReferenceKeyColumns.expected
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testSchemas.expected
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testTableIsSystem.expected
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected
branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testVDBResources.expected
branches/as7/test-integration/db/pom.xml
branches/as7/test-integration/db/src/main/java/org/teiid/internal/
branches/as7/test-integration/db/src/main/java/org/teiid/internal/core/
branches/as7/test-integration/db/src/main/java/org/teiid/internal/core/xml/
branches/as7/test-integration/db/src/test/java/com/
branches/as7/test-integration/db/src/test/java/org/teiid/internal/
branches/as7/test-integration/db/src/test/java/org/teiid/internal/core/
branches/as7/test-integration/pom.xml
Log:
TEIID-1720: Forward merging trunk; merge -r 3597:3666 https://svn.jboss.org/repos/teiid/trunk .
Property changes on: branches/as7
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x:3535-3555
/trunk:3188-3450,3452-3597
+ /branches/7.4.x:3535-3555
/trunk:3188-3450,3452-3666
Modified: branches/as7/admin/pom.xml
===================================================================
--- branches/as7/admin/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/admin/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-admin</artifactId>
Modified: branches/as7/adminshell/pom.xml
===================================================================
--- branches/as7/adminshell/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/adminshell/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Property changes on: branches/as7/adminshell/src/main/java/groovy
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/java/groovy:3535-3555*
/trunk/adminshell/src/main/java/groovy:3507-3597
+ /branches/7.4.x/adminshell/src/main/java/groovy:3535-3555*
/trunk/adminshell/src/main/java/groovy:3507-3666
Property changes on: branches/as7/adminshell/src/main/java/groovy/sql
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/java/groovy/sql:3535-3555*
/trunk/adminshell/src/main/java/groovy/sql:3507-3597
+ /branches/7.4.x/adminshell/src/main/java/groovy/sql:3535-3555*
/trunk/adminshell/src/main/java/groovy/sql:3507-3666
Property changes on: branches/as7/adminshell/src/main/java/groovy/sql/TeiidSql.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/java/groovy/sql/TeiidSql.java:3535-3555
/trunk/adminshell/src/main/java/groovy/sql/TeiidSql.java:3507-3597
+ /branches/7.4.x/adminshell/src/main/java/groovy/sql/TeiidSql.java:3535-3555
/trunk/adminshell/src/main/java/groovy/sql/TeiidSql.java:3507-3666
Property changes on: branches/as7/adminshell/src/main/java/org/teiid/adminshell
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell:3535-3555*
/trunk/adminshell/src/main/java/org/teiid/adminshell:3507-3597
+ /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell:3535-3555*
/trunk/adminshell/src/main/java/org/teiid/adminshell:3507-3666
Property changes on: branches/as7/adminshell/src/main/java/org/teiid/adminshell/AdminHelpCommand.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/AdminHelpCommand.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/AdminHelpCommand.java:3507-3597
+ /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/AdminHelpCommand.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/AdminHelpCommand.java:3507-3666
Property changes on: branches/as7/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.1.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java:2901-2940
/branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java:3188-3450,3452-3597
+ /branches/7.1.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java:2901-2940
/branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java:3188-3450,3452-3666
Property changes on: branches/as7/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminConsole.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminConsole.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminConsole.java:3507-3597
+ /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminConsole.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminConsole.java:3507-3666
Property changes on: branches/as7/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminShell.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminShell.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminShell.java:3507-3597
+ /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminShell.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/GroovyAdminShell.java:3507-3666
Property changes on: branches/as7/adminshell/src/main/java/org/teiid/adminshell/GroovySqlExtensions.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/GroovySqlExtensions.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/GroovySqlExtensions.java:3507-3597
+ /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/GroovySqlExtensions.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/GroovySqlExtensions.java:3507-3666
Property changes on: branches/as7/adminshell/src/main/java/org/teiid/adminshell/Help.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/Help.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/Help.java:3507-3597
+ /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/Help.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/Help.java:3507-3666
Property changes on: branches/as7/adminshell/src/main/java/org/teiid/adminshell/MigrationUtil.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/MigrationUtil.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/MigrationUtil.java:3507-3597
+ /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/MigrationUtil.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/MigrationUtil.java:3507-3666
Property changes on: branches/as7/adminshell/src/main/java/org/teiid/adminshell/SqlHelpCommand.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/SqlHelpCommand.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/SqlHelpCommand.java:3507-3597
+ /branches/7.4.x/adminshell/src/main/java/org/teiid/adminshell/SqlHelpCommand.java:3535-3555
/trunk/adminshell/src/main/java/org/teiid/adminshell/SqlHelpCommand.java:3507-3666
Property changes on: branches/as7/adminshell/src/main/resources/org
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/resources/org:3535-3555*
/trunk/adminshell/src/main/resources/org:3507-3597
+ /branches/7.4.x/adminshell/src/main/resources/org:3535-3555*
/trunk/adminshell/src/main/resources/org:3507-3666
Property changes on: branches/as7/adminshell/src/main/resources/org/codehaus
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/resources/org/codehaus:3535-3555*
/trunk/adminshell/src/main/resources/org/codehaus:3507-3597
+ /branches/7.4.x/adminshell/src/main/resources/org/codehaus:3535-3555*
/trunk/adminshell/src/main/resources/org/codehaus:3507-3666
Property changes on: branches/as7/adminshell/src/main/resources/org/codehaus/groovy
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/resources/org/codehaus/groovy:3535-3555*
/trunk/adminshell/src/main/resources/org/codehaus/groovy:3507-3597
+ /branches/7.4.x/adminshell/src/main/resources/org/codehaus/groovy:3535-3555*
/trunk/adminshell/src/main/resources/org/codehaus/groovy:3507-3666
Property changes on: branches/as7/adminshell/src/main/resources/org/codehaus/groovy/tools
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/resources/org/codehaus/groovy/tools:3535-3555*
/trunk/adminshell/src/main/resources/org/codehaus/groovy/tools:3507-3597
+ /branches/7.4.x/adminshell/src/main/resources/org/codehaus/groovy/tools:3535-3555*
/trunk/adminshell/src/main/resources/org/codehaus/groovy/tools:3507-3666
Property changes on: branches/as7/adminshell/src/main/resources/org/codehaus/groovy/tools/shell
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/resources/org/codehaus/groovy/tools/shell:3535-3555*
/trunk/adminshell/src/main/resources/org/codehaus/groovy/tools/shell:3507-3597
+ /branches/7.4.x/adminshell/src/main/resources/org/codehaus/groovy/tools/shell:3535-3555*
/trunk/adminshell/src/main/resources/org/codehaus/groovy/tools/shell:3507-3666
Property changes on: branches/as7/adminshell/src/main/resources/org/codehaus/groovy/tools/shell/commands.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/resources/org/codehaus/groovy/tools/shell/commands.xml:3535-3555
/trunk/adminshell/src/main/resources/org/codehaus/groovy/tools/shell/commands.xml:3507-3597
+ /branches/7.4.x/adminshell/src/main/resources/org/codehaus/groovy/tools/shell/commands.xml:3535-3555
/trunk/adminshell/src/main/resources/org/codehaus/groovy/tools/shell/commands.xml:3507-3666
Property changes on: branches/as7/adminshell/src/main/resources/org/teiid
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/resources/org/teiid:3535-3555*
/trunk/adminshell/src/main/resources/org/teiid:3507-3597
+ /branches/7.4.x/adminshell/src/main/resources/org/teiid:3535-3555*
/trunk/adminshell/src/main/resources/org/teiid:3507-3666
Property changes on: branches/as7/adminshell/src/main/resources/org/teiid/adminshell
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/resources/org/teiid/adminshell:3535-3555*
/trunk/adminshell/src/main/resources/org/teiid/adminshell:3507-3597
+ /branches/7.4.x/adminshell/src/main/resources/org/teiid/adminshell:3535-3555*
/trunk/adminshell/src/main/resources/org/teiid/adminshell:3507-3666
Property changes on: branches/as7/adminshell/src/main/resources/org/teiid/adminshell/AdminHelpCommand.properties
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/resources/org/teiid/adminshell/AdminHelpCommand.properties:3535-3555
/trunk/adminshell/src/main/resources/org/teiid/adminshell/AdminHelpCommand.properties:3507-3597
+ /branches/7.4.x/adminshell/src/main/resources/org/teiid/adminshell/AdminHelpCommand.properties:3535-3555
/trunk/adminshell/src/main/resources/org/teiid/adminshell/AdminHelpCommand.properties:3507-3666
Property changes on: branches/as7/adminshell/src/main/resources/org/teiid/adminshell/SqlHelpCommand.properties
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/main/resources/org/teiid/adminshell/SqlHelpCommand.properties:3535-3555
/trunk/adminshell/src/main/resources/org/teiid/adminshell/SqlHelpCommand.properties:3507-3597
+ /branches/7.4.x/adminshell/src/main/resources/org/teiid/adminshell/SqlHelpCommand.properties:3535-3555
/trunk/adminshell/src/main/resources/org/teiid/adminshell/SqlHelpCommand.properties:3507-3666
Property changes on: branches/as7/adminshell/src/test/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/test/java/org:3535-3555*
/trunk/adminshell/src/test/java/org:3507-3597
+ /branches/7.4.x/adminshell/src/test/java/org:3535-3555*
/trunk/adminshell/src/test/java/org:3507-3666
Property changes on: branches/as7/adminshell/src/test/java/org/teiid
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/test/java/org/teiid:3535-3555*
/trunk/adminshell/src/test/java/org/teiid:3507-3597
+ /branches/7.4.x/adminshell/src/test/java/org/teiid:3535-3555*
/trunk/adminshell/src/test/java/org/teiid:3507-3666
Property changes on: branches/as7/adminshell/src/test/java/org/teiid/adminshell
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/test/java/org/teiid/adminshell:3535-3555*
/trunk/adminshell/src/test/java/org/teiid/adminshell:3507-3597
+ /branches/7.4.x/adminshell/src/test/java/org/teiid/adminshell:3535-3555*
/trunk/adminshell/src/test/java/org/teiid/adminshell:3507-3666
Property changes on: branches/as7/adminshell/src/test/java/org/teiid/adminshell/TestAdminShell.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/test/java/org/teiid/adminshell/TestAdminShell.java:3535-3555
/trunk/adminshell/src/test/java/org/teiid/adminshell/TestAdminShell.java:3507-3597
+ /branches/7.4.x/adminshell/src/test/java/org/teiid/adminshell/TestAdminShell.java:3535-3555
/trunk/adminshell/src/test/java/org/teiid/adminshell/TestAdminShell.java:3507-3666
Property changes on: branches/as7/adminshell/src/test/resources/foo
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/test/resources/foo:3535-3555*
/trunk/adminshell/src/test/resources/foo:3507-3597
+ /branches/7.4.x/adminshell/src/test/resources/foo:3535-3555*
/trunk/adminshell/src/test/resources/foo:3507-3666
Property changes on: branches/as7/adminshell/src/test/resources/foo/bar.txt
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/adminshell/src/test/resources/foo/bar.txt:3535-3555
/trunk/adminshell/src/test/resources/foo/bar.txt:3507-3597
+ /branches/7.4.x/adminshell/src/test/resources/foo/bar.txt:3535-3555
/trunk/adminshell/src/test/resources/foo/bar.txt:3507-3666
Modified: branches/as7/api/pom.xml
===================================================================
--- branches/as7/api/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/api/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Property changes on: branches/as7/api/src/main/java/org/teiid/events
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/api/src/main/java/org/teiid/events:3535-3555*
/trunk/api/src/main/java/org/teiid/events:3507-3597
+ /branches/7.4.x/api/src/main/java/org/teiid/events:3535-3555*
/trunk/api/src/main/java/org/teiid/events:3507-3666
Property changes on: branches/as7/api/src/main/java/org/teiid/events/EventDistributor.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/api/src/main/java/org/teiid/events/EventDistributor.java:3340-3349,3535-3555
/trunk/api/src/main/java/org/teiid/events/EventDistributor.java:3188-3450,3452-3597
+ /branches/7.4.x/api/src/main/java/org/teiid/events/EventDistributor.java:3340-3349,3535-3555
/trunk/api/src/main/java/org/teiid/events/EventDistributor.java:3188-3450,3452-3666
Property changes on: branches/as7/api/src/main/java/org/teiid/events/EventDistributorFactory.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/api/src/main/java/org/teiid/events/EventDistributorFactory.java:3535-3555
/trunk/api/src/main/java/org/teiid/events/EventDistributorFactory.java:3507-3597
+ /branches/7.4.x/api/src/main/java/org/teiid/events/EventDistributorFactory.java:3535-3555
/trunk/api/src/main/java/org/teiid/events/EventDistributorFactory.java:3507-3666
Modified: branches/as7/api/src/main/java/org/teiid/language/visitor/SQLStringVisitor.java
===================================================================
--- branches/as7/api/src/main/java/org/teiid/language/visitor/SQLStringVisitor.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/api/src/main/java/org/teiid/language/visitor/SQLStringVisitor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -97,6 +97,7 @@
protected static final String UNDEFINED_PARAM = "?"; //$NON-NLS-1$
protected StringBuilder buffer = new StringBuilder();
+ private boolean appendedSourceComment;
/**
* Gets the name of a group or element from the RuntimeMetadata
@@ -230,7 +231,7 @@
public void visit(Delete obj) {
buffer.append(DELETE)
.append(Tokens.SPACE);
- buffer.append(getSourceComment(obj));
+ appendSourceComment(obj);
buffer.append(FROM)
.append(Tokens.SPACE);
append(obj.getTable());
@@ -242,6 +243,14 @@
}
}
+ private void appendSourceComment(Command obj) {
+ if (appendedSourceComment) {
+ return;
+ }
+ appendedSourceComment = true;
+ buffer.append(getSourceComment(obj));
+ }
+
/**
* Take the specified derived group and element short names and determine a
* replacement element name to use instead. Most commonly, this is used to strip
@@ -502,7 +511,7 @@
public void visit(Insert obj) {
buffer.append(INSERT).append(Tokens.SPACE);
- buffer.append(getSourceComment(obj));
+ appendSourceComment(obj);
buffer.append(INTO).append(Tokens.SPACE);
append(obj.getTable());
buffer.append(Tokens.SPACE).append(Tokens.LPAREN);
@@ -725,7 +734,7 @@
append(obj.getWith());
}
buffer.append(SELECT).append(Tokens.SPACE);
- buffer.append(getSourceComment(obj));
+ appendSourceComment(obj);
if (obj.isDistinct()) {
buffer.append(DISTINCT).append(Tokens.SPACE);
}
@@ -851,7 +860,7 @@
public void visit(Update obj) {
buffer.append(UPDATE)
.append(Tokens.SPACE);
- buffer.append(getSourceComment(obj));
+ appendSourceComment(obj);
append(obj.getTable());
buffer.append(Tokens.SPACE)
.append(SET)
@@ -912,7 +921,7 @@
protected void appendSetQuery(SetQuery parent, QueryExpression obj, boolean right) {
if((!(obj instanceof SetQuery) && useParensForSetQueries())
- || (right && ((obj instanceof SetQuery
+ || (!useSelectLimit() && (obj.getLimit() != null || obj.getOrderBy() != null)) || (right && ((obj instanceof SetQuery
&& ((parent.isAll() && !((SetQuery)obj).isAll())
|| parent.getOperation() != ((SetQuery)obj).getOperation())) || obj.getLimit() != null || obj.getOrderBy() != null))) {
buffer.append(Tokens.LPAREN);
Modified: branches/as7/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java
===================================================================
--- branches/as7/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -33,15 +33,17 @@
import org.teiid.metadata.RuntimeMetadata;
/**
- * Delegate translator. User can define a {@link ExecutionFactory} of their own and have this translator
- * delegate all the calls to that class. Please note that your 'vdb.xml' file will contain
- * an xml fragment like the following to configure a delegating translator.
+ * Base delegating translator. Will proxy all calls to another {@link ExecutionFactory}.
+ * You will create a custom translator as a subclass of this class containing overrides for
+ * any method you wish to intercept.
+ * Given that subclass is given a {@link Translator} name of 'custom-delegator', your 'vdb.xml' file will
+ * contain an XML fragment like the following to assign the delegate:
* <pre>
* {@code
- <translator type="delegate" name="my-translator" description="custom translator">
- <property value="delegateName" name="name of the delegate instance"/>
- </translator>
- }
+ <translator type="custom-delegator" name="my-translator" description="custom translator">
+ <property value="delegateName" name="name of the delegate instance"/>
+ <!-- any custom properties will also appear here -->
+ </translator>}
* </pre>
*
*/
Modified: branches/as7/api/src/main/java/org/teiid/translator/DataNotAvailableException.java
===================================================================
--- branches/as7/api/src/main/java/org/teiid/translator/DataNotAvailableException.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/api/src/main/java/org/teiid/translator/DataNotAvailableException.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -25,7 +25,7 @@
/**
* Used by asynch connectors to indicate data is not available
- * and results should be polled for after the given delay.
+ * and results should be polled for after the given delay in milliseconds.
*/
public class DataNotAvailableException extends TeiidRuntimeException {
@@ -33,9 +33,24 @@
private long retryDelay = 0;
+ /**
+ * Indicate that the engine should not poll for results and will be notified
+ * via the {@link ExecutionContext#dataAvailable()} method.
+ */
+ public static final DataNotAvailableException NO_POLLING = new DataNotAvailableException(-1);
+
+ /**
+ * Uses a delay of 0, which implies an immediate poll for results.
+ */
public DataNotAvailableException() {
}
+ /**
+ * Uses the given retryDelay. Negative values indicate that the
+ * engine should not poll for results (see also {@link DataNotAvailableException#NO_POLLING} and will be notified
+ * via the {@link ExecutionContext#dataAvailable()} method.
+ * @param retryDelay in milliseconds
+ */
public DataNotAvailableException(long retryDelay) {
this.retryDelay = retryDelay;
}
Modified: branches/as7/api/src/main/java/org/teiid/translator/ExecutionContext.java
===================================================================
--- branches/as7/api/src/main/java/org/teiid/translator/ExecutionContext.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/api/src/main/java/org/teiid/translator/ExecutionContext.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -23,10 +23,12 @@
package org.teiid.translator;
import java.io.Serializable;
+import java.sql.Statement;
import javax.security.auth.Subject;
import org.teiid.adminapi.Session;
+import org.teiid.jdbc.TeiidSQLWarning;
@@ -99,6 +101,18 @@
* @since 4.2
*/
Serializable getExecutionPayload();
+
+ /**
+ * Get the general hint passed to all executions under the user query.
+ * @return the general hint or null if none was specified
+ */
+ String getGeneralHint();
+
+ /**
+ * Get the hint designated for this source.
+ * @return the source hint or null if none was specified
+ */
+ String getSourceHint();
/**
* Get the identifier for the connection through which
@@ -130,7 +144,8 @@
int getBatchSize();
/**
- * Add an exception as a warning to this Execution.
+ * Add an exception as a warning to this Execution. The exception will be wrapped by a {@link TeiidSQLWarning} for the client.
+ * The warnings can be consumed through the {@link Statement#getWarnings()} method.
* @param ex
*/
void addWarning(Exception ex);
@@ -146,4 +161,10 @@
* @return
*/
Session getSession();
+
+ /**
+ * Signal the engine that data is available and processing should be
+ * resumed.
+ */
+ void dataAvailable();
}
Modified: branches/as7/build/assembly/jboss-as7/dist.xml
===================================================================
--- branches/as7/build/assembly/jboss-as7/dist.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/build/assembly/jboss-as7/dist.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -392,6 +392,28 @@
</moduleSet>
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+ <includes>
+ <include>org.jboss.teiid.connectors:translator-hive</include>
+ </includes>
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </dependencySet>
+ </dependencySets>
+ <outputDirectory>modules/org/jboss/teiid/translator/hive/main</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+ </moduleSet>
+
<!-- Include the JOPR plugin
<moduleSet>
<includeSubModules>true</includeSubModules>
Modified: branches/as7/build/assembly/jboss-container/dist.xml
===================================================================
--- branches/as7/build/assembly/jboss-container/dist.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/build/assembly/jboss-container/dist.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -185,6 +185,7 @@
<include>org.jboss.teiid.connectors:translator-salesforce</include>
<include>org.jboss.teiid.connectors:translator-ws</include>
<include>org.jboss.teiid.connectors:translator-olap</include>
+ <include>org.jboss.teiid.connectors:translator-hive</include>
</includes>
<binaries>
Property changes on: branches/as7/build/kits
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/build/kits:3535-3555*
/trunk/build/kits:3507-3597
+ /branches/7.4.x/build/kits:3535-3555*
/trunk/build/kits:3507-3666
Property changes on: branches/as7/build/kits/adminshell
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/build/kits/adminshell:3535-3555
/trunk/build/kits/adminshell:3507-3597
+ /branches/7.4.x/build/kits/adminshell:3535-3555
/trunk/build/kits/adminshell:3507-3666
Added: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/hive/main/module.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/hive/main/module.xml (rev 0)
+++ branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/hive/main/module.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module xmlns="urn:jboss:module:1.0" name="org.jboss.teiid.translator.hive">
+ <resources>
+ <resource-root path="translator-hive-${project.version}.jar" />
+ <!-- Insert resources here -->
+ </resources>
+
+
+ <dependencies>
+ <module name="javax.resource.api"/>
+ <module name="javax.api"/>
+ <module name="org.apache.commons.logging" />
+ <module name="org.apache.log4j"/>
+ <module name="org.jboss.teiid.common-core" />
+ <module name="org.jboss.teiid.api" />
+ <module name="org.jboss.teiid.translator.jdbc" />
+ </dependencies>
+</module>
\ No newline at end of file
Property changes on: branches/as7/build/kits/jboss-as7/modules/org/jboss/teiid/translator/hive/main/module.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/as7/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -481,6 +481,7 @@
<translator name="olap" module="org.jboss.teiid.translator.olap"/>
<translator name="ws" module="org.jboss.teiid.translator.ws"/>
<translator name="salesforce" module="org.jboss.teiid.translator.salesforce"/>
+ <translator name="hive" module="org.jboss.teiid.translator.hive"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:threads:1.0">
Property changes on: branches/as7/build/kits/jboss-container
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/build/kits/jboss-container:3535-3555
/trunk/build/kits/jboss-container:3507-3597
+ /branches/7.4.x/build/kits/jboss-container:3535-3555
/trunk/build/kits/jboss-container:3507-3666
Modified: branches/as7/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- branches/as7/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -13,10 +13,10 @@
<property name="sessionMaxLimit">5000</property>
<!-- Max allowed time before the session is terminated by the system, 0 indicates unlimited (default 0) -->
<property name="sessionExpirationTimeLimit">0</property>
- <!-- authentication type are CLEARTEXT, KRB5 (default:CLEARTEXT) -->
+ <!-- authentication type are CLEARTEXT, GSS (default:CLEARTEXT) -->
<property name="authenticationType">CLEARTEXT</property>
- <!-- When authenticationType=KRB5, then it requires a kerberos security domain to authorize first before teiid-security takes over -->
- <property name="krb5SecurityDomain">teiid-krb5</property>
+ <!-- When authenticationType=GSS, then it requires a kerberos security domain to authorize first before teiid-security takes over -->
+ <property name="gssSecurityDomain">teiid-krb5</property>
</bean>
<bean name="BufferService" class="org.teiid.services.BufferServiceImpl">
Copied: branches/as7/build/kits/jboss-container/teiid-examples/jca/hive-ds.xml (from rev 3666, trunk/build/kits/jboss-container/teiid-examples/jca/hive-ds.xml)
===================================================================
--- branches/as7/build/kits/jboss-container/teiid-examples/jca/hive-ds.xml (rev 0)
+++ branches/as7/build/kits/jboss-container/teiid-examples/jca/hive-ds.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+ <!--
+ Copy the following jars into the "lib" directory for Hive JDBC driver. These jar files can be
+ found Hive/lib and Hadoop/lib directories.
+
+ hadoop-core-0.20.203.0.jar
+ hive-exec-0.7.1.jar
+ hive-jdbc-0.7.1.jar
+ hive-metastore-0.7.1.jar
+ hive-service-0.7.1.jar
+ libfb303.jar
+ -->
+ <local-tx-datasource>
+ <jndi-name>HiveDS</jndi-name>
+ <connection-url>jdbc:hive://localhost:10000/default</connection-url>
+ <driver-class>org.apache.hadoop.hive.jdbc.HiveDriver</driver-class>
+ </local-tx-datasource>
+
+</datasources>
Modified: branches/as7/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/as7/build/kits/jboss-container/teiid-releasenotes.html 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/build/kits/jboss-container/teiid-releasenotes.html 2011-11-17 22:30:19 UTC (rev 3667)
@@ -30,11 +30,22 @@
<LI><B>File Enhancements</B> - the file translator can now optionally (via the ExceptionIfFileNotFound property) throw an exception if the path refers to a file that doesn't exist. The file resource adapter can be configured to map file names and can prevent parent path .. references. See the Admin Guide or the file-ds.xml template for more.
<LI><B>TEXTTABLE Enhancements</B> - TEXTTABLE can now parse fixed width files that do not use a row delimiter and can optionally produce fixed values that haven't been trimmed.
<LI><B>Temp table transactions</B> - Internal materialized views and temp table usage from a session and within procedures can take advantage of greater transaction support.
- <LI><B>Buffering Improvements</B> - Added the ability to inline memory based or small lobs and added tracking of the memory held by soft references. Also switched to a concurrent LFRU algorithm that significantly reduces writes and read misses with temporary tables. Added a memory buffer to better handle file storage.
- The memory buffer may be optional be configured as off-heap for better large memory performance - see the Admin Guide for more. Overhead is now tracked to help prevent memory errors when dealing with 10s of millions or more of batches/pages. Serialization and disk utilization were also improved.
+ <LI><B>Buffering Improvements</B>
+ <ul>
+ <li>Added the ability to inline memory based or small lobs.
+ <li>Added tracking of the memory held by soft references and general batch overhead. This ensures more efficient cache/memory utilization when dealing with 10s of millions or more of batches/pages.
+ <li>Also switched to a concurrent LFRU algorithm that significantly reduces writes and read misses with temporary tables.
+ <li>Added a memory buffer to better handle file storage as fixed blocks. The memory buffer may optionally be configured as off-heap for better large memory performance - see the Admin Guide for more.
+ <li>Serialization was improved for both internal batches and client/server batches.
+ </ul>
<LI><B>GSSAPI</B> - both the Teiid JDBC client/server and the ODBC pg backend can now support GSSAPI for single sign-on.
<LI><B>Server-side Query Timeouts</B> - default query timeouts can be configured at both the VDB (via the query-timeout VDB property) and entire server (via the teiid-jboss-beans.xml query-timeout property).
- <LI><B>Native Queries</B> - added the ability to specify native query SQL for JDBC physical tables and stored procedures via extension metadata.
+ <LI><B>Native Queries</B> - added the ability to specify native query SQL for JDBC physical tables and stored procedures via extension metadata. See the Reference for more.
+ <LI><B>View removal hint</B> - the NO_UNNEST hint now also applies to FROM clause views and subqueries. It will instruct the planner to not perform view flattening.
+ <LI><B>Non-blocking statement execution</B> - Teiid JDBC extensions TeiidStatement and TeiidPreparedStatement can be used to submit queries against embedded connections with a callback to process results in a non-blocking manner.
+ <LI><B>NON_STRICT limit hint</B> - the NON_STRICT hint can be used with unordered limits to tell the optimizer to not inhibit push operations even if the results will not be consistent with the logical application of the limit.
+ <LI><B>Source Hints</B> - user and transformation queries can specify a meta source hint, e.g. SELECT /*+ sh my-oracle:'leading' */ * FROM TBL. The hint information will be passed to the translator. The Oracle translator will by default treat the source hint as an Oracle hint. See the Reference and Developers Guide for more.
+ <LI><B>Hive Translator</B> - Hive translator has been added as a technology preview.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
@@ -49,6 +60,7 @@
<li>Leave was added as a reserved word.
<li>Lob inlining is incompatible with clients older than 7.6. If a 7.6 server will have older clients that use lobs connect to it, then the BufferService property inline-lobs should be set to false in the teiid-jboss-beans.xml file.
<li>Oracle translators assume they are using Oracle supplied drivers. If that is not the case, set the Oracle translator execution property oracleSuppliedDriver to false.
+ <li>Unordered limits are handled strictly by default. They are longer pushed through conditions, dup removal, or UNION not all - and cannot have conditions pushed through them. Use the NON_STRICT hint to change the behavior to Teiid 7.1 handling.
</ul>
<h4>from 7.4</h4>
Modified: branches/as7/build/pom.xml
===================================================================
--- branches/as7/build/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/build/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid</artifactId>
Modified: branches/as7/cache-jbosscache/pom.xml
===================================================================
--- branches/as7/cache-jbosscache/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/cache-jbosscache/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-cache-jbosscache</artifactId>
Property changes on: branches/as7/cache-jbosscache/src/main/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/cache-jbosscache/src/main/java/org:3535-3555*
/trunk/cache-jbosscache/src/main/java/org:3507-3597
+ /branches/7.4.x/cache-jbosscache/src/main/java/org:3535-3555*
/trunk/cache-jbosscache/src/main/java/org:3507-3666
Property changes on: branches/as7/cache-jbosscache/src/main/java/org/teiid
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid:3535-3555*
/trunk/cache-jbosscache/src/main/java/org/teiid:3507-3597
+ /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid:3535-3555*
/trunk/cache-jbosscache/src/main/java/org/teiid:3507-3666
Property changes on: branches/as7/cache-jbosscache/src/main/java/org/teiid/cache
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache:3535-3555*
/trunk/cache-jbosscache/src/main/java/org/teiid/cache:3507-3597
+ /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache:3535-3555*
/trunk/cache-jbosscache/src/main/java/org/teiid/cache:3507-3666
Property changes on: branches/as7/cache-jbosscache/src/main/java/org/teiid/cache/jboss
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss:3535-3555
/trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss:3507-3597
+ /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss:3535-3555
/trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss:3507-3666
Property changes on: branches/as7/cache-jbosscache/src/main/java/org/teiid/events
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/events:3535-3555*
/trunk/cache-jbosscache/src/main/java/org/teiid/events:3507-3597
+ /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/events:3535-3555*
/trunk/cache-jbosscache/src/main/java/org/teiid/events:3507-3666
Property changes on: branches/as7/cache-jbosscache/src/main/java/org/teiid/replication
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication:3535-3555*
/trunk/cache-jbosscache/src/main/java/org/teiid/replication:3507-3597
+ /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication:3535-3555*
/trunk/cache-jbosscache/src/main/java/org/teiid/replication:3507-3666
Property changes on: branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/jboss
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss:3535-3555*
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss:3507-3597
+ /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss:3535-3555*
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss:3507-3666
Property changes on: branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java:3535-3555
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java:3507-3597
+ /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java:3535-3555
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java:3507-3666
Modified: branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
===================================================================
--- branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -235,6 +235,9 @@
public void stop(Object object) {
+ if (!Proxy.isProxyClass(object.getClass())) {
+ return;
+ }
ReplicatedInvocationHandler<?> handler = (ReplicatedInvocationHandler<?>) Proxy.getInvocationHandler(object);
Channel c = handler.disp.getChannel();
handler.disp.stop();
@@ -361,24 +364,30 @@
});
T replicatedProxy = (T) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {iface}, proxy);
-
- channel.connect(clusterName);
- if (object instanceof ReplicatedObject) {
- ((ReplicatedObject)object).setLocalAddress(channel.getLocalAddress());
- boolean getState = channel.getState(null, startTimeout);
- if (getState) {
- boolean loaded = proxy.state_promise.getResult(startTimeout);
- if (loaded) {
- LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "loaded"); //$NON-NLS-1$
+ boolean success = false;
+ try {
+ channel.connect(mux_id);
+ if (object instanceof ReplicatedObject) {
+ ((ReplicatedObject)object).setLocalAddress(channel.getLocalAddress());
+ boolean getState = channel.getState(null, startTimeout);
+ if (getState) {
+ boolean loaded = proxy.state_promise.getResult(startTimeout);
+ if (loaded) {
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "loaded"); //$NON-NLS-1$
+ } else {
+ LogManager.logWarning(LogConstants.CTX_RUNTIME, object + " load timeout"); //$NON-NLS-1$
+ }
} else {
- LogManager.logWarning(LogConstants.CTX_RUNTIME, object + " load timeout"); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, object + " first member or timeout exceeded"); //$NON-NLS-1$
}
- } else {
- LogManager.logInfo(LogConstants.CTX_RUNTIME, object + " first member or timeout exceeded"); //$NON-NLS-1$
}
+ success = true;
+ return replicatedProxy;
+ } finally {
+ if (!success) {
+ channel.close();
+ }
}
-
- return replicatedProxy;
}
}
Property changes on: branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java:3535-3555
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java:3507-3597
+ /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java:3535-3555
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java:3507-3666
Property changes on: branches/as7/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java:3535-3555
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java:3507-3597
+ /branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java:3535-3555
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java:3507-3666
Property changes on: branches/as7/cache-jbosscache/src/test/java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/cache-jbosscache/src/test/java:3535-3555*
/trunk/cache-jbosscache/src/test/java:3507-3597
+ /branches/7.4.x/cache-jbosscache/src/test/java:3535-3555*
/trunk/cache-jbosscache/src/test/java:3507-3666
Modified: branches/as7/client/pom.xml
===================================================================
--- branches/as7/client/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Property changes on: branches/as7/client/src/main/java/org/teiid/client/util
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/client/util:3535-3555*
/trunk/client/src/main/java/org/teiid/client/util:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/client/util:3535-3555*
/trunk/client/src/main/java/org/teiid/client/util:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/client/util/ExceptionHolder.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/client/util/ExceptionHolder.java:3535-3555
/trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/client/util/ExceptionHolder.java:3535-3555
/trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/client/util/ExceptionUtil.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/client/util/ExceptionUtil.java:3535-3555
/trunk/client/src/main/java/org/teiid/client/util/ExceptionUtil.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/client/util/ExceptionUtil.java:3535-3555
/trunk/client/src/main/java/org/teiid/client/util/ExceptionUtil.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/client/util/ResultsFuture.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/client/util/ResultsFuture.java:3535-3555
/trunk/client/src/main/java/org/teiid/client/util/ResultsFuture.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/client/util/ResultsFuture.java:3535-3555
/trunk/client/src/main/java/org/teiid/client/util/ResultsFuture.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/client/util/ResultsReceiver.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/client/util/ResultsReceiver.java:3535-3555
/trunk/client/src/main/java/org/teiid/client/util/ResultsReceiver.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/client/util/ResultsReceiver.java:3535-3555
/trunk/client/src/main/java/org/teiid/client/util/ResultsReceiver.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc:3535-3555*
/trunk/client/src/main/java/org/teiid/jdbc:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc:3535-3555*
/trunk/client/src/main/java/org/teiid/jdbc:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/BaseDataSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/BaseDataSource.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/BaseDataSource.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/BaseDataSource.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/BaseDataSource.java:3507-3666
Modified: branches/as7/client/src/main/java/org/teiid/jdbc/BatchResults.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/BatchResults.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/BatchResults.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -251,8 +251,21 @@
}
requestNextBatch();
}
-
- return (this.currentRowNumber + next <= highestRowNumber);
+ boolean result = this.currentRowNumber + next <= highestRowNumber;
+ if (result && !wait) {
+ for (int i = 0; i < batches.size(); i++) {
+ Batch batch = batches.get(i);
+ if (this.currentRowNumber + next < batch.getBeginRow()) {
+ continue;
+ }
+ if (this.currentRowNumber + next> batch.getEndRow()) {
+ continue;
+ }
+ return Boolean.TRUE;
+ }
+ return null; //needs to be fetched
+ }
+ return result;
}
public int getFinalRowNumber() {
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/BatchResults.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/BatchResults.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/BatchResults.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/BatchResults.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/BatchResults.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java:3149-3217,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java:3149-3217,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java:3188-3450,3452-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/ConnectionListener.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ConnectionListener.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ConnectionListener.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ConnectionListener.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ConnectionListener.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/ConnectionProfile.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ConnectionProfile.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ConnectionProfile.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ConnectionProfile.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ConnectionProfile.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java:3281-3325,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java:3281-3325,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java:3188-3450,3452-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/DeferredMetadataProvider.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/DeferredMetadataProvider.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/DeferredMetadataProvider.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/DeferredMetadataProvider.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/DeferredMetadataProvider.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java:3149-3217,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java:3149-3217,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/EmbeddedProfile.java:3188-3450,3452-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/EnhancedTimer.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/EnhancedTimer.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/EnhancedTimer.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/EnhancedTimer.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/EnhancedTimer.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ExecutionProperties.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/FilteredResultsMetadata.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/FilteredResultsMetadata.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/FilteredResultsMetadata.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/FilteredResultsMetadata.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/FilteredResultsMetadata.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/JDBCColumnNames.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/JDBCColumnNames.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/JDBCColumnNames.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/JDBCColumnNames.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/JDBCColumnNames.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/JDBCColumnPositions.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/JDBCColumnPositions.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/JDBCColumnPositions.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/JDBCColumnPositions.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/JDBCColumnPositions.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/JDBCPlugin.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/JDBCPlugin.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/JDBCPlugin.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/JDBCPlugin.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/JDBCPlugin.java:3507-3666
Modified: branches/as7/client/src/main/java/org/teiid/jdbc/JDBCURL.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/JDBCURL.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/JDBCURL.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -74,7 +74,6 @@
TeiidURL.CONNECTION.AUTO_FAILOVER,
TeiidURL.CONNECTION.DISCOVERY_STRATEGY,
TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION,
- TeiidURL.CONNECTION.AUTHENTICATION_TYPE,
TeiidURL.CONNECTION.JAAS_NAME,
TeiidURL.CONNECTION.KERBEROS_SERVICE_PRINCIPLE_NAME));
props.addAll(EXECUTION_PROPERTIES);
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/JDBCURL.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/JDBCURL.java:3149-3217,3281-3325,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/JDBCURL.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/JDBCURL.java:3149-3217,3281-3325,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/JDBCURL.java:3188-3450,3452-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/MetadataProvider.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/MetadataProvider.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/MetadataProvider.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/MetadataProvider.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/MetadataProvider.java:3507-3666
Copied: branches/as7/client/src/main/java/org/teiid/jdbc/NonBlockingRowProcessor.java (from rev 3666, trunk/client/src/main/java/org/teiid/jdbc/NonBlockingRowProcessor.java)
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/NonBlockingRowProcessor.java (rev 0)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/NonBlockingRowProcessor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.jdbc;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.teiid.client.util.ResultsFuture;
+
+/**
+ * Handles the future processing logic and makes the appropriate calls to the callback
+ */
+public class NonBlockingRowProcessor implements
+ ResultsFuture.CompletionListener<Boolean> {
+
+ private static Logger logger = Logger.getLogger(NonBlockingRowProcessor.class.getName());
+ private StatementImpl stmt;
+ private StatementCallback callback;
+
+ public NonBlockingRowProcessor(StatementImpl stmt, StatementCallback callback) {
+ this.stmt = stmt;
+ this.callback = callback;
+ }
+
+ @Override
+ public void onCompletion(ResultsFuture<Boolean> future) {
+ try {
+ boolean hasResultSet = future.get();
+ if (!hasResultSet) {
+ callback.onComplete(stmt);
+ return;
+ }
+ final ResultSetImpl resultSet = stmt.getResultSet();
+ Runnable rowProcessor = new Runnable() {
+ @Override
+ public void run() {
+ while (true) {
+ try {
+ ResultsFuture<Boolean> hasNext = resultSet.submitNext();
+ synchronized (hasNext) {
+ if (!hasNext.isDone()) {
+ hasNext.addCompletionListener(new ResultsFuture.CompletionListener<Boolean>() {
+
+ @Override
+ public void onCompletion(
+ ResultsFuture<Boolean> f) {
+ if (processRow(f)) {
+ run();
+ }
+ }
+ });
+ break; // will be resumed by onCompletion above
+ }
+ }
+ if (!processRow(hasNext)) {
+ break;
+ }
+ } catch (Exception e) {
+ onException(e);
+ }
+ }
+ }
+ };
+ rowProcessor.run();
+ } catch (Exception e) {
+ onException(e);
+ }
+ }
+
+ /**
+ * return true to continue processing
+ */
+ boolean processRow(ResultsFuture<Boolean> hasNext) {
+ try {
+ if (!hasNext.get()) {
+ callback.onComplete(stmt);
+ return false;
+ }
+
+ callback.onRow(stmt, stmt.getResultSet());
+
+ return true;
+ } catch (Exception e) {
+ onException(e);
+ return false;
+ }
+ }
+
+ private void onException(Exception e) {
+ try {
+ callback.onException(stmt, e);
+ } catch (Exception e1) {
+ logger.log(Level.WARNING, "Unhandled exception from StatementCallback", e); //$NON-NLS-1$
+ }
+ }
+
+}
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/NonBlockingRowProcessor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+ /trunk/client/src/main/java/org/teiid/jdbc/NonBlockingRowProcessor.java:3598-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/ParameterMetaDataImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ParameterMetaDataImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ParameterMetaDataImpl.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ParameterMetaDataImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ParameterMetaDataImpl.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/PartialResultsWarning.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/PartialResultsWarning.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/PartialResultsWarning.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/PartialResultsWarning.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/PartialResultsWarning.java:3507-3666
Modified: branches/as7/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -33,7 +33,6 @@
import java.sql.Clob;
import java.sql.NClob;
import java.sql.ParameterMetaData;
-import java.sql.PreparedStatement;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
@@ -80,7 +79,7 @@
* preparedstatement object.</p>
*/
-public class PreparedStatementImpl extends StatementImpl implements PreparedStatement {
+public class PreparedStatementImpl extends StatementImpl implements TeiidPreparedStatement {
// sql, which this prepared statement is operating on
protected String prepareSql;
@@ -174,6 +173,12 @@
}
@Override
+ public void submitExecute(String sql, StatementCallback callback) throws TeiidSQLException {
+ String msg = JDBCPlugin.Util.getString("JDBC.Method_not_supported"); //$NON-NLS-1$
+ throw new TeiidSQLException(msg);
+ }
+
+ @Override
public ResultSet executeQuery(String sql) throws SQLException {
String msg = JDBCPlugin.Util.getString("JDBC.Method_not_supported"); //$NON-NLS-1$
throw new TeiidSQLException(msg);
@@ -191,6 +196,12 @@
throw new TeiidSQLException(msg);
}
+ @Override
+ public void submitExecute(StatementCallback callback) throws SQLException {
+ NonBlockingRowProcessor processor = new NonBlockingRowProcessor(this, callback);
+ submitExecute(ResultsMode.EITHER).addCompletionListener(processor);
+ }
+
public ResultsFuture<Boolean> submitExecute(ResultsMode mode) throws SQLException {
return executeSql(new String[] {this.prepareSql}, false, mode, false);
}
@@ -275,13 +286,6 @@
setAsciiStream(parameterIndex, in);
}
- /**
- * <p>Sets the IN parameter at paramaterIndex to a BigDecimal object. The parameter
- * type is set to NUMERIC
- * @param parameterIndex of the parameter whose value is to be set
- * @param BigDecimal object to which the parameter value is to be set.
- * @throws SQLException, should not occur
- */
public void setBigDecimal (int parameterIndex, java.math.BigDecimal value) throws SQLException {
setObject(parameterIndex, value);
}
@@ -290,43 +294,18 @@
setBlob(parameterIndex, in);
}
- /**
- * <p>Sets the parameter in position parameterIndex to a Blob object.
- * @param parameterIndex of the parameter whose value is to be set
- * @param Blob object to which the parameter value is to be set.
- * @throws SQLException if parameter type/datatype do not match
- */
public void setBlob (int parameterIndex, Blob x) throws SQLException {
setObject(parameterIndex, x);
}
- /**
- * <p>Sets parameter number parameterIndex to b, a Java boolean value. The parameter
- * type is set to BIT
- * @param parameterIndex of the parameter whose value is to be set
- * @param boolean value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setBoolean (int parameterIndex, boolean value) throws SQLException {
setObject(parameterIndex, value);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a Java byte value. The parameter
- * type is set to TINYINT
- * @param parameterIndex of the parameter whose value is to be set
- * @param byte value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setByte(int parameterIndex, byte value) throws SQLException {
setObject(parameterIndex, Byte.valueOf(value));
}
- /**
- * <p>Sets parameter number parameterIndex to x[], a Java array of bytes.
- * @param parameterIndex of the parameter whose value is to be set
- * @param bytes array to which the parameter value is to be set.
- */
public void setBytes(int parameterIndex, byte bytes[]) throws SQLException {
setObject(parameterIndex, new SerialBlob(bytes));
}
@@ -335,35 +314,14 @@
setCharacterStream(parameterIndex, reader);
}
- /**
- * <p>Sets the parameter in position parameterIndex to a Clob object.
- * @param parameterIndex of the parameter whose value is to be set
- * @param Clob object to which the parameter value is to be set.
- * @throws SQLException if parameter type/datatype do not match.
- */
public void setClob (int parameterIndex, Clob x) throws SQLException {
setObject(parameterIndex, x);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Date object. The parameter
- * type is set to DATE
- * @param parameterIndex of the parameter whose value is to be set
- * @param Date object to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setDate(int parameterIndex, java.sql.Date value) throws SQLException {
setDate(parameterIndex, value, null);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Date object. The parameter
- * type is set to DATE
- * @param parameterIndex of the parameter whose value is to be set
- * @param Date object to which the parameter value is to be set.
- * @param Calendar object to constrct date(useful to get include timezone info)
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setDate(int parameterIndex, java.sql.Date x ,java.util.Calendar cal) throws SQLException {
if (cal == null || x == null) {
@@ -375,79 +333,30 @@
setObject(parameterIndex, TimestampWithTimezone.createDate(x, cal.getTimeZone(), getDefaultCalendar()));
}
- /**
- * <p>Sets parameter number parameterIndex to x, a double value. The parameter
- * type is set to DOUBLE
- * @param parameterIndex of the parameter whose value is to be set
- * @param double value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setDouble(int parameterIndex, double value) throws SQLException {
setObject(parameterIndex, new Double(value));
}
- /**
- * <p>Sets parameter number parameterIndex to value, a float value. The parameter
- * type is set to FLOAT
- * @param parameterIndex of the parameter whose value is to be set
- * @param float value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setFloat(int parameterIndex, float value) throws SQLException {
setObject(parameterIndex, new Float(value));
}
- /**
- * <p>Sets parameter number parameterIndex to value, a int value. The parameter
- * type is set to INTEGER
- * @param parameterIndex of the parameter whose value is to be set
- * @param int value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setInt(int parameterIndex, int value) throws SQLException {
setObject(parameterIndex, Integer.valueOf(value));
}
- /**
- * <p>Sets parameter number parameterIndex to x, a long value. The parameter
- * type is set to BIGINT
- * @param parameterIndex of the parameter whose value is to be set
- * @param long value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setLong(int parameterIndex, long value) throws SQLException {
setObject(parameterIndex, Long.valueOf(value));
}
- /**
- * <p>Sets parameter number parameterIndex to a null value.
- * @param parameterIndex of the parameter whose value is to be set
- * @param jdbc type of the parameter whose value is to be set to null
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setNull(int parameterIndex, int jdbcType) throws SQLException {
setObject(parameterIndex, null);
}
- /**
- * <p>Sets parameter number parameterIndex to a null value.
- * @param parameterIndex of the parameter whose value is to be set
- * @param jdbc type of the parameter whose value is to be set to null
- * @param fully qualifies typename of the parameter being set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setNull(int parameterIndex, int jdbcType, String typeName) throws SQLException {
setObject(parameterIndex, null);
}
- /**
- * <p>Sets parameter number parameterIndex to an object value
- * @param parameterIndex of the parameter whose value is to be set
- * @param an object value to which the parameter value is to be set.
- * @param int value giving the JDBC type to conver the object to
- * @param int value giving the scale to be set if the type is DECIMAL or NUMERIC
- * @throws SQLException, if there is an error setting the parameter value
- */
public void setObject (int parameterIndex, Object value, int targetJdbcType, int scale) throws SQLException {
if(value == null) {
@@ -516,12 +425,6 @@
setObject(parameterIndex, targetObject);
}
- /**
- * <p>Sets parameter number parameterIndex to an object value
- * @param parameterIndex of the parameter whose value is to be set
- * @param an object value to which the parameter value is to be set.
- * @throws SQLException, if there is an error setting the parameter value
- */
public void setObject(int parameterIndex, Object value) throws SQLException {
ArgCheck.isPositive(parameterIndex, JDBCPlugin.Util.getString("MMPreparedStatement.Invalid_param_index")); //$NON-NLS-1$
@@ -535,47 +438,18 @@
parameterMap.put(parameterIndex, value);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a short value. The parameter
- * type is set to TINYINT
- * @param parameterIndex of the parameter whose value is to be set
- * @param short value to which the parameter value is to be set.
- * @throws SQLException, if there is an error setting the parameter value
- */
public void setShort(int parameterIndex, short value) throws SQLException {
setObject(parameterIndex, value);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a String value. The parameter
- * type is set to VARCHAR
- * @param parameterIndex of the parameter whose value is to be set
- * @param String object to which the parameter value is to be set.
- * @throws SQLException
- */
public void setString(int parameterIndex, String value) throws SQLException {
setObject(parameterIndex, value);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Time object. The parameter
- * type is set to TIME
- * @param parameterIndex of the parameter whose value is to be set
- * @param Time object to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setTime(int parameterIndex, java.sql.Time value) throws SQLException {
setTime(parameterIndex, value, null);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Time object. The parameter
- * type is set to TIME
- * @param parameterIndex of the parameter whose value is to be set
- * @param Time object to which the parameter value is to be set.
- * @param Calendar object to constrct Time(useful to get include timezone info)
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal) throws SQLException {
if (cal == null || x == null) {
@@ -587,25 +461,10 @@
setObject(parameterIndex, TimestampWithTimezone.createTime(x, cal.getTimeZone(), getDefaultCalendar()));
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Timestamp object. The
- * parameter type is set to TIMESTAMP
- * @param parameterIndex of the parameter whose value is to be set
- * @param Timestamp object to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setTimestamp(int parameterIndex, java.sql.Timestamp value) throws SQLException {
setTimestamp(parameterIndex, value, null);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Timestamp object. The
- * parameter type is set to TIMESTAMP
- * @param parameterIndex of the parameter whose value is to be set
- * @param Timestamp object to which the parameter value is to be set.
- * @param Calendar object to constrct timestamp(useful to get include timezone info)
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal) throws SQLException {
if (cal == null || x == null) {
@@ -617,13 +476,6 @@
setObject(parameterIndex, TimestampWithTimezone.createTimestamp(x, cal.getTimeZone(), getDefaultCalendar()));
}
- /**
- * Sets the designated parameter to the given java.net.URL value. The driver
- * converts this to an SQL DATALINK value when it sends it to the database.
- * @param parameter int index
- * @param x URL to be set
- * @throws SQLException
- */
public void setURL(int parameterIndex, URL x) throws SQLException {
setObject(parameterIndex, x);
}
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java:3507-3666
Modified: branches/as7/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -238,7 +238,7 @@
if (hasNext != null) {
return StatementImpl.booleanFuture(next());
}
- ResultsFuture<ResultsMessage> pendingResult = submitRequestBatch(batchResults.getHighestRowNumber() + 1);
+ ResultsFuture<ResultsMessage> pendingResult = submitRequestBatch(batchResults.getCurrentRowNumber() + 1);
final ResultsFuture<Boolean> result = new ResultsFuture<Boolean>();
pendingResult.addCompletionListener(new ResultsFuture.CompletionListener<ResultsMessage>() {
@Override
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/ResultSetMetaDataImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ResultSetMetaDataImpl.java:3281-3325,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ResultSetMetaDataImpl.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/ResultSetMetaDataImpl.java:3281-3325,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/ResultSetMetaDataImpl.java:3188-3450,3452-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/SQLStates.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/SQLStates.java:3220-3275,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/SQLStates.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/SQLStates.java:3220-3275,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/SQLStates.java:3188-3450,3452-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/SocketProfile.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/SocketProfile.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/SocketProfile.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/SocketProfile.java:3507-3666
Copied: branches/as7/client/src/main/java/org/teiid/jdbc/StatementCallback.java (from rev 3666, trunk/client/src/main/java/org/teiid/jdbc/StatementCallback.java)
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/StatementCallback.java (rev 0)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/StatementCallback.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.jdbc;
+
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ * A callback for non-blocking statement result processing.
+ * {@link Statement#close()} must still be called to release
+ * statement resources.
+ *
+ * Statement methods, such as cancel, are perfectly valid
+ * even when using a callback.
+ */
+public interface StatementCallback {
+
+ /**
+ * Process the current row of the {@link ResultSet}.
+ * Any call that retrieves non-lob values from the current row
+ * will be performed without blocking on more data from sources.
+ * Calls outside of the current row, such as next(), may block.
+ * @param rs
+ * @throws Exception
+ */
+ void onRow(Statement s, ResultSet rs) throws Exception;
+
+ /**
+ * Called when an exception occurs. No further rows will
+ * be processed by this callback.
+ * @param e
+ */
+ void onException(Statement s, Exception e) throws Exception;
+
+ /**
+ * Called when processing has completed normally.
+ * @param rs
+ */
+ void onComplete(Statement s) throws Exception;
+
+}
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/StatementCallback.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+ /trunk/client/src/main/java/org/teiid/jdbc/StatementCallback.java:3598-3666
Modified: branches/as7/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -307,6 +307,12 @@
}
}
+ @Override
+ public void submitExecute(String sql, StatementCallback callback) throws SQLException {
+ NonBlockingRowProcessor processor = new NonBlockingRowProcessor(this, callback);
+ submitExecute(sql).addCompletionListener(processor);
+ }
+
public ResultsFuture<Boolean> submitExecute(String sql) throws SQLException {
return executeSql(new String[] {sql}, false, ResultsMode.EITHER, false);
}
@@ -649,55 +655,22 @@
return reqMessage;
}
- /**
- * Retreives the fetch direction this Statement object set as a performance hint
- * to the driver. The int returned will be one of the following constants from
- * the ResultSet interface: FETCH_FORWARD, FETCH_REVERSE, or FETCH_UNKNOWN.
- * @return int value indicating the direction in which results need to be fetched
- * @throws SQLException should never occur.
- */
public int getFetchDirection() throws SQLException {
return this.fetchDirection;
}
- /**
- * Retreives the fetch size this Statement object set as a performance hint
- * to the driver. This is the number of rows the server fetches at a time when
- * the result set needs more rows.
- * @return int value indicating the number of rows the server fetches
- * @throws SQLException should never occur.
- */
public int getFetchSize() throws SQLException {
return fetchSize;
}
- /**
- * Retreives the maximum number of bytes that a result set column may contain.
- * @return int value giving the maximum size of a field
- * @throws SQLException should never occur.
- */
public int getMaxFieldSize() throws SQLException {
return maxFieldSize;
}
- /**
- * Retrives the maximum number of rows that a ResultSet object may contain.
- * If the limit is exceeded the excess rows are dropped.
- * @return Max limit on rows on ResultSet.
- * @throws SQLException should never iccure.
- */
public int getMaxRows() throws SQLException {
return maxRows;
}
- /**
- * Moves to this Statement object's next result, returns true if
- * it is a ResultSet object, and implicitly closes any current
- * ResultSet object(s) obtained with the method #getResultSet.
- * @return true if the next result is a ResultSet object;
- * false if it is an update count or there are no more results
- * @throws SQLException if there is an error in database.
- */
public boolean getMoreResults() throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
@@ -713,17 +686,6 @@
return false;
}
- /**
- * Moves to this Statement object's next result, deals with any current
- * ResultSet object(s) according to the instructions specified by the
- * given flag, and returns true if the next result is a ResultSet object.
- * @param current flag that gives instruction on what should happen
- * to current ResultSet objects obtained using the method getResultSet(
- * CLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT, or CLOSE_ALL_RESULTS).
- * @return true if the next result is a ResultSet object; false if it
- * is an update count or there are no more results
- * @throws SQLException if there is an error in database.
- */
public boolean getMoreResults(int current) throws SQLException {
checkStatement();
@@ -742,26 +704,12 @@
return false;
}
-
- /**
- * Return the number of seconds the driver will wait for a statement object
- * to execute
- * @return int value giving the query timeout in seconds
- * @throws SQLException should never occur
- */
public int getQueryTimeout() throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
return (int)this.queryTimeoutMS/1000;
}
- /**
- * Returns a ResultSet object that was produced by a call to the method execute.
- * We currently do not support execute method which could return multiple result
- * sets.
- * @return ResultSet object giving the next available ResultSet
- * @throws SQLException should never occur
- */
public ResultSetImpl getResultSet() throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
@@ -771,32 +719,14 @@
return resultSet;
}
- /**
- * Retrieves the concurrency mode for the ResultSet objects generated from
- * queries that this Statement object executes. All ResultSets are currently
- * read only.
- * @return intvalue giving the ResultSet concurrency
- * @throws SQLException should never occur
- */
public int getResultSetConcurrency() throws SQLException {
return this.resultSetConcurrency;
}
- /**
- * Retrieves the type of the ResultSet objects generated from queries that this
- * statement executes.
- * @return int value indicating the type of the ResultSet
- * @throws SQLException should never occur
- */
public int getResultSetType() {
return this.resultSetType;
}
- /**
- * This method returns the number of rows affected by a statement modifying a table.
- * @return Number of rows affected.
- * @throws SQLException should never occur
- */
public int getUpdateCount() throws SQLException {
checkStatement();
if (this.updateCounts == null) {
@@ -815,11 +745,6 @@
this.serverWarnings.addAll(serverWarnings);
}
- /**
- * This method returns warnings returned by server.
- * @return null value as there are no warnings
- * @throws SQLException should never occur
- */
public SQLWarning getWarnings() throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
@@ -830,13 +755,6 @@
return null;
}
- /**
- * This method enbles/disables escape processing. When escape processing is
- * enabled the driver will scan any escape syntax and do escape substitution
- * before sending the escaped sql statement to the server
- * @param enable boolean value indicating if the escape processing should be turned on
- * @throws SQLException should never occur
- */
public void setEscapeProcessing(boolean enable) throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
@@ -862,24 +780,12 @@
}
}
- /**
- * Sets the limit on the maximum number of rows in a ResultSet object. This
- * method is currently implemented to throw an exception as it is not possible
- * to limit the number of rows.
- * @param maxRows int value indicating maximum rows that can be returned in a ResultSet
- */
public void setMaxRows(int maxRows) throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
this.maxRows = maxRows;
}
- /**
- * This sets to seconds the time limit for the number of seconds for a driver
- * to wait for a statement object to be executed.
- * @param seconds Maximum number of seconds for a statement object to execute.
- * throws SQLException, should never occur
- */
public void setQueryTimeout(int seconds) throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
@@ -979,20 +885,6 @@
}
}
- /**
- * Set the per-statement security payload. This optional payload will
- * accompany each request to the data source(s) so that the connector
- * will have access to it.
- * <br>Once the payload is set, it will be used for each statment
- * execution until it is set to <code>null</code>, a new payload is set on
- * the statement or the statement is closed.</br>
- *
- * <p>To remove an existing payload from a statement, call this method
- * with a <code>null</code> argument.</p>
- * @param payload The payload that is to accompany requests executed
- * from this statement.
- * @since 4.2
- */
public void setPayload(Serializable payload) {
this.payload = payload;
}
@@ -1009,15 +901,6 @@
return this.currentRequestID;
}
- /**
- * Get Query plan description.
- * If the Statement has a resultSet, we get the plan description from the result set
- * If that plan description is null, though, we return the very first plan description
- * that was created from the resultsMessage in the method: setAnalysisInfo.
- * The plan description from the result set can be null if the resultsMsg stored in the
- * result set hasn't been created when getPlanDescription is called.
- * @return Query plan description, if it exists, otherwise null
- */
public PlanNode getPlanDescription() {
if(this.resultSet != null) {
return this.resultSet.getUpdatedPlanDescription();
@@ -1028,18 +911,10 @@
return null;
}
- /**
- * Get query planner debug log.
- * @return Query planner debug log, or null if it doesn't exist
- */
public String getDebugLog() {
return this.debugLog;
}
- /**
- * Get annotations
- * @return Query planner annotations - Collection of Annotation
- */
public Collection<Annotation> getAnnotations() {
return this.annotations;
}
@@ -1051,10 +926,6 @@
return null;
}
- /**
- * Check is the statement is closed. Used primarily by the unit tests.
- * @return true if the statement is closed; false otherwise.
- */
public boolean isClosed() {
return this.isClosed;
}
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/StatementImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java:3149-3217,3220-3275,3281-3325,3355-3365,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java:3149-3217,3220-3275,3281-3325,3355-3365,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java:3188-3450,3452-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/TeiidConnection.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/TeiidConnection.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/TeiidConnection.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/TeiidConnection.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/TeiidConnection.java:3507-3666
Modified: branches/as7/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -99,11 +99,6 @@
private boolean passthroughAuthentication = false;
/**
- * Authentication type to used from client. choices are simple - which is plain user/password; krb5 - kerberos
- */
- private String authenticationType;
-
- /**
* Name of the jass configuration to use from the -Djava.security.auth.login.config=login.conf property
*/
private String jaasName;
@@ -258,9 +253,6 @@
Properties props = buildProperties(userName, password);
props.setProperty(TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION, Boolean.toString(this.passthroughAuthentication));
- if (getAuthenticationType() != null) {
- props.setProperty(TeiidURL.CONNECTION.AUTHENTICATION_TYPE, getAuthenticationType());
- }
if (getJaasName() != null) {
props.setProperty(TeiidURL.CONNECTION.JAAS_NAME, getJaasName());
}
@@ -492,24 +484,7 @@
this.passthroughAuthentication = passthroughAuthentication;
}
- /**
- * Authentication Type {simple, krb5} default:simple
- * @return
- */
- public String getAuthenticationType() {
- return authenticationType;
- }
-
/**
- * Authentication Type.
- * @since 7.6
- * @return
- */
- public void setAuthenticationType(final String authType) {
- this.authenticationType = authType;
- }
-
- /**
* Application name from JAAS Login Config file
* @since 7.6
* @return
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/TeiidDataSource.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/TeiidDriver.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/TeiidDriver.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/TeiidDriver.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/TeiidDriver.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/TeiidDriver.java:3507-3666
Copied: branches/as7/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java (from rev 3666, trunk/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java)
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java (rev 0)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.jdbc;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+/**
+ * This interface provides methods in
+ * addition to the standard JDBC methods.
+ */
+public interface TeiidPreparedStatement extends PreparedStatement {
+
+ /**
+ * Execute the given statement using a non-blocking callback.
+ * This method is only valid for use with embedded connections.
+ * @param callback
+ * @throws SQLException
+ */
+ void submitExecute(StatementCallback callback) throws SQLException;
+
+}
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+ /trunk/client/src/main/java/org/teiid/jdbc/TeiidPreparedStatement.java:3598-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/TeiidSQLException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/TeiidSQLException.java:3220-3275,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/TeiidSQLException.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/TeiidSQLException.java:3220-3275,3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/TeiidSQLException.java:3188-3450,3452-3666
Copied: branches/as7/client/src/main/java/org/teiid/jdbc/TeiidSQLWarning.java (from rev 3666, trunk/client/src/main/java/org/teiid/jdbc/TeiidSQLWarning.java)
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/TeiidSQLWarning.java (rev 0)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/TeiidSQLWarning.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.jdbc;
+
+import java.sql.SQLWarning;
+
+
+/**
+ * Teiid specific SQLWarning
+ */
+
+public class TeiidSQLWarning extends SQLWarning {
+
+ private String modelName = "UNKNOWN"; // variable stores the name of the model for the atomic query //$NON-NLS-1$
+ private String sourceName = "UNKNOWN"; // variable stores name of the connector binding //$NON-NLS-1$
+
+ public TeiidSQLWarning() {
+ super();
+ }
+
+ public TeiidSQLWarning(String reason) {
+ super(reason);
+ }
+
+ public TeiidSQLWarning(String reason, String state) {
+ super(reason, state);
+ }
+
+ public TeiidSQLWarning(String reason, String sqlState, Throwable ex, String sourceName, String modelName) {
+ super(reason, sqlState, ex);
+ this.sourceName = sourceName;
+ this.modelName = modelName;
+ }
+
+ /**
+ *
+ * @return the source name or null if the warning is not associated with a source
+ */
+ public String getSourceName() {
+ return sourceName;
+ }
+
+ /**
+ *
+ * @return the model name or null if the warning is not associated with a model
+ */
+ public String getModelName() {
+ return modelName;
+ }
+
+}
\ No newline at end of file
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/TeiidSQLWarning.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+ /trunk/client/src/main/java/org/teiid/jdbc/TeiidSQLWarning.java:3598-3666
Modified: branches/as7/client/src/main/java/org/teiid/jdbc/TeiidStatement.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/TeiidStatement.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/TeiidStatement.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -23,6 +23,7 @@
package org.teiid.jdbc;
import java.io.Serializable;
+import java.sql.SQLException;
import java.util.Collection;
import org.teiid.client.plan.Annotation;
@@ -99,4 +100,12 @@
* @since 4.2
*/
void setPayload(Serializable payload);
+
+ /**
+ * Execute the given statement using a non-blocking callback.
+ * This method is only valid for use with embedded connections.
+ * @param callback
+ * @throws SQLException
+ */
+ void submitExecute(String sql, StatementCallback callback) throws SQLException;
}
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/TeiidStatement.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/TeiidStatement.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/TeiidStatement.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/TeiidStatement.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/TeiidStatement.java:3507-3666
Modified: branches/as7/client/src/main/java/org/teiid/jdbc/WarningUtil.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/jdbc/WarningUtil.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/jdbc/WarningUtil.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -26,6 +26,7 @@
import java.util.List;
import org.teiid.client.SourceWarning;
+import org.teiid.core.TeiidException;
@@ -44,6 +45,8 @@
* @param ex Throwable object which needs to be wrapped.
*/
static SQLWarning createWarning(Throwable ex) {
+ String sourceName = null;
+ String modelName = null;
if(ex instanceof SourceWarning) {
SourceWarning exception = (SourceWarning)ex;
if (exception.isPartialResultsError()) {
@@ -51,8 +54,15 @@
warning.addConnectorFailure(exception.getConnectorBindingName(), TeiidSQLException.create(exception));
return warning;
}
+ ex = exception.getCause();
+ sourceName = exception.getConnectorBindingName();
+ modelName = exception.getModelName();
}
- return new SQLWarning(ex);
+ String code = null;
+ if (ex instanceof TeiidException) {
+ code = ((TeiidException)ex).getCode();
+ }
+ return new TeiidSQLWarning(ex.getMessage(), code, ex, sourceName, modelName);
}
/**
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/WarningUtil.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/WarningUtil.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/WarningUtil.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/WrapperImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/WrapperImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/WrapperImpl.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/WrapperImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/WrapperImpl.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/jdbc/XAResourceImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/XAResourceImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/XAResourceImpl.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/XAResourceImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/jdbc/XAResourceImpl.java:3507-3666
Modified: branches/as7/client/src/main/java/org/teiid/net/TeiidURL.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/net/TeiidURL.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/net/TeiidURL.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -81,15 +81,9 @@
public static final String PASSTHROUGH_AUTHENTICATION = "PassthroughAuthentication"; //$NON-NLS-1$
- public static final String AUTHENTICATION_TYPE = "authenticationType"; //$NON-NLS-1$
-
public static final String JAAS_NAME = "jaasName"; //$NON-NLS-1$
- public static final String KERBEROS_SERVICE_PRINCIPLE_NAME = "kerberosServicePrincipleName"; //$NON-NLS-1$
-
- public enum AuthenticationType {
- CLEARTEXT,KRB5
- };
+ public static final String KERBEROS_SERVICE_PRINCIPLE_NAME = "kerberosServicePrincipleName"; //$NON-NLS-1$;
}
public static final String DOT_DELIMITER = "."; //$NON-NLS-1$
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket:3535-3555*
/trunk/client/src/main/java/org/teiid/net/socket:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket:3535-3555*
/trunk/client/src/main/java/org/teiid/net/socket:3507-3666
Copied: branches/as7/client/src/main/java/org/teiid/net/socket/AuthenticationType.java (from rev 3666, trunk/client/src/main/java/org/teiid/net/socket/AuthenticationType.java)
===================================================================
--- branches/as7/client/src/main/java/org/teiid/net/socket/AuthenticationType.java (rev 0)
+++ branches/as7/client/src/main/java/org/teiid/net/socket/AuthenticationType.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,27 @@
+/*
+ * 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.net.socket;
+
+public enum AuthenticationType {
+ CLEARTEXT,GSS
+}
\ No newline at end of file
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/AuthenticationType.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+ /trunk/client/src/main/java/org/teiid/net/socket/AuthenticationType.java:3598-3666
Modified: branches/as7/client/src/main/java/org/teiid/net/socket/Handshake.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/net/socket/Handshake.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/net/socket/Handshake.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -26,6 +26,7 @@
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
+import java.io.OptionalDataException;
import org.teiid.core.util.ApplicationInfo;
@@ -39,6 +40,7 @@
private String version = ApplicationInfo.getInstance().getReleaseNumber();
private byte[] publicKey;
+ private AuthenticationType authType = AuthenticationType.CLEARTEXT;
/**
* @return Returns the version.
@@ -68,17 +70,31 @@
this.publicKey = key;
}
+ public AuthenticationType getAuthType() {
+ return authType;
+ }
+
+ public void setAuthType(AuthenticationType authType) {
+ this.authType = authType;
+ }
+
@Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
version = (String)in.readObject();
publicKey = (byte[])in.readObject();
+ try {
+ authType = AuthenticationType.values()[in.readByte()];
+ } catch (OptionalDataException e) {
+
+ }
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject(version);
out.writeObject(publicKey);
+ out.writeByte(authType.ordinal());
}
}
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/Handshake.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/Handshake.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/Handshake.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/Handshake.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/Handshake.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/Message.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/Message.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/Message.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/Message.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/Message.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/ObjectChannel.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/ObjectChannel.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/ObjectChannel.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/ObjectChannel.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/ObjectChannel.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/ObjectChannelFactory.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/ObjectChannelFactory.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/ObjectChannelFactory.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/ObjectChannelFactory.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/ObjectChannelFactory.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/ServerDiscovery.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/SingleInstanceCommunicationException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SingleInstanceCommunicationException.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SingleInstanceCommunicationException.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SingleInstanceCommunicationException.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SingleInstanceCommunicationException.java:3507-3666
Modified: branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -56,7 +56,6 @@
import org.teiid.net.HostInfo;
import org.teiid.net.ServerConnection;
import org.teiid.net.TeiidURL;
-import org.teiid.net.TeiidURL.CONNECTION.AuthenticationType;
/**
@@ -171,11 +170,11 @@
SocketServerInstance instance = this.serverInstance;
LogonResult newResult = null;
- AuthenticationType authType = getAuthenticationType();
+ AuthenticationType authType = instance.getAuthenticationType();
if (AuthenticationType.CLEARTEXT.equals(authType)) {
newResult = newLogon.logon(connProps);
}
- else if (AuthenticationType.KRB5.equals(authType)) {
+ else if (AuthenticationType.GSS.equals(authType)) {
newResult = MakeGSS.authenticate(newLogon, connProps);
}
@@ -193,14 +192,6 @@
this.connectionFactory.connected(instance, this.logonResult.getSessionToken());
}
- private AuthenticationType getAuthenticationType() {
- String authStr = this.connProps.getProperty(TeiidURL.CONNECTION.AUTHENTICATION_TYPE);
- if (authStr == null) {
- return AuthenticationType.CLEARTEXT;
- }
- return AuthenticationType.valueOf(authStr);
- }
-
private ILogon connect(HostInfo hostInfo) throws CommunicationException,
IOException {
hostInfo.setSsl(secure);
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java:3149-3217,3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java:3149-3217,3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java:3188-3450,3452-3666
Modified: branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -53,4 +53,6 @@
String getServerVersion();
+ AuthenticationType getAuthenticationType();
+
}
\ No newline at end of file
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstance.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceFactory.java:3507-3666
Modified: branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
===================================================================
--- branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -76,6 +76,7 @@
private ObjectChannel socketChannel;
private Cryptor cryptor;
private String serverVersion;
+ private AuthenticationType authType = AuthenticationType.CLEARTEXT;
private boolean hasReader;
@@ -130,6 +131,7 @@
throw new CommunicationException(NetPlugin.Util.getString("SocketServerInstanceImpl.version_mismatch", getVersionInfo(), handshake.getVersion())); //$NON-NLS-1$
}*/
serverVersion = handshake.getVersion();
+ authType = handshake.getAuthType();
handshake.setVersion();
byte[] serverPublicKey = handshake.getPublicKey();
@@ -369,4 +371,9 @@
}
+ @Override
+ public AuthenticationType getAuthenticationType() {
+ return authType;
+ }
+
}
\ No newline at end of file
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/SocketUtil.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketUtil.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/SocketUtil.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java:3507-3666
Property changes on: branches/as7/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java:3507-3597
+ /branches/7.4.x/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java:3535-3555
/trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java:3507-3666
Property changes on: branches/as7/client/src/main/resources/org
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/resources/org:3535-3555*
/trunk/client/src/main/resources/org:3507-3597
+ /branches/7.4.x/client/src/main/resources/org:3535-3555*
/trunk/client/src/main/resources/org:3507-3666
Property changes on: branches/as7/client/src/main/resources/org/teiid
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/resources/org/teiid:3535-3555*
/trunk/client/src/main/resources/org/teiid:3507-3597
+ /branches/7.4.x/client/src/main/resources/org/teiid:3535-3555*
/trunk/client/src/main/resources/org/teiid:3507-3666
Property changes on: branches/as7/client/src/main/resources/org/teiid/jdbc
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/resources/org/teiid/jdbc:3535-3555
/trunk/client/src/main/resources/org/teiid/jdbc:3507-3597
+ /branches/7.4.x/client/src/main/resources/org/teiid/jdbc:3535-3555
/trunk/client/src/main/resources/org/teiid/jdbc:3507-3666
Property changes on: branches/as7/client/src/main/resources/org/teiid/net
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/resources/org/teiid/net:3535-3555*
/trunk/client/src/main/resources/org/teiid/net:3507-3597
+ /branches/7.4.x/client/src/main/resources/org/teiid/net:3535-3555*
/trunk/client/src/main/resources/org/teiid/net:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/client/plan
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/client/plan:3535-3555*
/trunk/client/src/test/java/org/teiid/client/plan:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/client/plan:3535-3555*
/trunk/client/src/test/java/org/teiid/client/plan:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/client/plan/TestPlanNode.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/client/plan/TestPlanNode.java:3535-3555
/trunk/client/src/test/java/org/teiid/client/plan/TestPlanNode.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/client/plan/TestPlanNode.java:3535-3555
/trunk/client/src/test/java/org/teiid/client/plan/TestPlanNode.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/client/util
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/client/util:3535-3555*
/trunk/client/src/test/java/org/teiid/client/util:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/client/util:3535-3555*
/trunk/client/src/test/java/org/teiid/client/util:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java:3535-3555
/trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java:3535-3555
/trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/client/util/TestResultsFuture.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/client/util/TestResultsFuture.java:3535-3555
/trunk/client/src/test/java/org/teiid/client/util/TestResultsFuture.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/client/util/TestResultsFuture.java:3535-3555
/trunk/client/src/test/java/org/teiid/client/util/TestResultsFuture.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc:3535-3555*
/trunk/client/src/test/java/org/teiid/jdbc:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc:3535-3555*
/trunk/client/src/test/java/org/teiid/jdbc:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestAllResultsImpl.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestBatchResults.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestBatchResults.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestBatchResults.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestBatchResults.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestBatchResults.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestCallableStatement.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestCallableStatement.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestCallableStatement.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestCallableStatement.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestCallableStatement.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestConnection.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestConnection.java:3281-3325,3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestConnection.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestConnection.java:3281-3325,3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestConnection.java:3188-3450,3452-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestDataTypeTransformer.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestDataTypeTransformer.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestDataTypeTransformer.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestDataTypeTransformer.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestDataTypeTransformer.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestEnhancedTimer.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestEnhancedTimer.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestEnhancedTimer.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestEnhancedTimer.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestEnhancedTimer.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestJDBCURL.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestJDBCURL.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestJDBCURL.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestJDBCURL.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestJDBCURL.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestPreparedStatement.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestPreparedStatement.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestPreparedStatement.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestPreparedStatement.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestPreparedStatement.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestResultSet.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestResultSet.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestResultSet.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestResultSet.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestResultSet.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestSQLException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestSQLException.java:3220-3275,3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestSQLException.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestSQLException.java:3220-3275,3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestSQLException.java:3188-3450,3452-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestSocketProfile.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestStatement.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestStatement.java:3149-3217,3220-3275,3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestStatement.java:3149-3217,3220-3275,3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java:3188-3450,3452-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDataSource.java:3507-3666
Modified: branches/as7/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java
===================================================================
--- branches/as7/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -138,7 +138,7 @@
@Test public void testGetPropertyInfo1() throws Exception {
DriverPropertyInfo info[] = drv.getPropertyInfo("jdbc:teiid:vdb@mm://localhost:12345;applicationName=x", null); //$NON-NLS-1$
- assertEquals(24, info.length);
+ assertEquals(23, info.length);
assertEquals(false, info[0].required);
assertEquals("ApplicationName", info[0].name); //$NON-NLS-1$
assertEquals("x", info[0].value); //$NON-NLS-1$
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java:3149-3217,3281-3325,3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java:3188-3450,3452-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java:3149-3217,3281-3325,3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestTeiidDriver.java:3188-3450,3452-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/TestXAConnection.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestXAConnection.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestXAConnection.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/TestXAConnection.java:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/TestXAConnection.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/jdbc/util
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/jdbc/util:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/util:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/jdbc/util:3535-3555
/trunk/client/src/test/java/org/teiid/jdbc/util:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/net
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/net:3535-3555*
/trunk/client/src/test/java/org/teiid/net:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/net:3535-3555*
/trunk/client/src/test/java/org/teiid/net:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/net/TestTeiidURL.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/net/TestTeiidURL.java:3535-3555
/trunk/client/src/test/java/org/teiid/net/TestTeiidURL.java:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/net/TestTeiidURL.java:3535-3555
/trunk/client/src/test/java/org/teiid/net/TestTeiidURL.java:3507-3666
Property changes on: branches/as7/client/src/test/java/org/teiid/net/socket
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/test/java/org/teiid/net/socket:3535-3555
/trunk/client/src/test/java/org/teiid/net/socket:3507-3597
+ /branches/7.4.x/client/src/test/java/org/teiid/net/socket:3535-3555
/trunk/client/src/test/java/org/teiid/net/socket:3507-3666
Modified: branches/as7/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java
===================================================================
--- branches/as7/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -213,6 +213,7 @@
Mockito.stub(instance.getHostInfo()).toReturn(hostInfo);
Mockito.stub(instance.getService(ILogon.class)).toReturn(logon);
Mockito.stub(instance.getServerVersion()).toReturn("7.3");
+ Mockito.stub(instance.getAuthenticationType()).toReturn(AuthenticationType.CLEARTEXT);
if (t != null) {
try {
Mockito.doAnswer(new Answer<Void>() {
Modified: branches/as7/client-jdk15/pom.xml
===================================================================
--- branches/as7/client-jdk15/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/client-jdk15/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client-jdk15</artifactId>
Modified: branches/as7/common-core/pom.xml
===================================================================
--- branches/as7/common-core/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/common-core/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-common-core</artifactId>
Property changes on: branches/as7/common-core/src/main/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org:3535-3555*
/trunk/common-core/src/main/java/org:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org:3535-3555*
/trunk/common-core/src/main/java/org:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid:3535-3555*
/trunk/common-core/src/main/java/org/teiid:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid:3535-3555*
/trunk/common-core/src/main/java/org/teiid:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core:3535-3555*
/trunk/common-core/src/main/java/org/teiid/core:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core:3535-3555*
/trunk/common-core/src/main/java/org/teiid/core:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/BundleUtil.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/BundleUtil.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/BundleUtil.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/BundleUtil.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/BundleUtil.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/ComponentNotFoundException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/ComponentNotFoundException.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/ComponentNotFoundException.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/ComponentNotFoundException.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/ComponentNotFoundException.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/CoreConstants.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/CoreConstants.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/CoreConstants.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/CoreConstants.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/CoreConstants.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/CorePlugin.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/CorePlugin.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/CorePlugin.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/CorePlugin.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/CorePlugin.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/TeiidComponentException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/TeiidComponentException.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/TeiidComponentException.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/TeiidComponentException.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/TeiidComponentException.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/TeiidException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/TeiidException.java:3220-3275,3535-3555
/trunk/common-core/src/main/java/org/teiid/core/TeiidException.java:3188-3450,3452-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/TeiidException.java:3220-3275,3535-3555
/trunk/common-core/src/main/java/org/teiid/core/TeiidException.java:3188-3450,3452-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/TeiidProcessingException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/TeiidProcessingException.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/TeiidProcessingException.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/TeiidProcessingException.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/TeiidProcessingException.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java:3220-3275,3535-3555
/trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java:3188-3450,3452-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java:3220-3275,3535-3555
/trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java:3188-3450,3452-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/crypto
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/crypto:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/crypto:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/crypto:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/crypto:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types:3535-3555*
/trunk/common-core/src/main/java/org/teiid/core/types:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types:3535-3555*
/trunk/common-core/src/main/java/org/teiid/core/types:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/BaseLob.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/BaseLob.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/BaseLob.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/BaseLob.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/BaseLob.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/BlobImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/BlobImpl.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/BlobImpl.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/BlobImpl.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/BlobImpl.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/BlobType.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/BlobType.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/BlobType.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/ClobImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/ClobImpl.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/ClobImpl.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/ClobImpl.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/ClobImpl.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/ClobType.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/ClobType.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/ClobType.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/LobSearchUtil.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/LobSearchUtil.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/LobSearchUtil.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/LobSearchUtil.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/LobSearchUtil.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/NullType.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/NullType.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/NullType.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/NullType.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/NullType.java:3507-3666
Modified: branches/as7/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java
===================================================================
--- branches/as7/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -117,7 +117,7 @@
if (sourceClass == null || sourceClass == StreamSource.class) {
return (T)new StreamSource(getBinaryStream(), this.getStreamFactory().getSystemId());
} else if (sourceClass == StAXSource.class) {
- XMLInputFactory factory = XMLInputFactory.newInstance();
+ XMLInputFactory factory = XMLType.getXmlInputFactory();
try {
return (T) new StAXSource(factory.createXMLStreamReader(getBinaryStream()));
} catch (XMLStreamException e) {
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/SQLXMLImpl.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/Sequencable.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/Sequencable.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/Sequencable.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/Sequencable.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/Sequencable.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/SourceTransform.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/SourceTransform.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/SourceTransform.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/SourceTransform.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/SourceTransform.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/StandardXMLTranslator.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/StandardXMLTranslator.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/StandardXMLTranslator.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/StandardXMLTranslator.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/StandardXMLTranslator.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/Streamable.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/Streamable.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/Streamable.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/Streamable.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/Streamable.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/Transform.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/Transform.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/Transform.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/Transform.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/Transform.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/TransformationException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/TransformationException.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/TransformationException.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/TransformationException.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/TransformationException.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/XMLTranslator.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/XMLTranslator.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/XMLTranslator.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/XMLTranslator.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/XMLTranslator.java:3507-3666
Modified: branches/as7/common-core/src/main/java/org/teiid/core/types/XMLType.java
===================================================================
--- branches/as7/common-core/src/main/java/org/teiid/core/types/XMLType.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/common-core/src/main/java/org/teiid/core/types/XMLType.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -54,9 +54,31 @@
private static final long serialVersionUID = -7922647237095135723L;
+ private static ThreadLocal<XMLInputFactory> threadLocalFactory = new ThreadLocal<XMLInputFactory>() {
+ protected XMLInputFactory initialValue() {
+ return XMLInputFactory.newInstance();
+ }
+ };
+ private static XMLInputFactory factory = XMLInputFactory.newInstance();
+ private static Boolean factoriesTreadSafe;
+
private transient Type type = Type.UNKNOWN;
private String encoding;
-
+
+ public static boolean isThreadSafeXmlFactories() {
+ if (factoriesTreadSafe == null) {
+ factoriesTreadSafe = factory.getClass().getName().contains(".wstx."); //$NON-NLS-1$
+ }
+ return factoriesTreadSafe;
+ }
+
+ public static XMLInputFactory getXmlInputFactory() {
+ if (isThreadSafeXmlFactories()) {
+ return factory;
+ }
+ return threadLocalFactory.get();
+ }
+
public XMLType(){
}
@@ -175,7 +197,6 @@
}
public static String getEncoding(InputStream is) {
- XMLInputFactory factory = XMLInputFactory.newInstance();
XMLStreamReader reader;
try {
reader = factory.createXMLStreamReader(is);
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/XMLType.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/XMLType.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/XMLType.java:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/XMLType.java:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/XMLType.java:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/types/basic
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/basic:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/basic:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/types/basic:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/types/basic:3507-3666
Property changes on: branches/as7/common-core/src/main/java/org/teiid/core/util
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/main/java/org/teiid/core/util:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/util:3507-3597
+ /branches/7.4.x/common-core/src/main/java/org/teiid/core/util:3535-3555
/trunk/common-core/src/main/java/org/teiid/core/util:3507-3666
Modified: branches/as7/common-core/src/main/java/org/teiid/core/util/SqlUtil.java
===================================================================
--- branches/as7/common-core/src/main/java/org/teiid/core/util/SqlUtil.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/common-core/src/main/java/org/teiid/core/util/SqlUtil.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -23,9 +23,9 @@
package org.teiid.core.util;
import java.sql.SQLException;
-
import java.sql.SQLFeatureNotSupportedException;
-
+import java.util.TreeSet;
+import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
@@ -36,8 +36,17 @@
public static final char NL_CHAR = StringUtil.Constants.NEW_LINE_CHAR;
public static final char SPACE_CHAR = StringUtil.Constants.SPACE_CHAR;
public static final char TAB_CHAR = StringUtil.Constants.TAB_CHAR;
- private static Pattern PATTERN = Pattern.compile("^([\\s]|(/\\*.*\\*/))*(insert|update|delete|create|drop|(select([\\s]|(/\\*.*\\*/))+.*into([\\s]|(/\\*.*\\*/))+)).*", Pattern.CASE_INSENSITIVE|Pattern.MULTILINE); //$NON-NLS-1$
-
+ private static TreeSet<String> updateKeywords = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
+ static {
+ updateKeywords.add("insert"); //$NON-NLS-1$
+ updateKeywords.add("update"); //$NON-NLS-1$
+ updateKeywords.add("delete"); //$NON-NLS-1$
+ updateKeywords.add("drop"); //$NON-NLS-1$
+ updateKeywords.add("create"); //$NON-NLS-1$
+ }
+ private static Pattern PATTERN = Pattern.compile("^(?:\\s|(?:/\\*.*\\*/))*(\\w*)\\s", Pattern.CASE_INSENSITIVE|Pattern.DOTALL); //$NON-NLS-1$
+ private static Pattern INTO_PATTERN = Pattern.compile("(?:'[^']*')|(\\sinto\\s)", Pattern.CASE_INSENSITIVE|Pattern.DOTALL); //$NON-NLS-1$
+
private SqlUtil() {
super();
}
@@ -52,10 +61,29 @@
* query or an update
*/
public static boolean isUpdateSql(String sql) throws IllegalArgumentException {
- ArgCheck.isNotNull(sql);
- return PATTERN.matcher(sql).matches();
+ String keyWord = getKeyword(sql);
+ return updateKeywords.contains(keyWord);
}
+ public static String getKeyword(String sql) {
+ Matcher matcher = PATTERN.matcher(sql);
+ if (!matcher.find()) {
+ return sql; //shouldn't happen
+ }
+ String keyword = matcher.group(1);
+ if (keyword.equalsIgnoreCase("select")) { //$NON-NLS-1$
+ int end = matcher.end();
+ Matcher intoMatcher = INTO_PATTERN.matcher(sql);
+ while (intoMatcher.find(end)) {
+ if (intoMatcher.group(1) != null) {
+ return "insert"; //$NON-NLS-1$
+ }
+ end = intoMatcher.end();
+ }
+ }
+ return keyword;
+ }
+
public static SQLException createFeatureNotSupportedException() {
return new SQLFeatureNotSupportedException();
}
Property changes on: branches/as7/common-core/src/test/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org:3535-3555*
/trunk/common-core/src/test/java/org:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org:3535-3555*
/trunk/common-core/src/test/java/org:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid:3535-3555*
/trunk/common-core/src/test/java/org/teiid:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid:3535-3555*
/trunk/common-core/src/test/java/org/teiid:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core:3535-3555*
/trunk/common-core/src/test/java/org/teiid/core:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core:3535-3555*
/trunk/common-core/src/test/java/org/teiid/core:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/TestMetaMatrixException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/TestMetaMatrixException.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/TestMetaMatrixException.java:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/TestMetaMatrixException.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/TestMetaMatrixException.java:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/TestMetaMatrixRuntimeException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/TestMetaMatrixRuntimeException.java:3220-3275,3535-3555
/trunk/common-core/src/test/java/org/teiid/core/TestMetaMatrixRuntimeException.java:3188-3450,3452-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/TestMetaMatrixRuntimeException.java:3220-3275,3535-3555
/trunk/common-core/src/test/java/org/teiid/core/TestMetaMatrixRuntimeException.java:3188-3450,3452-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/crypto
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/crypto:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/crypto:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/crypto:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/crypto:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/types
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/types:3535-3555*
/trunk/common-core/src/test/java/org/teiid/core/types:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/types:3535-3555*
/trunk/common-core/src/test/java/org/teiid/core/types:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/types/TestBlobValue.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestBlobValue.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestBlobValue.java:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestBlobValue.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestBlobValue.java:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/types/TestClobValue.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestClobValue.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestClobValue.java:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestClobValue.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestClobValue.java:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/types/TestXMLStreamSourceTranslator.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestXMLStreamSourceTranslator.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestXMLStreamSourceTranslator.java:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestXMLStreamSourceTranslator.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestXMLStreamSourceTranslator.java:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/types/TestXMLValue.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestXMLValue.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestXMLValue.java:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/TestXMLValue.java:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/TestXMLValue.java:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/types/basic
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/basic:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/basic:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/types/basic:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/types/basic:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/core/util
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/core/util:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/util:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/core/util:3535-3555
/trunk/common-core/src/test/java/org/teiid/core/util:3507-3666
Modified: branches/as7/common-core/src/test/java/org/teiid/core/util/TestSqlUtil.java
===================================================================
--- branches/as7/common-core/src/test/java/org/teiid/core/util/TestSqlUtil.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/common-core/src/test/java/org/teiid/core/util/TestSqlUtil.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -22,72 +22,71 @@
package org.teiid.core.util;
-import org.teiid.core.util.SqlUtil;
+import static org.junit.Assert.*;
-import junit.framework.TestCase;
-
+import org.junit.Test;
/**
*/
-public class TestSqlUtil extends TestCase {
+public class TestSqlUtil {
- public TestSqlUtil(String name) {
- super(name);
- }
-
public void helpTest(String sql, boolean isUpdate) {
boolean actual = SqlUtil.isUpdateSql(sql);
assertEquals(isUpdate, actual);
}
- public void testSelect() {
+ @Test public void testSelect() {
helpTest("SELECT x FROM y", false); //$NON-NLS-1$
}
- public void testInsert() {
+ @Test public void testInsert() {
helpTest("Insert INTO g (a) VALUES (1)", true); //$NON-NLS-1$
}
- public void testUpdate() {
+ @Test public void testUpdate() {
helpTest("upDate x set a=5", true); //$NON-NLS-1$
}
- public void testDelete() {
+ @Test public void testDelete() {
helpTest("delete FROM x", true); //$NON-NLS-1$
}
- public void testInsertWithWhitespace() {
+ @Test public void testInsertWithWhitespace() {
helpTest("\nINSERT INTO g (a) VALUES (1)", true); //$NON-NLS-1$
}
- public void testExec() {
+ @Test public void testExec() {
helpTest("exec sq1()", false); //$NON-NLS-1$
}
- public void testXquery() {
+ @Test public void testXquery() {
helpTest("<i/>", false); //$NON-NLS-1$
}
- public void testSelectInto1() {
+ @Test public void testSelectInto1() {
helpTest("SELECT x INTO z FROM y", true); //$NON-NLS-1$
}
- public void testSelectInto2() {
+ @Test public void testSelectInto2() {
helpTest("SELECT x, INTOz FROM y", false); //$NON-NLS-1$
}
- public void testSelectInto3() {
+ @Test public void testSelectInto3() {
helpTest("SELECT x into z FROM y", true); //$NON-NLS-1$
}
- public void testSelectInto4() {
+ @Test public void testSelectInto4() {
helpTest("SELECT x into z", true); //$NON-NLS-1$
}
- public void testCreate() {
+ @Test public void testSelectInto5() {
+ helpTest("SELECT x, ' into ' from z", false); //$NON-NLS-1$
+ }
+
+ @Test public void testCreate() {
helpTest(" create table x", true); //$NON-NLS-1$
}
- public void testDrop() {
+ @Test public void testDrop() {
helpTest("/* */ drop table x", true); //$NON-NLS-1$
}
Property changes on: branches/as7/common-core/src/test/java/org/teiid/query
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/query:3535-3555*
/trunk/common-core/src/test/java/org/teiid/query:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/query:3535-3555*
/trunk/common-core/src/test/java/org/teiid/query:3507-3666
Property changes on: branches/as7/common-core/src/test/java/org/teiid/query/unittest
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/common-core/src/test/java/org/teiid/query/unittest:3535-3555
/trunk/common-core/src/test/java/org/teiid/query/unittest:3507-3597
+ /branches/7.4.x/common-core/src/test/java/org/teiid/query/unittest:3535-3555
/trunk/common-core/src/test/java/org/teiid/query/unittest:3507-3666
Modified: branches/as7/connectors/connector-file/pom.xml
===================================================================
--- branches/as7/connectors/connector-file/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/connector-file/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-file</artifactId>
Property changes on: branches/as7/connectors/connector-file/src/main/java/org/teiid/resource/adapter
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/main/java/org/teiid/resource/adapter:3535-3555*
/trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/main/java/org/teiid/resource/adapter:3535-3555*
/trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file:3535-3555
/trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file:3535-3555
/trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/main/resources/org
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/main/resources/org:3535-3555*
/trunk/connectors/connector-file/src/main/resources/org:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/main/resources/org:3535-3555*
/trunk/connectors/connector-file/src/main/resources/org:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/main/resources/org/teiid
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/main/resources/org/teiid:3535-3555*
/trunk/connectors/connector-file/src/main/resources/org/teiid:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/main/resources/org/teiid:3535-3555*
/trunk/connectors/connector-file/src/main/resources/org/teiid:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/main/resources/org/teiid/resource
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/main/resources/org/teiid/resource:3535-3555*
/trunk/connectors/connector-file/src/main/resources/org/teiid/resource:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/main/resources/org/teiid/resource:3535-3555*
/trunk/connectors/connector-file/src/main/resources/org/teiid/resource:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/main/resources/org/teiid/resource/adapter
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/main/resources/org/teiid/resource/adapter:3535-3555*
/trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/main/resources/org/teiid/resource/adapter:3535-3555*
/trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file:3535-3555*
/trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file:3535-3555*
/trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties:3535-3555
/trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties:3535-3555
/trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/test/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/test/java/org:3535-3555*
/trunk/connectors/connector-file/src/test/java/org:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/test/java/org:3535-3555*
/trunk/connectors/connector-file/src/test/java/org:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/test/java/org/teiid
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/test/java/org/teiid:3535-3555*
/trunk/connectors/connector-file/src/test/java/org/teiid:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/test/java/org/teiid:3535-3555*
/trunk/connectors/connector-file/src/test/java/org/teiid:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/test/java/org/teiid/resource
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/test/java/org/teiid/resource:3535-3555*
/trunk/connectors/connector-file/src/test/java/org/teiid/resource:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/test/java/org/teiid/resource:3535-3555*
/trunk/connectors/connector-file/src/test/java/org/teiid/resource:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/test/java/org/teiid/resource/adapter
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/test/java/org/teiid/resource/adapter:3535-3555*
/trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/test/java/org/teiid/resource/adapter:3535-3555*
/trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file:3535-3555*
/trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file:3535-3555*
/trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file:3507-3666
Property changes on: branches/as7/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/TestFileConnection.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/TestFileConnection.java:3535-3555
/trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/TestFileConnection.java:3507-3597
+ /branches/7.4.x/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/TestFileConnection.java:3535-3555
/trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/TestFileConnection.java:3507-3666
Modified: branches/as7/connectors/connector-ldap/pom.xml
===================================================================
--- branches/as7/connectors/connector-ldap/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/connector-ldap/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ldap</artifactId>
Property changes on: branches/as7/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter:3535-3555*
/trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter:3507-3597
+ /branches/7.4.x/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter:3535-3555*
/trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter:3507-3666
Property changes on: branches/as7/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap:3535-3555
/trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap:3507-3597
+ /branches/7.4.x/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap:3535-3555
/trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap:3507-3666
Modified: branches/as7/connectors/connector-salesforce/pom.xml
===================================================================
--- branches/as7/connectors/connector-salesforce/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/connector-salesforce/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-salesforce</artifactId>
Modified: branches/as7/connectors/connector-ws/pom.xml
===================================================================
--- branches/as7/connectors/connector-ws/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/connector-ws/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Property changes on: branches/as7/connectors/connector-ws/src/main/resources/org
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-ws/src/main/resources/org:3535-3555*
/trunk/connectors/connector-ws/src/main/resources/org:3507-3597
+ /branches/7.4.x/connectors/connector-ws/src/main/resources/org:3535-3555*
/trunk/connectors/connector-ws/src/main/resources/org:3507-3666
Property changes on: branches/as7/connectors/connector-ws/src/main/resources/org/teiid
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-ws/src/main/resources/org/teiid:3535-3555*
/trunk/connectors/connector-ws/src/main/resources/org/teiid:3507-3597
+ /branches/7.4.x/connectors/connector-ws/src/main/resources/org/teiid:3535-3555*
/trunk/connectors/connector-ws/src/main/resources/org/teiid:3507-3666
Property changes on: branches/as7/connectors/connector-ws/src/main/resources/org/teiid/resource
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-ws/src/main/resources/org/teiid/resource:3535-3555*
/trunk/connectors/connector-ws/src/main/resources/org/teiid/resource:3507-3597
+ /branches/7.4.x/connectors/connector-ws/src/main/resources/org/teiid/resource:3535-3555*
/trunk/connectors/connector-ws/src/main/resources/org/teiid/resource:3507-3666
Property changes on: branches/as7/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter:3535-3555*
/trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter:3507-3597
+ /branches/7.4.x/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter:3535-3555*
/trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter:3507-3666
Property changes on: branches/as7/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws:3535-3555*
/trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws:3507-3597
+ /branches/7.4.x/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws:3535-3555*
/trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws:3507-3666
Property changes on: branches/as7/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties:3535-3555
/trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties:3507-3597
+ /branches/7.4.x/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties:3535-3555
/trunk/connectors/connector-ws/src/main/resources/org/teiid/resource/adapter/ws/i18n.properties:3507-3666
Modified: branches/as7/connectors/pom.xml
===================================================================
--- branches/as7/connectors/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
@@ -104,5 +104,6 @@
<module>sandbox</module>
<module>translator-ws</module>
<module>translator-olap</module>
+ <module>translator-hive</module>
</modules>
</project>
Modified: branches/as7/connectors/salesforce-api/pom.xml
===================================================================
--- branches/as7/connectors/salesforce-api/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/salesforce-api/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: branches/as7/connectors/sandbox/pom.xml
===================================================================
--- branches/as7/connectors/sandbox/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/sandbox/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid.connectors</groupId>
Modified: branches/as7/connectors/sandbox/translator-yahoo/pom.xml
===================================================================
--- branches/as7/connectors/sandbox/translator-yahoo/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/sandbox/translator-yahoo/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-yahoo</artifactId>
Deleted: branches/as7/connectors/sandbox/translator-yahoo/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/sandbox/translator-yahoo/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/sandbox/translator-yahoo/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1 +0,0 @@
-Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Modified: branches/as7/connectors/translator-file/pom.xml
===================================================================
--- branches/as7/connectors/translator-file/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-file/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-file</artifactId>
Deleted: branches/as7/connectors/translator-file/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/translator-file/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-file/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1 +0,0 @@
-Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Property changes on: branches/as7/connectors/translator-hive
___________________________________________________________________
Added: svn:ignore
+ .classpath
.project
target
Deleted: branches/as7/connectors/translator-hive/pom.xml
===================================================================
--- trunk/connectors/translator-hive/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-hive/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>connectors</artifactId>
- <groupId>org.jboss.teiid</groupId>
- <version>7.6.0.CR2-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>translator-hive</artifactId>
- <groupId>org.jboss.teiid.connectors</groupId>
- <name>Hive Translator</name>
- <description>This translator provides access HDFS system using Hive.</description>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid.connectors</groupId>
- <artifactId>translator-jdbc</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.teiid.connectors</groupId>
- <artifactId>translator-jdbc</artifactId>
- <version>${version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <outputDirectory>target/classes</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <excludes>
- <exclude>**/*.xml</exclude>
- <exclude>**/*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- </build>
-</project>
Copied: branches/as7/connectors/translator-hive/pom.xml (from rev 3666, trunk/connectors/translator-hive/pom.xml)
===================================================================
--- branches/as7/connectors/translator-hive/pom.xml (rev 0)
+++ branches/as7/connectors/translator-hive/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>connectors</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>8.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>translator-hive</artifactId>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <name>Hive Translator</name>
+ <description>This translator provides access HDFS system using Hive.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>translator-jdbc</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>translator-jdbc</artifactId>
+ <version>${version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <outputDirectory>target/classes</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ <exclude>**/*.properties</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+</project>
Deleted: branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveExecutionFactory.java
===================================================================
--- trunk/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveExecutionFactory.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveExecutionFactory.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1,350 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.translator.hive;
-
-import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.BIG_INTEGER;
-import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.DATE;
-import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.DOUBLE;
-import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.INTEGER;
-import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.OBJECT;
-import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.STRING;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.core.util.PropertiesUtils;
-import org.teiid.language.Command;
-import org.teiid.language.Function;
-import org.teiid.language.Limit;
-import org.teiid.metadata.MetadataFactory;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.Translator;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.AliasModifier;
-import org.teiid.translator.jdbc.ConvertModifier;
-import org.teiid.translator.jdbc.FunctionModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.ModFunctionModifier;
-import org.teiid.translator.jdbc.SQLConversionVisitor;
-
-@Translator(name="hive", description="A translator for hive based database on HDFS")
-public class HiveExecutionFactory extends JDBCExecutionFactory {
-
- public static String HIVE = "hive"; //$NON-NLS-1$
- protected ConvertModifier convert = new ConvertModifier();
-
-
- public HiveExecutionFactory() {
- setSupportedJoinCriteria(SupportedJoinCriteria.EQUI);
- }
-
- @Override
- public void start() throws TranslatorException {
- super.start();
- convert.addTypeMapping("tinyint", FunctionModifier.BYTE); //$NON-NLS-1$
- convert.addTypeMapping("smallint", FunctionModifier.SHORT); //$NON-NLS-1$
- convert.addTypeMapping("int", FunctionModifier.INTEGER); //$NON-NLS-1$
- convert.addTypeMapping("bigint", FunctionModifier.BIGINTEGER, FunctionModifier.LONG); //$NON-NLS-1$
- convert.addTypeMapping("boolean", FunctionModifier.BOOLEAN); //$NON-NLS-1$
- convert.addTypeMapping("double", FunctionModifier.DOUBLE, FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
- convert.addTypeMapping("float", FunctionModifier.FLOAT); //$NON-NLS-1$
- convert.addTypeMapping("string", FunctionModifier.STRING); //$NON-NLS-1$
-
- // unsupported types
- //FunctionModifier.DATE,
- //FunctionModifier.TIMESTAMP
- //FunctionModifier.TIME,
- //FunctionModifier.CHAR,
- //FunctionModifier.BLOB,
- //FunctionModifier.CLOB,
- //FunctionModifier.XML
-
- registerFunctionModifier(SourceSystemFunctions.CONVERT, convert);
-
- registerFunctionModifier(SourceSystemFunctions.BITAND, new AliasModifier("&")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.BITNOT, new AliasModifier("~")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.BITOR, new AliasModifier("&")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.BITXOR, new AliasModifier("|")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.CURDATE, new AliasModifier("unix_timestamp")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.IFNULL, new AliasModifier("coalesce")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier("%", getLanguageFactory(), Arrays.asList(TypeFacility.RUNTIME_TYPES.BIG_INTEGER, TypeFacility.RUNTIME_TYPES.BIG_DECIMAL))); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.ARRAY_GET, new FunctionModifier() {
-
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList(function.getParameters().get(0), '[', function.getParameters().get(1), ']');
- }
- });
-
-
- addPushDownFunction(HIVE, "lower", STRING, STRING); //$NON-NLS-1$
- addPushDownFunction(HIVE, "upper", STRING, STRING); //$NON-NLS-1$
- addPushDownFunction(HIVE, "positive", INTEGER, DOUBLE); //$NON-NLS-1$
- addPushDownFunction(HIVE, "positive", DOUBLE, DOUBLE); //$NON-NLS-1$
- addPushDownFunction(HIVE, "negitive", INTEGER, DOUBLE); //$NON-NLS-1$
- addPushDownFunction(HIVE, "negitive", DOUBLE, DOUBLE); //$NON-NLS-1$
- addPushDownFunction(HIVE, "ln", DOUBLE, DOUBLE); //$NON-NLS-1$
- addPushDownFunction(HIVE, "reverse", STRING, STRING); //$NON-NLS-1$
- addPushDownFunction(HIVE, "space", INTEGER, STRING); //$NON-NLS-1$
- addPushDownFunction(HIVE, "split", OBJECT, STRING, STRING); //$NON-NLS-1$
- addPushDownFunction(HIVE, "hex", STRING, STRING); //$NON-NLS-1$
- addPushDownFunction(HIVE, "unhex", STRING, STRING); //$NON-NLS-1$
- addPushDownFunction(HIVE, "bin", STRING, BIG_INTEGER); //$NON-NLS-1$
- addPushDownFunction(HIVE, "day", INTEGER, DATE); //$NON-NLS-1$
- addPushDownFunction(HIVE, "datediff", INTEGER, DATE, DATE); //$NON-NLS-1$
- addPushDownFunction(HIVE, "date_add", INTEGER, DATE, INTEGER); //$NON-NLS-1$
- addPushDownFunction(HIVE, "date_sub", INTEGER, DATE, INTEGER); //$NON-NLS-1$
- }
-
- @Override
- public SQLConversionVisitor getSQLConversionVisitor() {
- return new HiveSQLConversionVisitor(this);
- }
-
- @Override
- public boolean useAnsiJoin() {
- return true;
- }
-
- @Override
- public boolean supportsBetweenCriteria() {
- return false;
- }
-
- @Override
- public boolean supportsCaseExpressions() {
- //https://issues.apache.org/jira/browse/HIVE-164
- return true;
- }
-
- @Override
- public boolean supportsCorrelatedSubqueries() {
- //https://issues.apache.org/jira/browse/HIVE-784
- return false;
- }
-
- @Override
- public boolean supportsExistsCriteria() {
- return false;
- }
-
- @Override
- public boolean supportsInCriteriaSubquery() {
- // the website documents a way to semi-join to re-write this but did not handle NOT IN case.
- return false;
- }
-
- @Override
- public boolean supportsLikeCriteriaEscapeCharacter() {
- return false;
- }
-
- @Override
- public boolean supportsQuantifiedCompareCriteriaAll() {
- return false;
- }
-
- @Override
- public boolean supportsQuantifiedCompareCriteriaSome() {
- return false;
- }
-
- @Override
- public boolean supportsBulkUpdate() {
- return false;
- }
-
- @Override
- public boolean supportsBatchedUpdates() {
- return false;
- }
-
- @Override
- public List<?> translateCommand(Command command, ExecutionContext context) {
- return null;
- }
-
- @Override
- public List<?> translateLimit(Limit limit, ExecutionContext context) {
- return null;
- }
-
- @Override
- public boolean addSourceComment() {
- return false;
- }
-
- @Override
- public boolean useAsInGroupAlias(){
- return false;
- }
-
- public boolean hasTimeType() {
- return false;
- }
-
- public String getLikeRegexString() {
- return "REGEXP"; //$NON-NLS-1$
- }
-
- @Override
- public boolean supportsScalarSubqueries() {
- // Supported only in FROM clause
- return false;
- }
-
- @Override
- public boolean supportsInlineViews() {
- // must be aliased.
- return true;
- }
-
- @Override
- public boolean supportsUnions() {
- return true;
- // only union all in subquery
- }
-
- @Override
- public boolean supportsInsertWithQueryExpression() {
- return false; // insert seems to be only with overwrite always
- }
-
- @Override
- public boolean supportsIntersect() {
- return false;
- }
-
- @Override
- public boolean supportsExcept() {
- return false;
- }
-
- @Override
- public boolean supportsAggregatesEnhancedNumeric() {
- return true;
- }
-
- @Override
- public boolean supportsCommonTableExpressions() {
- return false;
- }
-
- @Override
- public String translateLiteralBoolean(Boolean booleanValue) {
- if(booleanValue.booleanValue()) {
- return "true"; //$NON-NLS-1$
- }
- return "false"; //$NON-NLS-1$
- }
-
- @Override
- public String translateLiteralDate(java.sql.Date dateValue) {
- return formatDateValue(dateValue);
- }
-
- @Override
- public String translateLiteralTime(Time timeValue) {
- if (!hasTimeType()) {
- return translateLiteralTimestamp(new Timestamp(timeValue.getTime()));
- }
- return formatDateValue(timeValue);
- }
-
- @Override
- public String translateLiteralTimestamp(Timestamp timestampValue) {
- return formatDateValue(timestampValue);
- }
-
- @Override
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
-
- supportedFunctions.add(SourceSystemFunctions.ABS);
- supportedFunctions.add(SourceSystemFunctions.ACOS);
- supportedFunctions.add(SourceSystemFunctions.ARRAY_GET);
- supportedFunctions.add(SourceSystemFunctions.ASIN);
- supportedFunctions.add(SourceSystemFunctions.ASCII);
- supportedFunctions.add(SourceSystemFunctions.ATAN);
- supportedFunctions.add(SourceSystemFunctions.BITAND);
- supportedFunctions.add(SourceSystemFunctions.BITNOT);
- supportedFunctions.add(SourceSystemFunctions.BITOR);
- supportedFunctions.add(SourceSystemFunctions.BITXOR);
- supportedFunctions.add(SourceSystemFunctions.CEILING);
- supportedFunctions.add(SourceSystemFunctions.COALESCE);
- supportedFunctions.add(SourceSystemFunctions.CONCAT);
- supportedFunctions.add(SourceSystemFunctions.COS);
- supportedFunctions.add(SourceSystemFunctions.CONVERT);
- supportedFunctions.add(SourceSystemFunctions.CURDATE);
- supportedFunctions.add(SourceSystemFunctions.CURTIME);
- supportedFunctions.add(SourceSystemFunctions.DEGREES);
- supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
- supportedFunctions.add(SourceSystemFunctions.EXP);
- supportedFunctions.add(SourceSystemFunctions.FLOOR);
- supportedFunctions.add(SourceSystemFunctions.HOUR);
- supportedFunctions.add(SourceSystemFunctions.IFNULL);
- supportedFunctions.add(SourceSystemFunctions.LCASE);
- supportedFunctions.add(SourceSystemFunctions.LOCATE);
- supportedFunctions.add(SourceSystemFunctions.LPAD);
- supportedFunctions.add(SourceSystemFunctions.LENGTH);
- supportedFunctions.add(SourceSystemFunctions.LTRIM);
- supportedFunctions.add(SourceSystemFunctions.LOG);
- supportedFunctions.add(SourceSystemFunctions.LOG10);
- supportedFunctions.add(SourceSystemFunctions.MINUTE);
- supportedFunctions.add(SourceSystemFunctions.MOD);
- supportedFunctions.add(SourceSystemFunctions.POWER);
- supportedFunctions.add(SourceSystemFunctions.SECOND);
- supportedFunctions.add(SourceSystemFunctions.SQRT);
- supportedFunctions.add(SourceSystemFunctions.RAND);
- supportedFunctions.add(SourceSystemFunctions.ROUND);
- supportedFunctions.add(SourceSystemFunctions.RTRIM);
- supportedFunctions.add(SourceSystemFunctions.RPAD);
- supportedFunctions.add(SourceSystemFunctions.MONTH);
- supportedFunctions.add(SourceSystemFunctions.PI);
- supportedFunctions.add(SourceSystemFunctions.SIN);
- supportedFunctions.add(SourceSystemFunctions.SUBSTRING);
- supportedFunctions.add(SourceSystemFunctions.TRIM);
- supportedFunctions.add(SourceSystemFunctions.UCASE);
- supportedFunctions.add(SourceSystemFunctions.YEAR);
- return supportedFunctions;
- }
-
- @Override
- public void getMetadata(MetadataFactory metadataFactory, Connection conn) throws TranslatorException {
- try {
- HiveMetadataProcessor metadataProcessor = new HiveMetadataProcessor();
- PropertiesUtils.setBeanProperties(metadataProcessor, metadataFactory.getImportProperties(), "importer"); //$NON-NLS-1$
- metadataProcessor.getConnectorMetadata(conn, metadataFactory);
- } catch (SQLException e) {
- throw new TranslatorException(e);
- }
- }
-
-}
Copied: branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveExecutionFactory.java (from rev 3666, trunk/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveExecutionFactory.java)
===================================================================
--- branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveExecutionFactory.java (rev 0)
+++ branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveExecutionFactory.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,350 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.translator.hive;
+
+import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.BIG_INTEGER;
+import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.DATE;
+import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.DOUBLE;
+import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.INTEGER;
+import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.OBJECT;
+import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.STRING;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.teiid.core.util.PropertiesUtils;
+import org.teiid.language.Command;
+import org.teiid.language.Function;
+import org.teiid.language.Limit;
+import org.teiid.metadata.MetadataFactory;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.Translator;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.AliasModifier;
+import org.teiid.translator.jdbc.ConvertModifier;
+import org.teiid.translator.jdbc.FunctionModifier;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.ModFunctionModifier;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+
+@Translator(name="hive", description="A translator for hive based database on HDFS")
+public class HiveExecutionFactory extends JDBCExecutionFactory {
+
+ public static String HIVE = "hive"; //$NON-NLS-1$
+ protected ConvertModifier convert = new ConvertModifier();
+
+
+ public HiveExecutionFactory() {
+ setSupportedJoinCriteria(SupportedJoinCriteria.EQUI);
+ }
+
+ @Override
+ public void start() throws TranslatorException {
+ super.start();
+ convert.addTypeMapping("tinyint", FunctionModifier.BYTE); //$NON-NLS-1$
+ convert.addTypeMapping("smallint", FunctionModifier.SHORT); //$NON-NLS-1$
+ convert.addTypeMapping("int", FunctionModifier.INTEGER); //$NON-NLS-1$
+ convert.addTypeMapping("bigint", FunctionModifier.BIGINTEGER, FunctionModifier.LONG); //$NON-NLS-1$
+ convert.addTypeMapping("boolean", FunctionModifier.BOOLEAN); //$NON-NLS-1$
+ convert.addTypeMapping("double", FunctionModifier.DOUBLE, FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
+ convert.addTypeMapping("float", FunctionModifier.FLOAT); //$NON-NLS-1$
+ convert.addTypeMapping("string", FunctionModifier.STRING); //$NON-NLS-1$
+
+ // unsupported types
+ //FunctionModifier.DATE,
+ //FunctionModifier.TIMESTAMP
+ //FunctionModifier.TIME,
+ //FunctionModifier.CHAR,
+ //FunctionModifier.BLOB,
+ //FunctionModifier.CLOB,
+ //FunctionModifier.XML
+
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, convert);
+
+ registerFunctionModifier(SourceSystemFunctions.BITAND, new AliasModifier("&")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITNOT, new AliasModifier("~")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITOR, new AliasModifier("&")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITXOR, new AliasModifier("|")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.CURDATE, new AliasModifier("unix_timestamp")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.IFNULL, new AliasModifier("coalesce")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier("%", getLanguageFactory(), Arrays.asList(TypeFacility.RUNTIME_TYPES.BIG_INTEGER, TypeFacility.RUNTIME_TYPES.BIG_DECIMAL))); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.ARRAY_GET, new FunctionModifier() {
+
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList(function.getParameters().get(0), '[', function.getParameters().get(1), ']');
+ }
+ });
+
+
+ addPushDownFunction(HIVE, "lower", STRING, STRING); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "upper", STRING, STRING); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "positive", INTEGER, DOUBLE); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "positive", DOUBLE, DOUBLE); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "negitive", INTEGER, DOUBLE); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "negitive", DOUBLE, DOUBLE); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "ln", DOUBLE, DOUBLE); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "reverse", STRING, STRING); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "space", INTEGER, STRING); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "split", OBJECT, STRING, STRING); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "hex", STRING, STRING); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "unhex", STRING, STRING); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "bin", STRING, BIG_INTEGER); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "day", INTEGER, DATE); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "datediff", INTEGER, DATE, DATE); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "date_add", INTEGER, DATE, INTEGER); //$NON-NLS-1$
+ addPushDownFunction(HIVE, "date_sub", INTEGER, DATE, INTEGER); //$NON-NLS-1$
+ }
+
+ @Override
+ public SQLConversionVisitor getSQLConversionVisitor() {
+ return new HiveSQLConversionVisitor(this);
+ }
+
+ @Override
+ public boolean useAnsiJoin() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsBetweenCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsCaseExpressions() {
+ //https://issues.apache.org/jira/browse/HIVE-164
+ return true;
+ }
+
+ @Override
+ public boolean supportsCorrelatedSubqueries() {
+ //https://issues.apache.org/jira/browse/HIVE-784
+ return false;
+ }
+
+ @Override
+ public boolean supportsExistsCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsInCriteriaSubquery() {
+ // the website documents a way to semi-join to re-write this but did not handle NOT IN case.
+ return false;
+ }
+
+ @Override
+ public boolean supportsLikeCriteriaEscapeCharacter() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaAll() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaSome() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsBulkUpdate() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsBatchedUpdates() {
+ return false;
+ }
+
+ @Override
+ public List<?> translateCommand(Command command, ExecutionContext context) {
+ return null;
+ }
+
+ @Override
+ public List<?> translateLimit(Limit limit, ExecutionContext context) {
+ return null;
+ }
+
+ @Override
+ public boolean addSourceComment() {
+ return false;
+ }
+
+ @Override
+ public boolean useAsInGroupAlias(){
+ return false;
+ }
+
+ public boolean hasTimeType() {
+ return false;
+ }
+
+ public String getLikeRegexString() {
+ return "REGEXP"; //$NON-NLS-1$
+ }
+
+ @Override
+ public boolean supportsScalarSubqueries() {
+ // Supported only in FROM clause
+ return false;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ // must be aliased.
+ return true;
+ }
+
+ @Override
+ public boolean supportsUnions() {
+ return true;
+ // only union all in subquery
+ }
+
+ @Override
+ public boolean supportsInsertWithQueryExpression() {
+ return false; // insert seems to be only with overwrite always
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsExcept() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsCommonTableExpressions() {
+ return false;
+ }
+
+ @Override
+ public String translateLiteralBoolean(Boolean booleanValue) {
+ if(booleanValue.booleanValue()) {
+ return "true"; //$NON-NLS-1$
+ }
+ return "false"; //$NON-NLS-1$
+ }
+
+ @Override
+ public String translateLiteralDate(java.sql.Date dateValue) {
+ return formatDateValue(dateValue);
+ }
+
+ @Override
+ public String translateLiteralTime(Time timeValue) {
+ if (!hasTimeType()) {
+ return translateLiteralTimestamp(new Timestamp(timeValue.getTime()));
+ }
+ return formatDateValue(timeValue);
+ }
+
+ @Override
+ public String translateLiteralTimestamp(Timestamp timestampValue) {
+ return formatDateValue(timestampValue);
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+
+ supportedFunctions.add(SourceSystemFunctions.ABS);
+ supportedFunctions.add(SourceSystemFunctions.ACOS);
+ supportedFunctions.add(SourceSystemFunctions.ARRAY_GET);
+ supportedFunctions.add(SourceSystemFunctions.ASIN);
+ supportedFunctions.add(SourceSystemFunctions.ASCII);
+ supportedFunctions.add(SourceSystemFunctions.ATAN);
+ supportedFunctions.add(SourceSystemFunctions.BITAND);
+ supportedFunctions.add(SourceSystemFunctions.BITNOT);
+ supportedFunctions.add(SourceSystemFunctions.BITOR);
+ supportedFunctions.add(SourceSystemFunctions.BITXOR);
+ supportedFunctions.add(SourceSystemFunctions.CEILING);
+ supportedFunctions.add(SourceSystemFunctions.COALESCE);
+ supportedFunctions.add(SourceSystemFunctions.CONCAT);
+ supportedFunctions.add(SourceSystemFunctions.COS);
+ supportedFunctions.add(SourceSystemFunctions.CONVERT);
+ supportedFunctions.add(SourceSystemFunctions.CURDATE);
+ supportedFunctions.add(SourceSystemFunctions.CURTIME);
+ supportedFunctions.add(SourceSystemFunctions.DEGREES);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
+ supportedFunctions.add(SourceSystemFunctions.EXP);
+ supportedFunctions.add(SourceSystemFunctions.FLOOR);
+ supportedFunctions.add(SourceSystemFunctions.HOUR);
+ supportedFunctions.add(SourceSystemFunctions.IFNULL);
+ supportedFunctions.add(SourceSystemFunctions.LCASE);
+ supportedFunctions.add(SourceSystemFunctions.LOCATE);
+ supportedFunctions.add(SourceSystemFunctions.LPAD);
+ supportedFunctions.add(SourceSystemFunctions.LENGTH);
+ supportedFunctions.add(SourceSystemFunctions.LTRIM);
+ supportedFunctions.add(SourceSystemFunctions.LOG);
+ supportedFunctions.add(SourceSystemFunctions.LOG10);
+ supportedFunctions.add(SourceSystemFunctions.MINUTE);
+ supportedFunctions.add(SourceSystemFunctions.MOD);
+ supportedFunctions.add(SourceSystemFunctions.POWER);
+ supportedFunctions.add(SourceSystemFunctions.SECOND);
+ supportedFunctions.add(SourceSystemFunctions.SQRT);
+ supportedFunctions.add(SourceSystemFunctions.RAND);
+ supportedFunctions.add(SourceSystemFunctions.ROUND);
+ supportedFunctions.add(SourceSystemFunctions.RTRIM);
+ supportedFunctions.add(SourceSystemFunctions.RPAD);
+ supportedFunctions.add(SourceSystemFunctions.MONTH);
+ supportedFunctions.add(SourceSystemFunctions.PI);
+ supportedFunctions.add(SourceSystemFunctions.SIN);
+ supportedFunctions.add(SourceSystemFunctions.SUBSTRING);
+ supportedFunctions.add(SourceSystemFunctions.TRIM);
+ supportedFunctions.add(SourceSystemFunctions.UCASE);
+ supportedFunctions.add(SourceSystemFunctions.YEAR);
+ return supportedFunctions;
+ }
+
+ @Override
+ public void getMetadata(MetadataFactory metadataFactory, Connection conn) throws TranslatorException {
+ try {
+ HiveMetadataProcessor metadataProcessor = new HiveMetadataProcessor();
+ PropertiesUtils.setBeanProperties(metadataProcessor, metadataFactory.getImportProperties(), "importer"); //$NON-NLS-1$
+ metadataProcessor.getConnectorMetadata(conn, metadataFactory);
+ } catch (SQLException e) {
+ throw new TranslatorException(e);
+ }
+ }
+
+}
Deleted: branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveMetadataProcessor.java
===================================================================
--- trunk/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveMetadataProcessor.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveMetadataProcessor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1,113 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.translator.hive;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.metadata.Column;
-import org.teiid.metadata.MetadataFactory;
-import org.teiid.metadata.Table;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.JDBCMetdataProcessor;
-
-public class HiveMetadataProcessor extends JDBCMetdataProcessor {
-
- @Override
- public void getConnectorMetadata(Connection conn, MetadataFactory metadataFactory) throws SQLException, TranslatorException {
- List<String> tables = getTables(conn);
- for (String table:tables) {
- addTable(table, conn, metadataFactory);
- }
- }
-
- private List<String> getTables(Connection conn) {
- ArrayList<String> tables = new ArrayList<String>();
- try {
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("SHOW TABLES"); //$NON-NLS-1$
- while (rs.next()){
- tables.add(rs.getString(1));
- }
- rs.close();
- } catch (SQLException e) {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, "HiveMetadataProcessor - failed getting table names"); //$NON-NLS-1$
- }
- return tables;
- }
-
- private String getRuntimeType(String type) {
- if (type.equalsIgnoreCase("int")) { //$NON-NLS-1$
- return TypeFacility.RUNTIME_NAMES.INTEGER;
- }
- else if (type.equalsIgnoreCase("tinyint")) { //$NON-NLS-1$
- return TypeFacility.RUNTIME_NAMES.BYTE;
- }
- else if (type.equalsIgnoreCase("smallint")) { //$NON-NLS-1$
- return TypeFacility.RUNTIME_NAMES.SHORT;
- }
- else if (type.equalsIgnoreCase("bigint")) { //$NON-NLS-1$
- return TypeFacility.RUNTIME_NAMES.BIG_INTEGER;
- }
- else if (type.equalsIgnoreCase("string")) { //$NON-NLS-1$
- return TypeFacility.RUNTIME_NAMES.STRING;
- }
- else if (type.equalsIgnoreCase("float")) { //$NON-NLS-1$
- return TypeFacility.RUNTIME_NAMES.FLOAT;
- }
- else if (type.equalsIgnoreCase("double")) { //$NON-NLS-1$
- return TypeFacility.RUNTIME_NAMES.DOUBLE;
- }
- else if (type.equalsIgnoreCase("boolean")) { //$NON-NLS-1$
- return TypeFacility.RUNTIME_NAMES.BOOLEAN;
- }
- return TypeFacility.RUNTIME_NAMES.STRING;
- }
- private void addTable(String tableName, Connection conn, MetadataFactory metadataFactory) throws TranslatorException {
- try {
- Table table = metadataFactory.addTable(tableName);
- table.setNameInSource(tableName);
- table.setSupportsUpdate(true);
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery("DESCRIBE "+tableName); //$NON-NLS-1$
- while (rs.next()){
- String name = rs.getString(1);
- String type = rs.getString(2);
- String runtimeType = getRuntimeType(type);
-
- Column column = metadataFactory.addColumn(name, runtimeType, table);
- column.setNameInSource(name);
- column.setUpdatable(true);
- }
- rs.close();
- } catch (SQLException e) {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, "HiveMetadataProcessor - failed getting column names"); //$NON-NLS-1$
- }
- }
-}
Copied: branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveMetadataProcessor.java (from rev 3666, trunk/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveMetadataProcessor.java)
===================================================================
--- branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveMetadataProcessor.java (rev 0)
+++ branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveMetadataProcessor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.translator.hive;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.metadata.Column;
+import org.teiid.metadata.MetadataFactory;
+import org.teiid.metadata.Table;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.JDBCMetdataProcessor;
+
+public class HiveMetadataProcessor extends JDBCMetdataProcessor {
+
+ @Override
+ public void getConnectorMetadata(Connection conn, MetadataFactory metadataFactory) throws SQLException, TranslatorException {
+ List<String> tables = getTables(conn);
+ for (String table:tables) {
+ addTable(table, conn, metadataFactory);
+ }
+ }
+
+ private List<String> getTables(Connection conn) {
+ ArrayList<String> tables = new ArrayList<String>();
+ try {
+ Statement stmt = conn.createStatement();
+ ResultSet rs = stmt.executeQuery("SHOW TABLES"); //$NON-NLS-1$
+ while (rs.next()){
+ tables.add(rs.getString(1));
+ }
+ rs.close();
+ } catch (SQLException e) {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "HiveMetadataProcessor - failed getting table names"); //$NON-NLS-1$
+ }
+ return tables;
+ }
+
+ private String getRuntimeType(String type) {
+ if (type.equalsIgnoreCase("int")) { //$NON-NLS-1$
+ return TypeFacility.RUNTIME_NAMES.INTEGER;
+ }
+ else if (type.equalsIgnoreCase("tinyint")) { //$NON-NLS-1$
+ return TypeFacility.RUNTIME_NAMES.BYTE;
+ }
+ else if (type.equalsIgnoreCase("smallint")) { //$NON-NLS-1$
+ return TypeFacility.RUNTIME_NAMES.SHORT;
+ }
+ else if (type.equalsIgnoreCase("bigint")) { //$NON-NLS-1$
+ return TypeFacility.RUNTIME_NAMES.BIG_INTEGER;
+ }
+ else if (type.equalsIgnoreCase("string")) { //$NON-NLS-1$
+ return TypeFacility.RUNTIME_NAMES.STRING;
+ }
+ else if (type.equalsIgnoreCase("float")) { //$NON-NLS-1$
+ return TypeFacility.RUNTIME_NAMES.FLOAT;
+ }
+ else if (type.equalsIgnoreCase("double")) { //$NON-NLS-1$
+ return TypeFacility.RUNTIME_NAMES.DOUBLE;
+ }
+ else if (type.equalsIgnoreCase("boolean")) { //$NON-NLS-1$
+ return TypeFacility.RUNTIME_NAMES.BOOLEAN;
+ }
+ return TypeFacility.RUNTIME_NAMES.STRING;
+ }
+ private void addTable(String tableName, Connection conn, MetadataFactory metadataFactory) throws TranslatorException {
+ try {
+ Table table = metadataFactory.addTable(tableName);
+ table.setNameInSource(tableName);
+ table.setSupportsUpdate(true);
+ Statement stmt = conn.createStatement();
+ ResultSet rs = stmt.executeQuery("DESCRIBE "+tableName); //$NON-NLS-1$
+ while (rs.next()){
+ String name = rs.getString(1);
+ String type = rs.getString(2);
+ String runtimeType = getRuntimeType(type);
+
+ Column column = metadataFactory.addColumn(name, runtimeType, table);
+ column.setNameInSource(name);
+ column.setUpdatable(true);
+ }
+ rs.close();
+ } catch (SQLException e) {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "HiveMetadataProcessor - failed getting column names"); //$NON-NLS-1$
+ }
+ }
+}
Deleted: branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveSQLConversionVisitor.java
===================================================================
--- trunk/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveSQLConversionVisitor.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveSQLConversionVisitor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1,185 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.translator.hive;
-
-import static org.teiid.language.SQLConstants.Reserved.ALL;
-import static org.teiid.language.SQLConstants.Reserved.DISTINCT;
-import static org.teiid.language.SQLConstants.Reserved.FROM;
-import static org.teiid.language.SQLConstants.Reserved.FULL;
-import static org.teiid.language.SQLConstants.Reserved.JOIN;
-import static org.teiid.language.SQLConstants.Reserved.LEFT;
-import static org.teiid.language.SQLConstants.Reserved.ON;
-import static org.teiid.language.SQLConstants.Reserved.OUTER;
-import static org.teiid.language.SQLConstants.Reserved.RIGHT;
-import static org.teiid.language.SQLConstants.Reserved.SELECT;
-
-import java.util.List;
-
-import org.teiid.language.ColumnReference;
-import org.teiid.language.Condition;
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Expression;
-import org.teiid.language.Join;
-import org.teiid.language.Limit;
-import org.teiid.language.OrderBy;
-import org.teiid.language.SQLConstants.Tokens;
-import org.teiid.language.Select;
-import org.teiid.language.SetQuery;
-import org.teiid.language.TableReference;
-import org.teiid.translator.jdbc.SQLConversionVisitor;
-
-public class HiveSQLConversionVisitor extends SQLConversionVisitor {
-
- public HiveSQLConversionVisitor(HiveExecutionFactory hef) {
- super(hef);
- }
-
- public void visit(Join obj) {
- TableReference leftItem = obj.getLeftItem();
- if(useParensForJoins() && leftItem instanceof Join) {
- buffer.append(Tokens.LPAREN);
- append(leftItem);
- buffer.append(Tokens.RPAREN);
- } else {
- append(leftItem);
- }
- buffer.append(Tokens.SPACE);
-
- switch(obj.getJoinType()) {
- case CROSS_JOIN:
- // Hive just works with "JOIN" keyword no inner or cross
- //buffer.append(CROSS);
- break;
- case FULL_OUTER_JOIN:
- buffer.append(FULL)
- .append(Tokens.SPACE)
- .append(OUTER);
- break;
- case INNER_JOIN:
- // Hive just works with "JOIN" keyword no inner or cross
- //buffer.append(INNER);
- break;
- case LEFT_OUTER_JOIN:
- buffer.append(LEFT)
- .append(Tokens.SPACE)
- .append(OUTER);
- break;
- case RIGHT_OUTER_JOIN:
- buffer.append(RIGHT)
- .append(Tokens.SPACE)
- .append(OUTER);
- break;
- default: buffer.append(UNDEFINED);
- }
- buffer.append(Tokens.SPACE)
- .append(JOIN)
- .append(Tokens.SPACE);
-
- TableReference rightItem = obj.getRightItem();
- if(rightItem instanceof Join && (useParensForJoins() || obj.getJoinType() == Join.JoinType.CROSS_JOIN)) {
- buffer.append(Tokens.LPAREN);
- append(rightItem);
- buffer.append(Tokens.RPAREN);
- } else {
- append(rightItem);
- }
-
- final Condition condition = obj.getCondition();
- if (condition != null) {
- buffer.append(Tokens.SPACE)
- .append(ON)
- .append(Tokens.SPACE);
- append(condition);
- }
- }
-
- public void addColumns(List<DerivedColumn> items) {
- if (items != null && items.size() != 0) {
- addColumn(items.get(0));
- for (int i = 1; i < items.size(); i++) {
- buffer.append(Tokens.COMMA)
- .append(Tokens.SPACE);
- addColumn(items.get(i));
- }
- }
- }
-
- private void addColumn(DerivedColumn dc) {
- if (dc.getAlias() != null) {
- buffer.append(dc.getAlias());
- }
- else {
- Expression expr = dc.getExpression();
- if (expr instanceof ColumnReference) {
- buffer.append(((ColumnReference)expr).getName());
- }
- else {
- append(expr);
- }
- }
- }
-
- @Override
- public void visit(SetQuery obj) {
- if (obj.getWith() != null) {
- append(obj.getWith());
- }
-
- Select select = (Select)obj.getLeftQuery();
- buffer.append(SELECT).append(Tokens.SPACE);
- if(!obj.isAll()) {
- buffer.append(DISTINCT).append(Tokens.SPACE);
- }
- addColumns(select.getDerivedColumns());
- buffer.append(Tokens.SPACE);
- buffer.append(FROM).append(Tokens.SPACE);
- buffer.append(Tokens.LPAREN);
-
- appendSetQuery(obj, obj.getLeftQuery(), false);
-
- buffer.append(Tokens.SPACE);
-
- appendSetOperation(obj.getOperation());
-
- // UNION "ALL" always
- buffer.append(Tokens.SPACE);
- buffer.append(ALL);
- buffer.append(Tokens.SPACE);
-
- appendSetQuery(obj, obj.getRightQuery(), true);
-
- OrderBy orderBy = obj.getOrderBy();
- if(orderBy != null) {
- buffer.append(Tokens.SPACE);
- append(orderBy);
- }
-
- Limit limit = obj.getLimit();
- if(limit != null) {
- buffer.append(Tokens.SPACE);
- append(limit);
- }
- buffer.append(Tokens.RPAREN);
- buffer.append(Tokens.SPACE);
- buffer.append("X__"); //$NON-NLS-1$
- }
-}
Copied: branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveSQLConversionVisitor.java (from rev 3666, trunk/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveSQLConversionVisitor.java)
===================================================================
--- branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveSQLConversionVisitor.java (rev 0)
+++ branches/as7/connectors/translator-hive/src/main/java/org/teiid/translator/hive/HiveSQLConversionVisitor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,185 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.translator.hive;
+
+import static org.teiid.language.SQLConstants.Reserved.ALL;
+import static org.teiid.language.SQLConstants.Reserved.DISTINCT;
+import static org.teiid.language.SQLConstants.Reserved.FROM;
+import static org.teiid.language.SQLConstants.Reserved.FULL;
+import static org.teiid.language.SQLConstants.Reserved.JOIN;
+import static org.teiid.language.SQLConstants.Reserved.LEFT;
+import static org.teiid.language.SQLConstants.Reserved.ON;
+import static org.teiid.language.SQLConstants.Reserved.OUTER;
+import static org.teiid.language.SQLConstants.Reserved.RIGHT;
+import static org.teiid.language.SQLConstants.Reserved.SELECT;
+
+import java.util.List;
+
+import org.teiid.language.ColumnReference;
+import org.teiid.language.Condition;
+import org.teiid.language.DerivedColumn;
+import org.teiid.language.Expression;
+import org.teiid.language.Join;
+import org.teiid.language.Limit;
+import org.teiid.language.OrderBy;
+import org.teiid.language.SQLConstants.Tokens;
+import org.teiid.language.Select;
+import org.teiid.language.SetQuery;
+import org.teiid.language.TableReference;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+
+public class HiveSQLConversionVisitor extends SQLConversionVisitor {
+
+ public HiveSQLConversionVisitor(HiveExecutionFactory hef) {
+ super(hef);
+ }
+
+ public void visit(Join obj) {
+ TableReference leftItem = obj.getLeftItem();
+ if(useParensForJoins() && leftItem instanceof Join) {
+ buffer.append(Tokens.LPAREN);
+ append(leftItem);
+ buffer.append(Tokens.RPAREN);
+ } else {
+ append(leftItem);
+ }
+ buffer.append(Tokens.SPACE);
+
+ switch(obj.getJoinType()) {
+ case CROSS_JOIN:
+ // Hive just works with "JOIN" keyword no inner or cross
+ //buffer.append(CROSS);
+ break;
+ case FULL_OUTER_JOIN:
+ buffer.append(FULL)
+ .append(Tokens.SPACE)
+ .append(OUTER);
+ break;
+ case INNER_JOIN:
+ // Hive just works with "JOIN" keyword no inner or cross
+ //buffer.append(INNER);
+ break;
+ case LEFT_OUTER_JOIN:
+ buffer.append(LEFT)
+ .append(Tokens.SPACE)
+ .append(OUTER);
+ break;
+ case RIGHT_OUTER_JOIN:
+ buffer.append(RIGHT)
+ .append(Tokens.SPACE)
+ .append(OUTER);
+ break;
+ default: buffer.append(UNDEFINED);
+ }
+ buffer.append(Tokens.SPACE)
+ .append(JOIN)
+ .append(Tokens.SPACE);
+
+ TableReference rightItem = obj.getRightItem();
+ if(rightItem instanceof Join && (useParensForJoins() || obj.getJoinType() == Join.JoinType.CROSS_JOIN)) {
+ buffer.append(Tokens.LPAREN);
+ append(rightItem);
+ buffer.append(Tokens.RPAREN);
+ } else {
+ append(rightItem);
+ }
+
+ final Condition condition = obj.getCondition();
+ if (condition != null) {
+ buffer.append(Tokens.SPACE)
+ .append(ON)
+ .append(Tokens.SPACE);
+ append(condition);
+ }
+ }
+
+ public void addColumns(List<DerivedColumn> items) {
+ if (items != null && items.size() != 0) {
+ addColumn(items.get(0));
+ for (int i = 1; i < items.size(); i++) {
+ buffer.append(Tokens.COMMA)
+ .append(Tokens.SPACE);
+ addColumn(items.get(i));
+ }
+ }
+ }
+
+ private void addColumn(DerivedColumn dc) {
+ if (dc.getAlias() != null) {
+ buffer.append(dc.getAlias());
+ }
+ else {
+ Expression expr = dc.getExpression();
+ if (expr instanceof ColumnReference) {
+ buffer.append(((ColumnReference)expr).getName());
+ }
+ else {
+ append(expr);
+ }
+ }
+ }
+
+ @Override
+ public void visit(SetQuery obj) {
+ if (obj.getWith() != null) {
+ append(obj.getWith());
+ }
+
+ Select select = (Select)obj.getLeftQuery();
+ buffer.append(SELECT).append(Tokens.SPACE);
+ if(!obj.isAll()) {
+ buffer.append(DISTINCT).append(Tokens.SPACE);
+ }
+ addColumns(select.getDerivedColumns());
+ buffer.append(Tokens.SPACE);
+ buffer.append(FROM).append(Tokens.SPACE);
+ buffer.append(Tokens.LPAREN);
+
+ appendSetQuery(obj, obj.getLeftQuery(), false);
+
+ buffer.append(Tokens.SPACE);
+
+ appendSetOperation(obj.getOperation());
+
+ // UNION "ALL" always
+ buffer.append(Tokens.SPACE);
+ buffer.append(ALL);
+ buffer.append(Tokens.SPACE);
+
+ appendSetQuery(obj, obj.getRightQuery(), true);
+
+ OrderBy orderBy = obj.getOrderBy();
+ if(orderBy != null) {
+ buffer.append(Tokens.SPACE);
+ append(orderBy);
+ }
+
+ Limit limit = obj.getLimit();
+ if(limit != null) {
+ buffer.append(Tokens.SPACE);
+ append(limit);
+ }
+ buffer.append(Tokens.RPAREN);
+ buffer.append(Tokens.SPACE);
+ buffer.append("X__"); //$NON-NLS-1$
+ }
+}
Added: branches/as7/connectors/translator-hive/src/main/resources/META-INF/services/org.teiid.translator.ExecutionFactory
===================================================================
--- branches/as7/connectors/translator-hive/src/main/resources/META-INF/services/org.teiid.translator.ExecutionFactory (rev 0)
+++ branches/as7/connectors/translator-hive/src/main/resources/META-INF/services/org.teiid.translator.ExecutionFactory 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1 @@
+org.teiid.translator.hive.HiveExecutionFactory
Deleted: branches/as7/connectors/translator-hive/src/test/java/org/teiid/translator/hive/TestHiveExecutionFactory.java
===================================================================
--- trunk/connectors/translator-hive/src/test/java/org/teiid/translator/hive/TestHiveExecutionFactory.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-hive/src/test/java/org/teiid/translator/hive/TestHiveExecutionFactory.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1,168 +0,0 @@
-package org.teiid.translator.hive;
-
-import static org.junit.Assert.assertEquals;
-
-import java.math.BigInteger;
-import java.util.Arrays;
-import java.util.List;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.teiid.cdk.CommandBuilder;
-import org.teiid.core.types.DataTypeManager;
-import org.teiid.language.Command;
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.language.LanguageFactory;
-import org.teiid.metadata.Column;
-import org.teiid.metadata.MetadataStore;
-import org.teiid.metadata.Schema;
-import org.teiid.metadata.Table;
-import org.teiid.query.mapping.relational.QueryNode;
-import org.teiid.query.metadata.QueryMetadataInterface;
-import org.teiid.query.metadata.TransformationMetadata;
-import org.teiid.query.unittest.RealMetadataFactory;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.TranslatedCommand;
-
-@SuppressWarnings("nls")
-public class TestHiveExecutionFactory {
-
- private static HiveExecutionFactory hiveTranslator;
- private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
- private static TransformationMetadata bqt;
-
- @BeforeClass
- public static void setUp() throws TranslatorException {
- hiveTranslator = new HiveExecutionFactory();
- hiveTranslator.setUseBindVariables(false);
- hiveTranslator.start();
- bqt = exampleBQT();
- }
-
- private void helpTest(Expression srcExpression, String tgtType, String expectedExpression) throws Exception {
- Function func = LANG_FACTORY.createFunction("convert", Arrays.asList( srcExpression,LANG_FACTORY.createLiteral(tgtType, String.class)),TypeFacility.getDataTypeClass(tgtType));
- SQLConversionVisitor sqlVisitor = hiveTranslator.getSQLConversionVisitor();
- sqlVisitor.append(func);
- assertEquals("Error converting from " + srcExpression.getType() + " to " + tgtType, expectedExpression,sqlVisitor.toString());
- }
-
- private void helpTestVisitor(QueryMetadataInterface metadata, String input, String expectedOutput) throws TranslatorException {
- // Convert from sql to objects
- CommandBuilder commandBuilder = new CommandBuilder(metadata);
- Command obj = commandBuilder.getCommand(input);
-
- // Convert back to SQL
- TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), hiveTranslator);
- tc.translateCommand(obj);
-
- // Check stuff
- assertEquals("Did not get correct sql", expectedOutput, tc.getSql()); //$NON-NLS-1$
- }
-
- @Test public void testConvertions() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(Boolean.TRUE, Boolean.class), TypeFacility.RUNTIME_NAMES.BOOLEAN, "cast(true AS boolean)");
- helpTest(LANG_FACTORY.createLiteral(Byte.parseByte("123"), Byte.class), TypeFacility.RUNTIME_NAMES.BYTE, "cast(123 AS tinyint)");
- helpTest(LANG_FACTORY.createLiteral(new Integer(12345), Integer.class), TypeFacility.RUNTIME_NAMES.INTEGER, "cast(12345 AS int)");
- helpTest(LANG_FACTORY.createLiteral(Short.parseShort("1234"), Short.class), TypeFacility.RUNTIME_NAMES.SHORT, "cast(1234 AS smallint)");
- helpTest(LANG_FACTORY.createLiteral(new BigInteger("123451266182"), BigInteger.class), TypeFacility.RUNTIME_NAMES.BIG_INTEGER, "cast(123451266182 AS bigint)");
- helpTest(LANG_FACTORY.createLiteral(new String("foo-bar"), String.class), TypeFacility.RUNTIME_NAMES.STRING, "cast('foo-bar' AS string)");
- helpTest(LANG_FACTORY.createLiteral(Boolean.TRUE, Boolean.class), TypeFacility.RUNTIME_NAMES.STRING, "cast(true AS string)");
- //helpTest(LANG_FACTORY.createLiteral(new Timestamp(1320883518391L), Timestamp.class), TypeFacility.RUNTIME_NAMES.STRING, "cast('2011-11-09 18:05:18.391' AS string)");
- }
-
- @Test
- public void testEqualityJoinCriteria() throws Exception {
- String input = "SELECT A.intkey FROM BQT1.SMALLA A JOIN BQT1.SmallB B on A.intkey=B.intkey";
- String output = "SELECT A.IntKey FROM SmallA A JOIN SmallB B ON A.IntKey = B.IntKey";
- helpTestVisitor(bqt, input, output);
- }
-
- @Test
- public void testCrossJoinCriteria() throws Exception {
- String input = "SELECT A.intkey FROM BQT1.SMALLA A Cross join BQT1.SmallB B";
- String output = "SELECT A.IntKey FROM SmallA A JOIN SmallB B";
- helpTestVisitor(bqt, input, output);
- }
-
-
- @Test
- public void testMustHaveAliasOnView() throws Exception {
- String input = "SELECT intkey FROM (select intkey from BQT1.SmallA) as X";
- String output = "SELECT X.intkey FROM (SELECT SmallA.IntKey FROM SmallA) X";
- helpTestVisitor(bqt, input, output);
- }
-
- @Test
- public void testUnionAllRewrite() throws Exception {
- String input = "SELECT intkey, stringkey FROM BQT1.SmallA union all SELECT intkey, stringkey FROM BQT1.Smallb";
- String output = "SELECT intkey, stringkey FROM (SELECT SmallA.IntKey, SmallA.StringKey FROM SmallA UNION ALL SELECT SmallB.IntKey, SmallB.StringKey FROM SmallB) X__";
- helpTestVisitor(bqt, input, output);
- }
-
- @Test
- public void testUnionAllExprRewrite() throws Exception {
- String input = "SELECT count(*) as key, stringkey FROM BQT1.SmallA union all SELECT intkey, stringkey FROM BQT1.Smallb";
- String output = "SELECT key, stringkey FROM (SELECT COUNT(*) AS key, SmallA.StringKey FROM SmallA UNION ALL SELECT SmallB.IntKey, SmallB.StringKey FROM SmallB) X__";
- helpTestVisitor(bqt, input, output);
- }
-
- @Test
- public void testUnionRewrite() throws Exception {
- String input = "SELECT intkey, stringkey FROM BQT1.SmallA union SELECT intkey, stringkey FROM BQT1.Smallb";
- String output = "SELECT DISTINCT intkey, stringkey FROM (SELECT SmallA.IntKey, SmallA.StringKey FROM SmallA UNION ALL SELECT SmallB.IntKey, SmallB.StringKey FROM SmallB) X__";
- helpTestVisitor(bqt, input, output);
- }
-
-
- public static TransformationMetadata exampleBQT() {
- MetadataStore metadataStore = new MetadataStore();
- Schema bqt1 = RealMetadataFactory.createPhysicalModel("BQT1", metadataStore); //$NON-NLS-1$
- Table bqt1SmallA = RealMetadataFactory.createPhysicalGroup("SmallA", bqt1); //$NON-NLS-1$
- Table bqt1SmallB = RealMetadataFactory.createPhysicalGroup("SmallB", bqt1); //$NON-NLS-1$
- String[] elemNames = new String[] {
- "IntKey", "StringKey", //$NON-NLS-1$ //$NON-NLS-2$
- "IntNum", "StringNum", //$NON-NLS-1$ //$NON-NLS-2$
- "FloatNum", "LongNum", //$NON-NLS-1$ //$NON-NLS-2$
- "DoubleNum", "ByteNum", //$NON-NLS-1$ //$NON-NLS-2$
- "DateValue", "TimeValue", //$NON-NLS-1$ //$NON-NLS-2$
- "TimestampValue", "BooleanValue", //$NON-NLS-1$ //$NON-NLS-2$
- "CharValue", "ShortValue", //$NON-NLS-1$ //$NON-NLS-2$
- "BigIntegerValue", "BigDecimalValue", //$NON-NLS-1$ //$NON-NLS-2$
- "ObjectValue" }; //$NON-NLS-1$
-
- String[] nativeTypes = new String[] { DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.STRING,
- DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.STRING,
- DataTypeManager.DefaultDataTypes.FLOAT, DataTypeManager.DefaultDataTypes.BIG_INTEGER,
- DataTypeManager.DefaultDataTypes.DOUBLE, DataTypeManager.DefaultDataTypes.BYTE,
- DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING,
- DataTypeManager.DefaultDataTypes.TIMESTAMP, DataTypeManager.DefaultDataTypes.BOOLEAN,
- DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.SHORT,
- DataTypeManager.DefaultDataTypes.BIG_INTEGER, DataTypeManager.DefaultDataTypes.BIG_INTEGER,
- DataTypeManager.DefaultDataTypes.STRING};
-
- String[] runtimeTypes = new String[] { DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.STRING,
- DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.STRING,
- DataTypeManager.DefaultDataTypes.FLOAT, DataTypeManager.DefaultDataTypes.LONG,
- DataTypeManager.DefaultDataTypes.DOUBLE, DataTypeManager.DefaultDataTypes.BYTE,
- DataTypeManager.DefaultDataTypes.DATE, DataTypeManager.DefaultDataTypes.TIME,
- DataTypeManager.DefaultDataTypes.TIMESTAMP, DataTypeManager.DefaultDataTypes.BOOLEAN,
- DataTypeManager.DefaultDataTypes.CHAR, DataTypeManager.DefaultDataTypes.SHORT,
- DataTypeManager.DefaultDataTypes.BIG_INTEGER, DataTypeManager.DefaultDataTypes.BIG_DECIMAL,
- DataTypeManager.DefaultDataTypes.OBJECT };
-
- List<Column> bqt1SmallAe = RealMetadataFactory.createElements(bqt1SmallA, elemNames, nativeTypes);
- List<Column> bqt1SmallBe = RealMetadataFactory.createElements(bqt1SmallB, elemNames, nativeTypes);
-
- Schema vqt = RealMetadataFactory.createVirtualModel("VQT", metadataStore); //$NON-NLS-1$
- QueryNode vqtn1 = new QueryNode("SELECT * FROM BQT1.SmallA"); //$NON-NLS-1$
- Table vqtg1 = RealMetadataFactory.createUpdatableVirtualGroup("SmallA", vqt, vqtn1); //$NON-NLS-1$
- RealMetadataFactory.createElements(vqtg1, elemNames, runtimeTypes);
-
- return RealMetadataFactory.createTransformationMetadata(metadataStore, "bqt");//$NON-NLS-1$
- }
-}
Copied: branches/as7/connectors/translator-hive/src/test/java/org/teiid/translator/hive/TestHiveExecutionFactory.java (from rev 3666, trunk/connectors/translator-hive/src/test/java/org/teiid/translator/hive/TestHiveExecutionFactory.java)
===================================================================
--- branches/as7/connectors/translator-hive/src/test/java/org/teiid/translator/hive/TestHiveExecutionFactory.java (rev 0)
+++ branches/as7/connectors/translator-hive/src/test/java/org/teiid/translator/hive/TestHiveExecutionFactory.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,168 @@
+package org.teiid.translator.hive;
+
+import static org.junit.Assert.assertEquals;
+
+import java.math.BigInteger;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.teiid.cdk.CommandBuilder;
+import org.teiid.core.types.DataTypeManager;
+import org.teiid.language.Command;
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.LanguageFactory;
+import org.teiid.metadata.Column;
+import org.teiid.metadata.MetadataStore;
+import org.teiid.metadata.Schema;
+import org.teiid.metadata.Table;
+import org.teiid.query.mapping.relational.QueryNode;
+import org.teiid.query.metadata.QueryMetadataInterface;
+import org.teiid.query.metadata.TransformationMetadata;
+import org.teiid.query.unittest.RealMetadataFactory;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+import org.teiid.translator.jdbc.TranslatedCommand;
+
+@SuppressWarnings("nls")
+public class TestHiveExecutionFactory {
+
+ private static HiveExecutionFactory hiveTranslator;
+ private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
+ private static TransformationMetadata bqt;
+
+ @BeforeClass
+ public static void setUp() throws TranslatorException {
+ hiveTranslator = new HiveExecutionFactory();
+ hiveTranslator.setUseBindVariables(false);
+ hiveTranslator.start();
+ bqt = exampleBQT();
+ }
+
+ private void helpTest(Expression srcExpression, String tgtType, String expectedExpression) throws Exception {
+ Function func = LANG_FACTORY.createFunction("convert", Arrays.asList( srcExpression,LANG_FACTORY.createLiteral(tgtType, String.class)),TypeFacility.getDataTypeClass(tgtType));
+ SQLConversionVisitor sqlVisitor = hiveTranslator.getSQLConversionVisitor();
+ sqlVisitor.append(func);
+ assertEquals("Error converting from " + srcExpression.getType() + " to " + tgtType, expectedExpression,sqlVisitor.toString());
+ }
+
+ private void helpTestVisitor(QueryMetadataInterface metadata, String input, String expectedOutput) throws TranslatorException {
+ // Convert from sql to objects
+ CommandBuilder commandBuilder = new CommandBuilder(metadata);
+ Command obj = commandBuilder.getCommand(input);
+
+ // Convert back to SQL
+ TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), hiveTranslator);
+ tc.translateCommand(obj);
+
+ // Check stuff
+ assertEquals("Did not get correct sql", expectedOutput, tc.getSql()); //$NON-NLS-1$
+ }
+
+ @Test public void testConvertions() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(Boolean.TRUE, Boolean.class), TypeFacility.RUNTIME_NAMES.BOOLEAN, "cast(true AS boolean)");
+ helpTest(LANG_FACTORY.createLiteral(Byte.parseByte("123"), Byte.class), TypeFacility.RUNTIME_NAMES.BYTE, "cast(123 AS tinyint)");
+ helpTest(LANG_FACTORY.createLiteral(new Integer(12345), Integer.class), TypeFacility.RUNTIME_NAMES.INTEGER, "cast(12345 AS int)");
+ helpTest(LANG_FACTORY.createLiteral(Short.parseShort("1234"), Short.class), TypeFacility.RUNTIME_NAMES.SHORT, "cast(1234 AS smallint)");
+ helpTest(LANG_FACTORY.createLiteral(new BigInteger("123451266182"), BigInteger.class), TypeFacility.RUNTIME_NAMES.BIG_INTEGER, "cast(123451266182 AS bigint)");
+ helpTest(LANG_FACTORY.createLiteral(new String("foo-bar"), String.class), TypeFacility.RUNTIME_NAMES.STRING, "cast('foo-bar' AS string)");
+ helpTest(LANG_FACTORY.createLiteral(Boolean.TRUE, Boolean.class), TypeFacility.RUNTIME_NAMES.STRING, "cast(true AS string)");
+ //helpTest(LANG_FACTORY.createLiteral(new Timestamp(1320883518391L), Timestamp.class), TypeFacility.RUNTIME_NAMES.STRING, "cast('2011-11-09 18:05:18.391' AS string)");
+ }
+
+ @Test
+ public void testEqualityJoinCriteria() throws Exception {
+ String input = "SELECT A.intkey FROM BQT1.SMALLA A JOIN BQT1.SmallB B on A.intkey=B.intkey";
+ String output = "SELECT A.IntKey FROM SmallA A JOIN SmallB B ON A.IntKey = B.IntKey";
+ helpTestVisitor(bqt, input, output);
+ }
+
+ @Test
+ public void testCrossJoinCriteria() throws Exception {
+ String input = "SELECT A.intkey FROM BQT1.SMALLA A Cross join BQT1.SmallB B";
+ String output = "SELECT A.IntKey FROM SmallA A JOIN SmallB B";
+ helpTestVisitor(bqt, input, output);
+ }
+
+
+ @Test
+ public void testMustHaveAliasOnView() throws Exception {
+ String input = "SELECT intkey FROM (select intkey from BQT1.SmallA) as X";
+ String output = "SELECT X.intkey FROM (SELECT SmallA.IntKey FROM SmallA) X";
+ helpTestVisitor(bqt, input, output);
+ }
+
+ @Test
+ public void testUnionAllRewrite() throws Exception {
+ String input = "SELECT intkey, stringkey FROM BQT1.SmallA union all SELECT intkey, stringkey FROM BQT1.Smallb";
+ String output = "SELECT intkey, stringkey FROM (SELECT SmallA.IntKey, SmallA.StringKey FROM SmallA UNION ALL SELECT SmallB.IntKey, SmallB.StringKey FROM SmallB) X__";
+ helpTestVisitor(bqt, input, output);
+ }
+
+ @Test
+ public void testUnionAllExprRewrite() throws Exception {
+ String input = "SELECT count(*) as key, stringkey FROM BQT1.SmallA union all SELECT intkey, stringkey FROM BQT1.Smallb";
+ String output = "SELECT key, stringkey FROM (SELECT COUNT(*) AS key, SmallA.StringKey FROM SmallA UNION ALL SELECT SmallB.IntKey, SmallB.StringKey FROM SmallB) X__";
+ helpTestVisitor(bqt, input, output);
+ }
+
+ @Test
+ public void testUnionRewrite() throws Exception {
+ String input = "SELECT intkey, stringkey FROM BQT1.SmallA union SELECT intkey, stringkey FROM BQT1.Smallb";
+ String output = "SELECT DISTINCT intkey, stringkey FROM (SELECT SmallA.IntKey, SmallA.StringKey FROM SmallA UNION ALL SELECT SmallB.IntKey, SmallB.StringKey FROM SmallB) X__";
+ helpTestVisitor(bqt, input, output);
+ }
+
+
+ public static TransformationMetadata exampleBQT() {
+ MetadataStore metadataStore = new MetadataStore();
+ Schema bqt1 = RealMetadataFactory.createPhysicalModel("BQT1", metadataStore); //$NON-NLS-1$
+ Table bqt1SmallA = RealMetadataFactory.createPhysicalGroup("SmallA", bqt1); //$NON-NLS-1$
+ Table bqt1SmallB = RealMetadataFactory.createPhysicalGroup("SmallB", bqt1); //$NON-NLS-1$
+ String[] elemNames = new String[] {
+ "IntKey", "StringKey", //$NON-NLS-1$ //$NON-NLS-2$
+ "IntNum", "StringNum", //$NON-NLS-1$ //$NON-NLS-2$
+ "FloatNum", "LongNum", //$NON-NLS-1$ //$NON-NLS-2$
+ "DoubleNum", "ByteNum", //$NON-NLS-1$ //$NON-NLS-2$
+ "DateValue", "TimeValue", //$NON-NLS-1$ //$NON-NLS-2$
+ "TimestampValue", "BooleanValue", //$NON-NLS-1$ //$NON-NLS-2$
+ "CharValue", "ShortValue", //$NON-NLS-1$ //$NON-NLS-2$
+ "BigIntegerValue", "BigDecimalValue", //$NON-NLS-1$ //$NON-NLS-2$
+ "ObjectValue" }; //$NON-NLS-1$
+
+ String[] nativeTypes = new String[] { DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.STRING,
+ DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.STRING,
+ DataTypeManager.DefaultDataTypes.FLOAT, DataTypeManager.DefaultDataTypes.BIG_INTEGER,
+ DataTypeManager.DefaultDataTypes.DOUBLE, DataTypeManager.DefaultDataTypes.BYTE,
+ DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING,
+ DataTypeManager.DefaultDataTypes.TIMESTAMP, DataTypeManager.DefaultDataTypes.BOOLEAN,
+ DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.SHORT,
+ DataTypeManager.DefaultDataTypes.BIG_INTEGER, DataTypeManager.DefaultDataTypes.BIG_INTEGER,
+ DataTypeManager.DefaultDataTypes.STRING};
+
+ String[] runtimeTypes = new String[] { DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.STRING,
+ DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.STRING,
+ DataTypeManager.DefaultDataTypes.FLOAT, DataTypeManager.DefaultDataTypes.LONG,
+ DataTypeManager.DefaultDataTypes.DOUBLE, DataTypeManager.DefaultDataTypes.BYTE,
+ DataTypeManager.DefaultDataTypes.DATE, DataTypeManager.DefaultDataTypes.TIME,
+ DataTypeManager.DefaultDataTypes.TIMESTAMP, DataTypeManager.DefaultDataTypes.BOOLEAN,
+ DataTypeManager.DefaultDataTypes.CHAR, DataTypeManager.DefaultDataTypes.SHORT,
+ DataTypeManager.DefaultDataTypes.BIG_INTEGER, DataTypeManager.DefaultDataTypes.BIG_DECIMAL,
+ DataTypeManager.DefaultDataTypes.OBJECT };
+
+ List<Column> bqt1SmallAe = RealMetadataFactory.createElements(bqt1SmallA, elemNames, nativeTypes);
+ List<Column> bqt1SmallBe = RealMetadataFactory.createElements(bqt1SmallB, elemNames, nativeTypes);
+
+ Schema vqt = RealMetadataFactory.createVirtualModel("VQT", metadataStore); //$NON-NLS-1$
+ QueryNode vqtn1 = new QueryNode("SELECT * FROM BQT1.SmallA"); //$NON-NLS-1$
+ Table vqtg1 = RealMetadataFactory.createUpdatableVirtualGroup("SmallA", vqt, vqtn1); //$NON-NLS-1$
+ RealMetadataFactory.createElements(vqtg1, elemNames, runtimeTypes);
+
+ return RealMetadataFactory.createTransformationMetadata(metadataStore, "bqt");//$NON-NLS-1$
+ }
+}
Modified: branches/as7/connectors/translator-jdbc/pom.xml
===================================================================
--- branches/as7/connectors/translator-jdbc/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-jdbc/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jdbc</artifactId>
Modified: branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ConvertModifier.java
===================================================================
--- branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ConvertModifier.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ConvertModifier.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -44,11 +44,20 @@
* etc.
* <p>The choice of conversion logic is as follows:
* <ul>
- * <li>Look for a specific conversion between the source and target - {@link #addConvert(int, int, FunctionModifier)}</li>
+ * <li>Provide specific conversion between the source and target - {@link #addConvert(int, int, FunctionModifier)}
+ * mostly one do not need to provide any conversion if the default is cast(srcType AS targetType), however if the source
+ * database requires different specific format for example to cast(srctype, targetType FORMAT 'more-info') this conversion needs to be added</li>
* <li>Filter common implicit conversions</li>
* <li>Look for a general source conversion - {@link #addSourceConversion(FunctionModifier, int...)}</li>
- * <li>Look for a general target conversion - {@link #addTypeConversion(FunctionModifier, int...)}</li>
- * <li>Look for a type mapping, which will replace the target type with the given native type - {@link #addTypeMapping(String, int...)}</li>
+ * <li>Look for a general target conversion - {@link #addTypeConversion(FunctionModifier, int...)}. If the source
+ * database provides a specific function for converting *any* source datatype to this target datatype then use this to define it.
+ * Like in oracle "to_char" function will convert any other data type to string. Use this to define those kind of conversions
+ * convert any data type to string. so you can use this for purpose.</li>
+ * <li>Type maps from database data type to Teiid runtime types. - {@link #addTypeMapping(String, int...)}
+ * define mappings for every datatype available in database. The cast operation will replace the target type (teiid type) with the given
+ * native type in the cast operation generated. Do not need to really look at implicit/explicit conversions that are
+ * supported by the source database, because when a cast is defined on the sql it is up to the source database to apply it
+ * as implicit or explicit operation. Teiid generates cast always when needed</li>
* <li>Drop the conversion</li>
* </ul>
*/
Property changes on: branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/FunctionModifier.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/FunctionModifier.java:3535-3555
+ /branches/7.4.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/FunctionModifier.java:3535-3555
/trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/FunctionModifier.java:3598-3666
Modified: branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java
===================================================================
--- branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -205,11 +205,11 @@
buffer.append(o);
} else {
Integer i = (Integer)o;
- if (obj.getArguments().size() <= i) {
- throw new IllegalArgumentException("Invalid parameter {0}. Must be less than or equal to {1}.");
+ if (i < 0 || i >= obj.getArguments().size()) {
+ throw new IllegalArgumentException(JDBCPlugin.Util.getString("SQLConversionVisitor.invalid_parameter", i+1, obj.getArguments().size())); //$NON-NLS-1$
}
if (obj.getArguments().get(i).getDirection() != Direction.IN) {
- throw new IllegalArgumentException("Native query procedures cannot use non IN parameters.");
+ throw new IllegalArgumentException(JDBCPlugin.Util.getString("SQLConversionVisitor.not_in_parameter", i+1)); //$NON-NLS-1$
}
visit(obj.getArguments().get(i));
if (this.prepared) {
@@ -229,22 +229,22 @@
}
private List<Object> parseNativeQueryParts(String nativeQuery) {
- Pattern pattern = Pattern.compile("\\$(\\$\\$)*\\d+"); //$NON-NLS-1$
+ Pattern pattern = Pattern.compile("\\$+\\d+"); //$NON-NLS-1$
List<Object> parts = new LinkedList<Object>();
Matcher m = pattern.matcher(nativeQuery);
for (int i = 0; i < nativeQuery.length(); i++) {
if (!m.find(i)) {
- parts.add(nativeQuery.substring(i).replaceAll("\\$\\$", "\\$")); //$NON-NLS-1$ //$NON-NLS-2$
+ parts.add(nativeQuery.substring(i));
break;
}
if (m.start() != i) {
- parts.add(nativeQuery.substring(i, m.start()).replaceAll("\\$\\$", "\\$")); //$NON-NLS-1$ //$NON-NLS-2$
+ parts.add(nativeQuery.substring(i, m.start()));
}
String match = m.group();
int end = match.lastIndexOf('$');
if ((end&0x1) == 1) {
//escaped
- parts.add(match.replaceAll("\\$\\$", "\\$")); //$NON-NLS-1$ //$NON-NLS-2$
+ parts.add(match.substring((end+1)/2));
} else {
if (end != 0) {
parts.add(match.substring(0, end/2));
Modified: branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
===================================================================
--- branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -54,6 +54,8 @@
import org.teiid.language.SQLConstants.Tokens;
import org.teiid.language.SetQuery.Operation;
import org.teiid.language.visitor.CollectorVisitor;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.SourceSystemFunctions;
@@ -66,6 +68,7 @@
import org.teiid.translator.jdbc.ExtractFunctionModifier;
import org.teiid.translator.jdbc.FunctionModifier;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.JDBCPlugin;
import org.teiid.translator.jdbc.LocateFunctionModifier;
import org.teiid.translator.jdbc.TranslatedCommand;
@@ -79,6 +82,7 @@
private static final String TIMESTAMP_FORMAT = DATETIME_FORMAT + ".FF"; //$NON-NLS-1$
public final static String HINT_PREFIX = "/*+"; //$NON-NLS-1$
+ public static final String HINT_SUFFIX = "*/"; //$NON-NLS-1$
public final static String DUAL = "DUAL"; //$NON-NLS-1$
public final static String ROWNUM = "ROWNUM"; //$NON-NLS-1$
public final static String SEQUENCE = ":SEQUENCE="; //$NON-NLS-1$
@@ -345,17 +349,44 @@
public String getSourceComment(ExecutionContext context, Command command) {
String comment = super.getSourceComment(context, command);
+ boolean usingPayloadComment = false;
if (context != null) {
// Check for db hints
Object payload = context.getExecutionPayload();
if (payload instanceof String) {
String payloadString = (String)payload;
if (payloadString.startsWith(HINT_PREFIX)) {
- comment += payloadString + " "; //$NON-NLS-1$
+ int i = payloadString.indexOf(HINT_SUFFIX);
+ if (i > 0 && payloadString.substring(i + 2).trim().length() == 0) {
+ comment += payloadString + " "; //$NON-NLS-1$
+ usingPayloadComment = true;
+ } else {
+ String msg = JDBCPlugin.Util.getString("OraleExecutionFactory.invalid_hint", "Execution Payload", payloadString); //$NON-NLS-1$ //$NON-NLS-2$
+ context.addWarning(new TranslatorException(msg));
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR, msg);
+ }
}
}
}
+ if (!usingPayloadComment && context != null) {
+ String hint = null;
+ hint = context.getSourceHint();
+ if (hint == null) {
+ hint = context.getGeneralHint();
+ }
+ if (hint != null) {
+ //append a source hint
+ if (!hint.contains(HINT_PREFIX)) {
+ comment += HINT_PREFIX + ' ' + hint + ' ' + HINT_SUFFIX + ' ';
+ } else {
+ String msg = JDBCPlugin.Util.getString("OraleExecutionFactory.invalid_hint", "Source Hint", hint); //$NON-NLS-1$ //$NON-NLS-2$
+ context.addWarning(new TranslatorException(msg));
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR, msg);
+ }
+ }
+ }
+
if (command instanceof Select) {
//
// This simple algorithm determines the hint which will be added to the
Deleted: branches/as7/connectors/translator-jdbc/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/translator-jdbc/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-jdbc/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1 +0,0 @@
-Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Modified: branches/as7/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties
===================================================================
--- branches/as7/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties 2011-11-17 22:30:19 UTC (rev 3667)
@@ -26,7 +26,8 @@
JDBCQueryExecution.Error_executing_query__1 = ''{0}'' error executing statement(s): {1}
-
-
+SQLConversionVisitor.invalid_parameter=Invalid parameter {0}. Must be between 1 and {1}.
+SQLConversionVisitor.not_in_parameter=Invalid parameter {0}. Native query procedures cannot use non IN parameters.
+OraleExecutionFactory.invalid_hint=Not using oracle execution payload {0} as hint, since it apprears to contain more than just a single comment.
ConnectionListener.failed_to_report_jdbc_connection_details=Failed to report the JDBC driver and connection information
JDBCMetadataProcessor.not_unique=Teiid runtime names, which are case insensitive, for the imported metadata are not unique. If not already set, use the setting importer.useFullSchemaName to create Teiid names that include the source schema.
\ No newline at end of file
Property changes on: branches/as7/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres:3535-3555*
/trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres:3507-3597
+ /branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres:3535-3555*
/trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres:3507-3666
Property changes on: branches/as7/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresConvertModifier.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresConvertModifier.java:3535-3555
/trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresConvertModifier.java:3507-3597
+ /branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresConvertModifier.java:3535-3555
/trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresConvertModifier.java:3507-3666
Property changes on: branches/as7/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresExecutionFactory.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresExecutionFactory.java:3535-3555
/trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresExecutionFactory.java:3507-3597
+ /branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresExecutionFactory.java:3535-3555
/trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresExecutionFactory.java:3507-3666
Modified: branches/as7/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
===================================================================
--- branches/as7/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -77,6 +77,18 @@
helpTestVisitor(getOracleSpecificMetadata(), input, EMPTY_CONTEXT, null, expectedOutput);
}
+ @Test public void testSourceHint() throws Exception {
+ ExecutionContextImpl impl = new FakeExecutionContextImpl();
+ impl.setHint("hello world");
+ helpTestVisitor(getTestVDB(), "select part_name from parts", impl, null, "SELECT /*+ hello world */ g_0.PART_NAME FROM PARTS g_0", true);
+ }
+
+ @Test public void testSourceHint1() throws Exception {
+ ExecutionContextImpl impl = new FakeExecutionContextImpl();
+ impl.setHint("hello world");
+ helpTestVisitor(getTestVDB(), "select part_name from parts union select part_id from parts", impl, null, "SELECT /*+ hello world */ g_1.PART_NAME AS c_0 FROM PARTS g_1 UNION SELECT g_0.PART_ID AS c_0 FROM PARTS g_0", true);
+ }
+
@Test public void testInsertWithSequnce() throws Exception {
helpTestVisitor("insert into smalla (doublenum) values (1)", "INSERT INTO SmallishA (DoubleNum, ID) VALUES (1.0, MYSEQUENCE.nextVal)"); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -702,6 +714,21 @@
false);
}
+ @Test public void testOracleCommentPayload1() throws Exception {
+ String input = "SELECT part_name, rownum FROM parts"; //$NON-NLS-1$
+ String output = "SELECT PARTS.PART_NAME, ROWNUM FROM PARTS"; //$NON-NLS-1$
+
+ String hint = "/*+ ALL_ROWS */ something else"; //$NON-NLS-1$
+ ExecutionContext context = new ExecutionContextImpl(null, 1, hint, null, "", null, null, null); //$NON-NLS-1$
+
+ helpTestVisitor(getTestVDB(),
+ input,
+ context,
+ null,
+ output,
+ false);
+ }
+
/**
* reproducing this case relies on the name in source for the table being different from
* the name
@@ -788,7 +815,7 @@
@Test public void testRowLimitWithUnionOrderBy() throws Exception {
String input = "(select intkey from bqt1.smalla limit 50, 100) union select intnum from bqt1.smalla order by intkey"; //$NON-NLS-1$
- String output = "SELECT c_0 FROM (SELECT VIEW_FOR_LIMIT.*, ROWNUM ROWNUM_ FROM (SELECT g_1.IntKey AS c_0 FROM SmallA g_1) VIEW_FOR_LIMIT WHERE ROWNUM <= 150) WHERE ROWNUM_ > 50 UNION SELECT g_0.IntNum AS c_0 FROM SmallA g_0 ORDER BY c_0"; //$NON-NLS-1$
+ String output = "(SELECT c_0 FROM (SELECT VIEW_FOR_LIMIT.*, ROWNUM ROWNUM_ FROM (SELECT g_1.IntKey AS c_0 FROM SmallA g_1) VIEW_FOR_LIMIT WHERE ROWNUM <= 150) WHERE ROWNUM_ > 50) UNION SELECT g_0.IntNum AS c_0 FROM SmallA g_0 ORDER BY c_0"; //$NON-NLS-1$
CommandBuilder commandBuilder = new CommandBuilder(RealMetadataFactory.exampleBQTCached());
Command obj = commandBuilder.getCommand(input, true, true);
Modified: branches/as7/connectors/translator-ldap/pom.xml
===================================================================
--- branches/as7/connectors/translator-ldap/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-ldap/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ldap</artifactId>
Property changes on: branches/as7/connectors/translator-ldap/src/main/java/org/teiid/translator
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/translator-ldap/src/main/java/org/teiid/translator:3535-3555*
/trunk/connectors/translator-ldap/src/main/java/org/teiid/translator:3507-3597
+ /branches/7.4.x/connectors/translator-ldap/src/main/java/org/teiid/translator:3535-3555*
/trunk/connectors/translator-ldap/src/main/java/org/teiid/translator:3507-3666
Property changes on: branches/as7/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap:3535-3555
/trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap:3507-3597
+ /branches/7.4.x/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap:3535-3555
/trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap:3507-3666
Modified: branches/as7/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
===================================================================
--- branches/as7/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -331,9 +331,11 @@
} catch (SizeLimitExceededException e) {
if (resultCount != searchDetails.getCountLimit()) {
String msg = "LDAP Search results exceeded size limit. Results may be incomplete."; //$NON-NLS-1$
+ TranslatorException te = new TranslatorException(e, msg);
if (executionFactory.isExceptionOnSizeLimitExceeded()) {
- throw new TranslatorException(e, msg);
+ throw te;
}
+ this.executionContext.addWarning(te);
LogManager.logWarning(LogConstants.CTX_CONNECTOR, e, msg);
}
return null; // GHH 20080326 - if size limit exceeded don't try to read more results
Deleted: branches/as7/connectors/translator-ldap/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/translator-ldap/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-ldap/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1 +0,0 @@
-Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Modified: branches/as7/connectors/translator-loopback/pom.xml
===================================================================
--- branches/as7/connectors/translator-loopback/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-loopback/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-loopback</artifactId>
Deleted: branches/as7/connectors/translator-loopback/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/translator-loopback/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-loopback/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1 +0,0 @@
-Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Modified: branches/as7/connectors/translator-olap/pom.xml
===================================================================
--- branches/as7/connectors/translator-olap/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-olap/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-olap</artifactId>
Deleted: branches/as7/connectors/translator-olap/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/translator-olap/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-olap/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1 +0,0 @@
-Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Modified: branches/as7/connectors/translator-salesforce/pom.xml
===================================================================
--- branches/as7/connectors/translator-salesforce/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-salesforce/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-salesforce</artifactId>
Deleted: branches/as7/connectors/translator-salesforce/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/translator-salesforce/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-salesforce/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1 +0,0 @@
-Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Modified: branches/as7/connectors/translator-ws/pom.xml
===================================================================
--- branches/as7/connectors/translator-ws/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-ws/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Deleted: branches/as7/connectors/translator-ws/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- branches/as7/connectors/translator-ws/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-ws/src/main/resources/META-INF/MANIFEST.MF 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1 +0,0 @@
-Dependencies: org.jboss.teiid.common-core org.jboss.teiid.api
Deleted: branches/as7/connectors/translator-ws/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- branches/as7/connectors/translator-ws/src/main/resources/META-INF/jboss-beans.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/connectors/translator-ws/src/main/resources/META-INF/jboss-beans.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean name="translator-ws-template" class="org.teiid.templates.TranslatorDeploymentTemplate">
- <property name="info"><inject bean="translator-ws"/></property>
- <property name="managedObjectFactory"><inject bean="ManagedObjectFactory"/></property>
- </bean>
-
- <bean name="translator-ws" class="org.teiid.templates.TranslatorTemplateInfo">
- <constructor factoryMethod="createTemplateInfo">
- <factory bean="TranslatorDeploymentTemplateInfoFactory"/>
- <parameter class="java.lang.Class">org.teiid.templates.TranslatorTemplateInfo</parameter>
- <parameter class="java.lang.Class">org.teiid.translator.ws.WSExecutionFactory</parameter>
- <parameter class="java.lang.String">translator-ws</parameter>
- <parameter class="java.lang.String">ws</parameter>
- </constructor>
- </bean>
-
-</deployment>
\ No newline at end of file
Modified: branches/as7/console/pom.xml
===================================================================
--- branches/as7/console/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/console/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: branches/as7/documentation/admin-guide/pom.xml
===================================================================
--- branches/as7/documentation/admin-guide/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/admin-guide/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>admin-guide</artifactId>
Modified: branches/as7/documentation/admin-guide/src/main/docbook/en-US/content/security.xml
===================================================================
--- branches/as7/documentation/admin-guide/src/main/docbook/en-US/content/security.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/admin-guide/src/main/docbook/en-US/content/security.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -10,8 +10,9 @@
<section>
<title>Authentication</title>
<para>JDBC clients may use simple passwords to authenticate a user.</para>
+
<para>Typically a user name is required, however user names may be considered optional if the
- identity of the user can be discerned by the password credential alone. In
+ identity of the user can be discerned by the password credential alone. In
any case it is up to the configured security domain to determine whether a user can be
authenticated. If you need authentication, the administrator must configure a LoginModule to be used with Teiid.
See below for more information on how configure the Login module in JBoss AS.</para>
@@ -25,25 +26,26 @@
<section>
<title>Pass-through Authentication</title>
<para>If your client application (web application or Web service) resides in the same JBoss AS instance as Teiid and
- client application uses a security-domain to handle the security concerns, then you can configure Teiid to use the
- same security-domain and not force the user to re-authenticate for using Teiid. In this case Teiid looks for a authenticated
- subject in the calling thread context and uses for its session and authorization purposes. To configure Teiid for this
- pass-through authentication mechanism, you need change the Teiid's security-domain name to same name as your
+ the client application uses a security-domain, then you can configure Teiid to use the
+ same security-domain and not force the user to re-authenticate. In this case Teiid looks for an authenticated
+ subject in the calling thread context and uses it for sessioning and authorization. To configure Teiid for
+ pass-through authentication, change the Teiid security-domain name to the same name as your
application's security domain name in the "standalone-teiid.xml" file in the "transport" section.
Please note that for this to work, the security-domain
- must be a JAAS based Login Module and your client application MUST obtain Teiid connection
- using <emphasis>Local</emphasis> Connection, with <emphasis>PassthroughAuthentication=true</emphasis> flag set.</para>
+ must be a JAAS based Login Module and your client application MUST obtain its Teiid connection
+ using a <emphasis>local/embedded</emphasis> connection with the<emphasis>PassthroughAuthentication=true</emphasis> connection flag set.</para>
</section>
</section>
<section>
<title>Authorization</title>
<para>Authorization covers both administrative activities and data
- roles. A data role is a collection of permissions (also referred to as entitlements) and a
+ roles. A data role is a collection of permissions (also referred to as entitlements) and a
collection of entitled principals or groups. With the deployment of a VDB
the deployer can choose which principals and groups have which data roles.</para>
</section>
<section>
<title>Encryption</title>
+
<para>At a transport level Teiid provides built-in support for JDBC
over SSL or just sensitive message encryption when SSL is not in use.
</para>
@@ -57,6 +59,7 @@
</section>
<section>
<title>LoginModules</title>
+
<para>
LoginModules are an essential part of the JAAS security
framework and provide Teiid customizable user authentication and the
@@ -69,7 +72,7 @@
that group together relevant LoginModules. Each of these application
policy (or domains) names can be used to fully
qualify user names to
- authenticate only against that domain. The format for a qualified
+ authenticate only against that domain. The format for a qualified
name is username@domainname.
</para>
<para>If a user name is not fully qualified, then the installed
@@ -77,6 +80,7 @@
successfully or unsuccessfully authenticates the
user.
</para>
+
<para>If no domain can authenticate the user, the login
attempt will fail.
Details of the failed attempt including invalid users, which
@@ -93,14 +97,15 @@
<section>
<title>Built-in LoginModules</title>
<para>JBossAS provides several LoginModules for common authentication needs, such as authenticating from a <xref linkend="text-login"/> or a <xref linkend="ldap-login"/>.</para>
+
<para>You can install multiple login modules as part of single security domain configuration and configure them
to part of login process. For example, for "teiid-security" domain, you can configure a file based and also LDAP based login modules,
- and have your user authenticated with either or both login modules. If you want to write your own custom login module, check out the Developer's Guide for instructions.
+ and have your user authenticated with either or both login modules. If you want to write your own custom login module, refer to the Developer's Guide for instructions.
</para>
<section id="text-login">
<title>Text Based LoginModule</title>
- <para>The UsersRolesLoginModule utilizes simple text files to authenticate users and to define their groups.
+ <para>The UsersRolesLoginModule utilizes simple text files to authenticate users and to define their groups.
The below XML fragment under "security" subsystem shows a Text based login module. Also see standalone-teiid.xml
configuration file contains an example of how to use UsersRolesLoginModule.
<programlisting><![CDATA[
@@ -119,6 +124,7 @@
<note><para>The UsersRolesLoginModule is not recommended for production use and is strongly recommended
that you replace this login module.</para></note>
</para>
+
<para>User names and passwords are stored in the
<jboss-as>/modules/org/jboss/teiid/main/conf/teiid-security-users.properties file.
These files must be available on classpath
@@ -161,14 +167,16 @@
<para>Reuse the teiid-security (or whatever name you choose) security domain for Teiid by changing the teiid configuration &jboss-beans; to point to teiid-security.
</para>
</listitem>
+
<listitem>
<para>Follow the same steps to configure an LDAP security domain named teiid-security.
</para>
</listitem>
</itemizedlist>
</para></listitem>
+
<listitem><para>Obscure the LDAP Password</para><para>Finally, protect the password following <ulink url="http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/5...">these instructions.</ulink>
- Note that the salt must be 8 chars and <ulink url="http://community.jboss.org/message/137756#137756">see</ulink> for more on securing passwords.
+ Note that the salt must be 8 chars and see also http://community.jboss.org/message/137756#137756 for more on securing passwords.
</para></listitem>
</orderedlist>
</para>
@@ -176,6 +184,7 @@
</section>
<section>
+
<title>Kerberos support through GSSAPI</title>
<para>Teiid supports kerberos authentication using GSSAPI, to be used with single sign-on applications.
This service ticket negotiation based authentication is supported through remote JDBC and ODBC drivers and LocalConnections.
@@ -188,6 +197,7 @@
authentication of your web-application with kerberos. When the web application authenticates with the provided
kerberos token, the same subject authenticated will be used in Teiid. For details about configuration, check the
JBoss Negotiation documentation.</para>
+
</section>
<section>
@@ -197,8 +207,7 @@
<transport name="jdbc" protocol="teiid" socket-binding="teiid-jdbc"/>
<authentication security-domain="teiid-security" krb5-domain="krb5-domain"/>
</transport>
-]]></programlisting>
-
+]]></programlisting>
Now we need to define a security domain context for kerberos with the name mentioned (kbr5-domain)in above.
Since kerberos authorization cannot define authorization roles, we'll define them using another login context.
Given below is a sample configuration to define roles using a UserRolesLoginModule.
@@ -262,10 +271,11 @@
Add the following URL connection properties to Teiid JDBC connection string
<programlisting><![CDATA[authenticationType=KRB5;jaasName=Client;kerberosServicePrincipleName=demo(a)EXAMPLE.COM]]></programlisting>
- There is no need to provide the user name and password, when the application is trying to make JDBC connection it
- will authenticate locally and use the same user credetinals to neogitiate service token with server and grant the
+ There is no need to provide the user name and password. When the application makes a JDBC connection, it
+ will authenticate locally and use the same user credentials to negotiate a service token with server and grant the
connection. See Client Developer's guide for information on connection properties and how to configure data sources.
</para>
+
</section>
</section>
@@ -277,9 +287,10 @@
</section>
<section>
+
<title>Security at Data Source level</title>
- <para>In some use cases, user might need to pass-in different credentials to their data sources based on the logged in user
- than using the shared credentials for all the logged users. To support this feature, JBoss AS and Teiid provide multiple different
+ <para>In some use cases, the user might need to pass-in different credentials to their data sources based on the logged in user
+ rather than using the shared credentials for all the logged users. To support this feature, JBoss AS and Teiid provide multiple different
login modules to be used in conjunction with Teiid's main security domain. See this
<ulink url="http://community.jboss.org/docs/DOC-9350">document</ulink> for details on configuration. Note that the below
directions need to be used in conjunction with this document.</para>
@@ -319,25 +330,26 @@
<para>In the above configuration example, in the primary login module "UsersRoles" is setup to hold the
passwords in the file, and when user logs in with password, the same password will be also set on the logged in Subject after
- authentication. This credentials can be extracted by the data source by asking for Subject's private credentials.</para>
+ authentication. These credentials can be extracted by the data source by asking for Subject's private credentials.</para>
- <para>To use a certificate or serialized object instead of plain password as the token, simply replace the simple text password
- with Base64 encoded contents of the serialized object. Please note that, encoding and decoding of this object
- is strictly up to the user as JBoss AS and Teiid will only act like carrier of the information from
+ <para>To use a certificate or serialized object instead of plain password as the token, replace the simple text password
+ with Base64 encoded contents of the serialized object. Please note that encoding and decoding of this object
+ is strictly up to the user as JBoss AS and Teiid will only act as a carrier of the information from
login module to connection factory. Using this CallerIdentity module, the connection pool for data source is segmented
by Subject.</para>
</section>
<section>
+
<title>Role Based Credential Map</title>
- <para>In some use cases, the users are divided by their functionality and they have varied level of security access to
+ <para>In some use cases, the users are divided by their functionality and they have varied levels of security access to
data sources. These types of users are identified by their roles as to what they have access to. In the above "CallerIdentity"
login scenario, that may be too fine-grained security at data sources, that can lead resource exhaustion as every user has
their own separate connection.
Using Role based security gives a balance, where the users with same role are treated equally
for authentication purposes at the data source. Teiid provides a login module called "RoleBasedCredentialMap"
- for this purposes, where administrator can define a role based authentication module, where given the role of the user
- from the primary login module, this module will hold credentail to that role. So, it is container of credentials that
- map to different roles. If a user has multiple roles, the first role that has the credential will be chosen.
+ for this purposes, where administrator can define a role-based authentication module, where given the role of the user
+ from the primary login module, this module will hold a credential to that role. So, it is the container of credentials that
+ maps to different roles. If a user has multiple roles, the first role that has the credential will be chosen.
Below find the sample configuration.</para>
<programlisting><![CDATA[<subsystem xmlns="urn:jboss:domain:security:1.1">
@@ -366,7 +378,7 @@
<programlisting><![CDATA[<security-domain>teiid-security</security-domain>]]></programlisting>
- <para>In the above configuration example, in the primary login module "UsersRolesLoginModule" is setup for logging in
+ <para>In the above configuration example, in the primary login module "UsersRolesLoginModule" is set up for logging in
the primary user and assign some roles. The "RoleBasedCredentialMap" login module is configured to hold
role to password information in the file defined by "credentialMap" property. When user logs in, the role information
from the primary login module is taken, and extracts the role's passsword and attaches as
@@ -402,6 +414,7 @@
<para>The Teiid's configuration file(s)
<code>standalone-teiid.xml/domain-teiid.xml</code>, contain transports defined for access to Teiid, and transport
contain the properties to configure SSL for socket per transport.</para>
+
<itemizedlist>
<para>There are two types of transports, each with it's own SSL configuration:</para>
<listitem><para>"teiid" - Default configuration to only encrypt login traffic, none of the other properties are used.</para></listitem>
@@ -416,6 +429,7 @@
</example>
<itemizedlist>
<title>Properties</title>
+
<listitem><para>mode - diabled|login|enabled, disabled = no transport or message level security will be used.
login = only the login traffic will be encrypted at a message level using 128 bit AES with an ephemerial DH key exchange. No other config values are needed in this mode.
enabled = traffic will be secured using the other configuration properties.</para></listitem>
@@ -425,7 +439,8 @@
<listitem><para>keymanagement-algorithm - Type of key algorithm used. Default
is based upon the VM, e.g. "SunX509"</para></listitem>
<listitem><para>keystore/name - The file name of the keystore, which contains the
- private key of the Server. This must be available in the classpath of Teiid Server.</para></listitem>
+ private key of the Server. The file name can be relative resource path available to the Teiid deployer classloader or an absolute file system path.
+ A typical installation would place the keystore file in the conf directory of the profile where Teiid is deployed with a file name relative to the conf path.</para></listitem>
<listitem><para>keystorePassword - password for the keystore.</para></listitem>
<listitem><para>truststore/name - if "authenticationMode" is chosen
as "2-way", then this property must be provided. This is the truststore that contains the
@@ -435,6 +450,7 @@
<listitem><para>enabled-cipher-suites - A comma separated list of cipher suites allowed for encryption between server and client. The values must be valid supported cipher suites otherwise SSL connections will fail.</para></listitem>
</itemizedlist>
<section id="ssl_auth">
+
<title>SSL Authentication Modes</title>
<para>SSL supports multiple authentication modes. In most secure intranet environments, anonymous is suitable to just bulk encrypt traffic without the need
to setup SSL certificates.
@@ -446,6 +462,7 @@
<listitem><para><emphasis>1-way</emphasis> - the server will present a certificate, which is obtained from the keystore related properties.
The client should have a truststore configured to accept the server certificate.
</para></listitem>
+
<listitem><para><emphasis>2-way</emphasis> - the server will present a certificate, which is obtained from the keystore related properties.
The client should have a truststore configured to accept the server certificate. The client is also expected to present a certificate, which is obtained from its
keystore. The client certificate should be accepted by the trust store configured by the truststore related properties.
@@ -458,6 +475,7 @@
1-way and 2-way SSL allow for cipher suite negotiation based upon the default cipher suites supported by the respective Java platforms of the client and server.
User can restrict the cipher suites used for encryption by specifying the <emphasis>enabledCipherSuites</emphasis> property above in ssl configuration.
</para>
+
</section>
</section>
-</chapter>
\ No newline at end of file
+</chapter>
Modified: branches/as7/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml
===================================================================
--- branches/as7/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -202,6 +202,24 @@
<code>ConfigName</code> property. The namespace URI for the QName in your config file should be http://teiid.org.
See the sections on WS-Security, Logging, etc. for examples of using the CXF configuration file.</para>
+ <example>
+ <title>Sample Spring XML Configuration To Set Timeouts</title>
+ <programlisting language="xml"><![CDATA[<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
+ xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration
+ http://cxf.apache.org/schemas/configuration/http-conf.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <http-conf:conduit name="{http://teiid.org}configName.http-conduit">
+ <http-conf:client ConnectionTimeout="120000" ReceiveTimeout="240000"/>
+ </http-conf:conduit>
+</beans>
+]]></programlisting>
+ <para>In the conduit name {http://teiid.org}configName.http-conduit, the namespace, http://teiid.org, is not configurable. The local name is followed by .http-conduit. It will be based upon the configName setting, with a default value of teiid.</para>
+ </example>
+
<para>See the <ulink url="http://cxf.apache.org/docs/">CXF documentation</ulink> for all possible configuration options.</para>
<note><para>The CXF configuration is currently only applicable to non-binary web service calls.</para></note>
</section>
Modified: branches/as7/documentation/caching-guide/pom.xml
===================================================================
--- branches/as7/documentation/caching-guide/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/caching-guide/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>caching-guide</artifactId>
Modified: branches/as7/documentation/client-developers-guide/pom.xml
===================================================================
--- branches/as7/documentation/client-developers-guide/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/client-developers-guide/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>client-developers-guide</artifactId>
Modified: branches/as7/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml
===================================================================
--- branches/as7/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-connection.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -258,27 +258,14 @@
</row>
<row>
<entry>
- <code>authenticationType</code>
- </entry>
- <entry>
- <code>String</code>
- </entry>
- <entry>
- <para>Type of authentication to use. Valid values are CLEARTEXT (default) and KRB5 (kerberos). See
- Admin Guide for configuration required for kerberos
- </para>
- </entry>
- </row>
- <row>
- <entry>
<code>jaasName</code>
</entry>
<entry>
<code>String</code>
</entry>
<entry>
- <para>JAAS configuration name. Only applies when configuring a kerberos authentication.
- See Admin Guide for configuration required for kerberos</para>
+ <para>JAAS configuration name. Only applies when configuring a GSS authentication.
+ See the Admin Guide for configuration required for GSS.</para>
</entry>
</row>
<row>
@@ -289,8 +276,8 @@
<code>String</code>
</entry>
<entry>
- <para>Kerberos authenticated principle name. Only applies when configuring a kerberos authentication.
- See Admin Guide for configuration required for kerberos</para>
+ <para>Kerberos authenticated principle name. Only applies when configuring a GSS authentication.
+ See the Admin Guide for configuration required for GSS</para>
</entry>
</row>
@@ -519,7 +506,7 @@
there is a way to make connections that by-pass making a socket based JDBC connection.
You can use slightly modified data source configuration to make a "local" connection, where the JDBC API will lookup a local Teiid runtime in the same VM.</para>
<warning><para>Since DataSources start before before Teiid VDBs are deployed, leave the min pool size of local connections as the default of 0. Otherwise errors will occur on the startup of the Teiid DataSource.</para></warning>
- <note><para>Be default local connections use their calling thread to perform processing operations rather than using an engine thread while the calling thread is blocked.
+ <note><para>By default local connections use their calling thread to perform processing operations rather than using an engine thread while the calling thread is blocked.
To disable this behavior set the connection property useCallingThreads=false.</para></note>
<example>
<title>Local data source</title>
Modified: branches/as7/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml
===================================================================
--- branches/as7/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/client-developers-guide/src/main/docbook/en-US/content/jdbc-extensions.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -389,4 +389,37 @@
</section>
</section>
+ <section>
+ <title>Non-blocking Statement Execution</title>
+ <para>JDBC query execution can indefinitely block the calling thread when a statement is executed or a resultset is being iterated.
+ In some situations you may wish to have your calling threads held in these blocked states. When using embedded connections, you may optionally use the
+ <code>org.teiid.jdbc.TeiidStatement</code> and <code>org.teiid.jdbc.TeiidPreparedStatement</code> interfaces to execute queries with a callback <code>org.teiid.jdbc.StatementCallback</code> that will be notified
+ of statement events, such as an available row, an exception, or completion. Your calling thread will be free to perform other work. The callback will be executed by an engine processing thread as needed. If your results processing is itself blocking and you want query processing to be concurrent with results processing, then your callback should implement onRow
+ handling in a multi-threaded manner to allow the engine thread to continue.
+ </para>
+ <example>
+ <title>Non-blocking Prepared Statement Execution</title>
+ <programlisting>PreparedStatemnt stmt = connection.prepareStatement(sql);
+TeiidPreparedStatement tStmt = stmt.unwrap(TeiidPreparedStatement.class);
+tStmt.submitExecute(new StatementCallback() {
+ @Override
+ public void onRow(Statement s, ResultSet rs) {
+ //any logic that accesses the current row ...
+ System.out.println(rs.getString(1));
+ }
+
+ @Override
+ public void onException(Statement s, Exception e) throws Exception {
+ s.close();
+ }
+
+ @Override
+ public void onComplete(Statement s) throws Exception {
+ s.close();
+ }
+);</programlisting>
+ </example>
+ <note><para>The non-blocking logic is limited to statement execution only. Other JDBC operations, such as connection creation or batched executions do not yet have non-blocking options.</para></note>
+ </section>
+
</chapter>
\ No newline at end of file
Modified: branches/as7/documentation/developer-guide/pom.xml
===================================================================
--- branches/as7/documentation/developer-guide/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/developer-guide/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>developer-guide</artifactId>
Modified: branches/as7/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
===================================================================
--- branches/as7/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -263,21 +263,37 @@
interface that defines how executions are
cancelled and closed. ProcedureExecution also extends ResultSetExecution, since procedures may also return resultsets.</para>
</section>
+
<section>
+ <title>ExecutionContext</title>
+ <para>The <code>org.teiid.translator.ExecutionContext</code> provides a considerable amount of information related to the current execution.
+ An <code>ExecutionContext</code> instance is made available to each <code>Execution</code>. Specific usage is highlighted in this guide where applicable, but you may use any informational getter method as desired.
+ Example usage would include calling <code>ExecutionContext.getRequestIdentifier()</code>, <code>ExecutionContext.getSession()</code>, etc. for logging purposes.</para>
+
+ <section>
+ <title>Source Hints</title>
+ <para>The Teiid source meta-hint is used to provide hints directly to source executions via user or transformation queries. See the reference for more on source hints. If specified and applicable, the general and source specific
+ hint will be supplied via the ExecutionContext methods <code>getGeneralHint</code> and <code>getSourceHint</code>. See the source for the <code>OracleExecutionFactory</code> for an example of how this source hint information
+ can be utilized.</para>
+ </section>
+
+ </section>
+
+ <section>
<title>ResultSetExecution</title>
<para>
Typically most commands executed against translators are QueryExpression.
While the command is being executed, the translator provides results via the
ResultSetExecution's "next" method. The "next" method should return null to indicate the end
of results. Note: the expected batch size can be obtained from the
- ExecutionContext and used as a hint in fetching results from the EIS.
+ <code>ExecutionContext.getBatchSize()</code> method and used as a hint in fetching results from the EIS.
</para>
</section>
<section>
<title>Update Execution</title>
<para>Each execution returns the update count(s) expected by the update command.
If possible BatchedUpdates should be executed atomically.
- The ExecutionContext can be used to determine if the execution is already under a transaction.</para>
+ The <code>ExecutionContext.isTransactional()</code> method can be used to determine if the execution is already under a transaction.</para>
</section>
<section>
<title>Procedure Execution</title>
@@ -293,13 +309,27 @@
<section>
<title>Asynchronous Executions</title>
- <para>In some scenarios, a translator needs to execute
- asynchronously and allow the executing thread to perform other work. To allow this, you should Throw a DataNotAvailableExecption during a retrival method, rather than explicitly waiting or sleeping for the results. The
- DataNotAvailableException may take a delay parameter in its
- constructor to indicate how long the system should wait befor polling
- for results. Any non-negative value is allowed.
- </para>
- <para>Since the exection and the associated connection are not closed until the work has completed, care should be taken if using asynchronous executions that hold a lot of state.</para>
+ <para>
+ In some scenarios, a translator needs to execute
+ asynchronously and allow the executing thread to perform other work. To allow this, you should Throw a
+ <code>DataNotAvailableExecption</code>
+ during a retrival method, rather than explicitly waiting or sleeping for the results.
+ <note>
+ <para>
+ A <code>DataNotAvailableException</code> should not be thrown by the execute method. The
+ <code>DataNotAvailableException</code> may take a delay parameter in its
+ constructor to indicate how long the system should wait befor polling
+ for results. Any non-negative value indicates a time until the next polling should be performed.
+ The
+ <code>DataNotAvailableException.NO_POLLING</code>
+ exception (or any DataNotAvailableException with a negative delay) can be thrown to indicate that
+ the execution will call <code>ExecutionContext.dataAvailable()</code> to indicate processing should resume.
+ </para>
+ </note>
+ </para>
+ <note>
+ <para>Since the exection and the associated connection are not closed until the work has completed, care should be taken if using asynchronous executions that hold a lot of state.</para>
+ </note>
</section>
<section>
@@ -342,6 +372,7 @@
termination of queries being processed and may allow the underlying data source to terminate its operations
faster as well.</para>
</section>
+
</section>
<section id="command_language">
@@ -1519,8 +1550,8 @@
connection is either closed/released as soon as all rows for that
execution have been retrieved. However, LOB objects may need to be
read after their initial retrieval of results. When LOBs are detected
- the default closing behavior is prevented by setting a flag on the
- ExecutionContext. See ExecutionContext.keepAlive() method. </para>
+ the default closing behavior is prevented by setting a flag via the
+ <code>ExecutionContext.keepAlive</code> method. </para>
<para>When the "keepAlive" alive flag is set, then the execution object is only closed when user's Statement is closed.</para>
@@ -1537,6 +1568,49 @@
</section>
</section>
+
+ <section id="delegating_translator">
+ <title>Delegating Translator</title>
+ <para>In some instances you may wish to extend several differnt kinds of translators with the same functionality.
+ Rather than create separate subclasses for each extension, you can use the delegating translator framework which provides you with a proxying mechanism to override translator behavior.
+ It implement a delegating translator, your common translator logic should be added to a subclass of BaseDelegatingExecutionFactory where you can override any of the delegation methods to perform whatever logic you want.
+ <example>
+ <title>Example BaseDelegatingExecutionFactory Subclass</title>
+ <programlisting language="JAVA"><![CDATA[@Translator(name="custom-delegator")
+public class MyTranslator extends BaseDelegatingExecutionFactory<Object, Object> {
+
+ @Override
+ public Execution createExecution(Command command,
+ ExecutionContext executionContext, RuntimeMetadata metadata,
+ Object connection) throws TranslatorException {
+ if (command instanceof Select) {
+ //modify the command or return a different execution
+ ...
+
+ }
+ //the super call will be to the delegate instance
+ return super.createExecution(command, executionContext, metadata, connection);
+ }
+ ...
+}]]></programlisting>
+ </example>
+ </para>
+ <para>You will bundle and deploy your custom delegating translator is just like any other custom translator development.
+ To you use your delegating translator in a vdb, you define a translator override that wires in the delegate.
+ <example>
+ <title>Example Translator Override</title>
+ <programlisting language="JAVA"><![CDATA[<translator type="custom-delegator" name="my-translator">
+
+ <property value="delegateName" name="name of the delegate instance"/>
+
+ <!-- any custom properties you may have on your custom translator -->
+
+</translator>]]></programlisting>
+ <para>From the previous example the translator type is custom-delegator. Now my-translator can be used as a translator-name on a source and will proxy all calls to whatever delegate instance you assign.</para>
+ </example>
+ <note><para>Note that the delegate instance can be any translator instance, whether configured by it's own translator entry or just the name of a standard translator type.</para></note>
+ </para>
+ </section>
<section>
<title>Adding Dependent Libraries</title>
Modified: branches/as7/documentation/pom.xml
===================================================================
--- branches/as7/documentation/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: branches/as7/documentation/quick-start-example/pom.xml
===================================================================
--- branches/as7/documentation/quick-start-example/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/quick-start-example/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quick-start-example</artifactId>
Modified: branches/as7/documentation/reference/pom.xml
===================================================================
--- branches/as7/documentation/reference/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/reference/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>reference</artifactId>
Modified: branches/as7/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
===================================================================
--- branches/as7/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -712,9 +712,20 @@
</tbody>
</tgroup>
</informaltable>
- <para />
</section>
</section>
+ <section>
+ <title>Source Hints</title>
+ <para>Teiid user and transformation queries can contain a meta source hint that can provide additional information to source queries.
+ The source hint has the form /*+ sh(:'arg') source-name:'arg1' ... */ and is expected to appear after the query keyword, e.g. "SELECT /*+ sh:'general hint' my-oracle:'oracle hint' */.
+ The sh arg is optional and is passed to all source queries via the <code>ExecutionContext.getGeneralHint</code> method. See the Developer's Guide for more onThe additional args should have source-name that matches
+ the source name assigned to the translator in the VDB. If the source-name matches the hint value will be supplied via the <code>ExecutionContext.getSourceHint</code> method.
+ See the Developer's Guide for more on using an ExecutionContext.
+ Each of the arg values has the form of a string literal - it must be surrounded in single quotes and a single quote can be escaped with another signle quote.
+ Only the Oracle translator does anything with source hints by default. The Oracle translator will use either the source hint or the general hint (in that order) if available to form an Oracle hint enclosed in
+ /*+ ... */. Source hints in views will not be passed to the source if the view is used as a pushdown subquery, is joined, or is in a set operation.
+ </para>
+ </section>
</section>
<section id="query_planner">
<title>Query Planner</title>
Modified: branches/as7/documentation/reference/src/main/docbook/en-US/content/sql_clauses.xml
===================================================================
--- branches/as7/documentation/reference/src/main/docbook/en-US/content/sql_clauses.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/reference/src/main/docbook/en-US/content/sql_clauses.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -49,14 +49,15 @@
<listitem><para>FROM table1 JOIN /*+ MAKEDEP */ table2 ON join-criteria</para></listitem>
<listitem><para>FROM table1 JOIN /*+ MAKENOTDEP */ table2 ON join-criteria</para></listitem>
<listitem><para>FROM /*+ MAKEIND */ table1 JOIN table2 ON join-criteria</para></listitem>
+ <listitem><para>FROM /*+ NO_UNNEST */ vw1 JOIN table2 ON join-criteria</para></listitem>
<listitem><para>FROM table1 left outer join <link linkend="optional_join">/*+ optional */</link> table2 ON join-criteria</para></listitem>
<listitem><para>FROM <link linkend="texttable">TEXTTABLE...</link></para></listitem>
<listitem><para>FROM <link linkend="xmltable">XMLTABLE...</link></para></listitem>
<listitem><para>FROM <link linkend="arraytable">ARRAYTABLE...</link></para></listitem>
<listitem><para>FROM <link linkend="from_subquery">(SELECT ...</link></para></listitem>
</itemizedlist>
- <note>
- <title>DEP Hints</title>
+ <section>
+ <title>From Clause Hints</title>
<para>
MAKEIND, MAKEDEP, and MAKENOTDEP are hints used to control
<link linkend="dependent_joins">dependent join</link>
@@ -65,7 +66,12 @@
metadata, and costing information. The hints may appear in a comment that proceeds the from clause.
The hints can be specified against any from clause, not just a named table.
</para>
- </note>
+ <para>
+ NO_UNNEST can be specified against a subquery from clause or view to instruct the planner to not merge
+ the nested SQL in the surrounding query - also known as view flattening. This hint only applies to Teiid
+ planning and is not passed to source queries. NO_UNNEST may appear in a comment that proceeds the from clause.
+ </para>
+ </section>
<section id="nested_table">
<title>Nested Table Reference</title>
<para>Nested tables may appear in the FROM clause with the TABLE
@@ -432,6 +438,11 @@
<para>The terms FIRST/NEXT are interchangable as well as ROW/ROWS.
</para>
</listitem>
+ <listitem>
+ <para>The limit clause may take an optional preceeding NON_STRICT hint to indicate that push operations should not be inhibited even if the results will not be consistent with the logical application of the limit.
+ The hint is only needed on unordered limits, e.g. "SELECT * FROM VW /*+ NON_STRICT */ LIMIT 2".
+ </para>
+ </listitem>
</itemizedlist>
<itemizedlist>
<para>Examples:
Modified: branches/as7/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
--- branches/as7/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -259,6 +259,21 @@
</listitem>
<listitem>
<para>
+ <emphasis>hive</emphasis> - For use with Hive database based on Hadoop. Hive is a data warehousing
+ infrastructure based on the Hadoop. Hadoop provides massive scale out and fault tolerance capabilities
+ for data storage and processing (using the map-reduce programming paradigm) on commodity hardware.
+ </para>
+ <para>Hive has limited support for data types as it supports integer varients, boolean, float,
+ double and string. It is does not have native support for time based types, xml or LOBs. These limitations
+ are reflected in the translator capabilities. The view table can use these types, however the tranformation
+ would need to specify the necessary transformations. Note that in those situations, the evaluations will be
+ done in Teiid engine. Another limitation Hive has is, it only supports EQUI join, so using any other joins types
+ on its source tables will result in in-effiecient queries. Currently there is no tooling support for metadata
+ import from Hive in Designer. To write criteria based on partitioned columns, they can be modeled
+ on source table, but do not include in selection columns.</para>
+ </listitem>
+ <listitem>
+ <para>
<emphasis>hsql</emphasis> - for use with HSQLDB 1.7 or later.
</para>
</listitem>
@@ -527,11 +542,11 @@
"SELECT c FROM y" would generate the SQL query "SELECT c FROM (select c from g) as x". Note that the column names in the native query must match the nameInSource of the physical table columns for the resulting SQL
to be valid.</para>
<para>For physical procedures you may also set the teiid:native-query extension metadata to a desired query string with the added ability to positionally reference IN parameters. A parameter reference has the form
- $integer, e.g. $1. Note that 1 based indexing is used and that only IN parameters may be referenced. Dollar-sign ($) is reserved in physical procedure native queries. To use a $ directly, it must be escaped with another $, e.g. $$.
+ $integer, e.g. $1. Note that 1 based indexing is used and that only IN parameters may be referenced. Dollar-sign integer is reserved in physical procedure native queries. To use a $integer directly, it must be escaped with another $, e.g. $$1.
By default bind values will be used for parameter values. In some situations you may wish to bind values directly into the resulting SQL. The teiid:non-prepared extension metadata property may be set to false to turn off
parameter binding. Note this option should be used with caution as inbound may allow for SQL injection attacks if not properly validated. The native query does not need to call a stored procedure. Any SQL that returns
- a result set positionally matching the result set expected by the physical stored procedure metadata will work. For example on a stored procedure x with teiid:native-query=select c from g where c1 = $1 and c2 = '$$', the Teiid source query
- "CALL x(?)" would generate the SQL query "select c from g where c1 = ? and c2 = '$'". Note that ? in this example will be replaced with the actual value bound to parameter 1.
+ a result set positionally matching the result set expected by the physical stored procedure metadata will work. For example on a stored procedure x with teiid:native-query=select c from g where c1 = $1 and c2 = '$$1', the Teiid source query
+ "CALL x(?)" would generate the SQL query "select c from g where c1 = ? and c2 = '$1'". Note that ? in this example will be replaced with the actual value bound to parameter 1.
</para>
</section>
Modified: branches/as7/engine/pom.xml
===================================================================
--- branches/as7/engine/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Property changes on: branches/as7/engine/src/main/java/org/teiid/api
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api:3535-3555*
/trunk/engine/src/main/java/org/teiid/api:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api:3535-3555*
/trunk/engine/src/main/java/org/teiid/api:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception:3535-3555*
/trunk/engine/src/main/java/org/teiid/api/exception:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception:3535-3555*
/trunk/engine/src/main/java/org/teiid/api/exception:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query:3535-3555*
/trunk/engine/src/main/java/org/teiid/api/exception/query:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query:3535-3555*
/trunk/engine/src/main/java/org/teiid/api/exception/query:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query/ExpressionEvaluationException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/ExpressionEvaluationException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/ExpressionEvaluationException.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/ExpressionEvaluationException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/ExpressionEvaluationException.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query/FunctionExecutionException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/FunctionExecutionException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/FunctionExecutionException.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/FunctionExecutionException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/FunctionExecutionException.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query/FunctionMetadataException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/FunctionMetadataException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/FunctionMetadataException.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/FunctionMetadataException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/FunctionMetadataException.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query/InvalidFunctionException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/InvalidFunctionException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/InvalidFunctionException.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/InvalidFunctionException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/InvalidFunctionException.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryMetadataException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryMetadataException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryMetadataException.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryMetadataException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryMetadataException.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryParserException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryParserException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryParserException.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryParserException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryParserException.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryPlannerException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryPlannerException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryPlannerException.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryPlannerException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryPlannerException.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryProcessingException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryProcessingException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryProcessingException.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryProcessingException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryProcessingException.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryResolverException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryResolverException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryResolverException.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryResolverException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryResolverException.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query/QueryValidatorException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryValidatorException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryValidatorException.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/QueryValidatorException.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/QueryValidatorException.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/api/exception/query/UnresolvedSymbolDescription.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/UnresolvedSymbolDescription.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/UnresolvedSymbolDescription.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/api/exception/query/UnresolvedSymbolDescription.java:3535-3555
/trunk/engine/src/main/java/org/teiid/api/exception/query/UnresolvedSymbolDescription.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common:3535-3555*
/trunk/engine/src/main/java/org/teiid/common:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common:3535-3555*
/trunk/engine/src/main/java/org/teiid/common:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer:3535-3555*
/trunk/engine/src/main/java/org/teiid/common/buffer:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer:3535-3555*
/trunk/engine/src/main/java/org/teiid/common/buffer:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/AbstractTupleSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/AbstractTupleSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/AbstractTupleSource.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/AbstractTupleSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/AbstractTupleSource.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/AutoCleanupUtil.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/AutoCleanupUtil.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/AutoCleanupUtil.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/AutoCleanupUtil.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/AutoCleanupUtil.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/BaseCacheEntry.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BaseCacheEntry.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/BaseCacheEntry.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BaseCacheEntry.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/BaseCacheEntry.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/BatchManager.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BatchManager.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/BatchManager.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BatchManager.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/BatchManager.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/BlockedException.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BlockedException.java:3149-3217,3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/BlockedException.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BlockedException.java:3149-3217,3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/BlockedException.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/BufferManager.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BufferManager.java:3220-3275,3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/BufferManager.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/BufferManager.java:3220-3275,3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/BufferManager.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/Cache.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/Cache.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/Cache.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/Cache.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/Cache.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/CacheEntry.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/CacheEntry.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/CacheEntry.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/CacheEntry.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/CacheEntry.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/CacheKey.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/CacheKey.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/CacheKey.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/CacheKey.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/CacheKey.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/ExtensibleBufferedInputStream.java
___________________________________________________________________
Deleted: svn:mergeinfo
- /trunk/engine/src/main/java/org/teiid/common/buffer/ExtensibleBufferedInputStream.java:3507-3597
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/FileStore.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/FileStore.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/FileStore.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/FileStore.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/FileStore.java:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -26,12 +26,14 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
+import java.io.Reader;
import java.io.Writer;
import java.nio.charset.Charset;
import org.teiid.common.buffer.FileStore.FileStoreOutputStream;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.InputStreamFactory;
+import org.teiid.core.util.InputStreamReader;
public final class FileStoreInputStreamFactory extends InputStreamFactory {
private final FileStore lobBuffer;
@@ -51,6 +53,11 @@
}
return lobBuffer.createInputStream(0);
}
+
+ @Override
+ public Reader getCharacterStream() throws IOException {
+ return new InputStreamReader(getInputStream(), Charset.forName(encoding).newDecoder());
+ }
@Override
public long getLength() {
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/FileStoreInputStreamFactory.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/IndexedTupleSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/IndexedTupleSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/IndexedTupleSource.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/IndexedTupleSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/IndexedTupleSource.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/LightWeightCopyOnWriteList.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/LightWeightCopyOnWriteList.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/LightWeightCopyOnWriteList.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/LightWeightCopyOnWriteList.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/LightWeightCopyOnWriteList.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/LobManager.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/LobManager.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/LobManager.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/LobManager.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/LobManager.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/SPage.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/SPage.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/SPage.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/SPage.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/SPage.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/STree.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/STree.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/STree.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/STree.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/STree.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/Serializer.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/Serializer.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/Serializer.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/Serializer.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/Serializer.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/StorageManager.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/StorageManager.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/StorageManager.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/StorageManager.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/StorageManager.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/TupleBatch.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBatch.java:3220-3275,3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/TupleBatch.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBatch.java:3220-3275,3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/TupleBatch.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/TupleBrowser.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBrowser.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/TupleBrowser.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBrowser.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/TupleBrowser.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java:3149-3217,3220-3275,3340-3349,3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java:3149-3217,3220-3275,3340-3349,3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/TupleSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/TupleSource.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/TupleSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/TupleSource.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/common/buffer/impl
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/impl:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/impl:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/common/buffer/impl:3535-3555
/trunk/engine/src/main/java/org/teiid/common/buffer/impl:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -39,9 +39,12 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.teiid.common.buffer.AutoCleanupUtil;
@@ -98,7 +101,7 @@
private static final int DEFAULT_MIN_DEFRAG = 1 << 26;
private static final byte[] HEADER_SKIP_BUFFER = new byte[16];
- private static final int EVICTION_SCANS = 5;
+ private static final int EVICTION_SCANS = 2;
public static final int DEFAuLT_MAX_OBJECT_SIZE = 1 << 23;
@@ -343,6 +346,8 @@
LrfuEvictionQueue<PhysicalInfo> memoryBufferEntries = new LrfuEvictionQueue<PhysicalInfo>(readAttempts);
private Semaphore memoryWritePermits; //prevents deadlock waiting for free blocks
private ReentrantReadWriteLock memoryEvictionLock = new ReentrantReadWriteLock(true);
+ private ReentrantLock freedLock = new ReentrantLock();
+ private Condition blocksFreed = freedLock.newCondition();
private int blocks;
private ConcurrentBitSet blocksInuse;
@@ -625,16 +630,11 @@
private void checkForLowMemory() {
//proactively create freespace
- if (!cleanerRunning.get()) {
- if (lowBlocks(false) && cleanerRunning.compareAndSet(false, true)) {
- LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, "Starting memory buffer cleaner"); //$NON-NLS-1$
- asynchPool.execute(cleaningTask);
- if (lowBlocks(true)) {
- //do a non-blocking removal before we're forced to block
- evictFromMemoryBuffer(false);
- }
- }
- } else if (lowBlocks(true)) {
+ if (!cleanerRunning.get() && lowBlocks(false) && cleanerRunning.compareAndSet(false, true)) {
+ LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, "Starting memory buffer cleaner"); //$NON-NLS-1$
+ asynchPool.execute(cleaningTask);
+ }
+ if (lowBlocks(true)) {
//do a non-blocking removal before we're forced to block
evictFromMemoryBuffer(false);
}
@@ -931,6 +931,12 @@
}
if (bm != null) {
result = bm.free(acquireDataBlock);
+ freedLock.lock();
+ try {
+ blocksFreed.signalAll();
+ } finally {
+ freedLock.unlock();
+ }
}
}
}
@@ -993,8 +999,27 @@
}
}
if (acquire && next == EMPTY_ADDRESS) {
- throw new AssertionError("Could not free space for pending write"); //$NON-NLS-1$
+ if (!writeLocked) {
+ memoryEvictionLock.writeLock().lock();
+ writeLocked = true;
+ }
+ freedLock.lock();
+ try {
+ next = blocksInuse.getAndSetNextClearBit();
+ if (next != EMPTY_ADDRESS) {
+ return next;
+ }
+ blocksFreed.await(120, TimeUnit.SECONDS);
+ } finally {
+ freedLock.unlock();
+ }
+ next = blocksInuse.getAndSetNextClearBit();
+ if (next == EMPTY_ADDRESS) {
+ throw new AssertionError("Could not free space for pending write"); //$NON-NLS-1$
+ }
}
+ } catch (InterruptedException e) {
+ throw new TeiidRuntimeException(e);
} finally {
if (writeLocked) {
memoryEvictionLock.writeLock().unlock();
Modified: branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -598,15 +598,12 @@
if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.TRACE)) {
LogManager.logTrace(LogConstants.CTX_BUFFER_MGR, "Releasing buffer space", count); //$NON-NLS-1$
}
- if (lock.tryLock()) {
- try {
- this.reserveBatchBytes.addAndGet(count);
- batchesFreed.signalAll();
- } finally {
- lock.unlock();
- }
- } else {
- this.reserveBatchBytes.addAndGet(count);
+ lock.lock();
+ try {
+ this.reserveBatchBytes.addAndGet(count);
+ batchesFreed.signalAll();
+ } finally {
+ lock.unlock();
}
}
Property changes on: branches/as7/engine/src/main/java/org/teiid/core
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/core:3535-3555*
/trunk/engine/src/main/java/org/teiid/core:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/core:3535-3555*
/trunk/engine/src/main/java/org/teiid/core:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/core/id
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/core/id:3535-3555
/trunk/engine/src/main/java/org/teiid/core/id:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/core/id:3535-3555
/trunk/engine/src/main/java/org/teiid/core/id:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWork.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWork.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWork.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -23,6 +23,7 @@
package org.teiid.dqp.internal.datamgr;
import org.teiid.common.buffer.BlockedException;
+import org.teiid.dqp.internal.process.RequestWorkItem;
import org.teiid.dqp.message.AtomicResultsMessage;
import org.teiid.translator.TranslatorException;
@@ -40,4 +41,8 @@
AtomicResultsMessage execute() throws TranslatorException, BlockedException;
+ void setRequestWorkItem(RequestWorkItem item);
+
+ boolean isDataAvailable();
+
}
\ No newline at end of file
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -22,7 +22,6 @@
package org.teiid.dqp.internal.datamgr;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -30,9 +29,11 @@
import javax.resource.ResourceException;
import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.client.ResizingArrayList;
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.util.Assertion;
+import org.teiid.dqp.internal.process.RequestWorkItem;
import org.teiid.dqp.message.AtomicRequestID;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.AtomicResultsMessage;
@@ -97,6 +98,8 @@
Integer.toString(requestID.getNodeID()),
Integer.toString(requestID.getExecutionId())
);
+ this.securityContext.setGeneralHint(message.getGeneralHint());
+ this.securityContext.setHint(message.getHint());
this.securityContext.setUser(requestMsg.getWorkContext().getSubject());
this.securityContext.setBatchSize(this.requestMsg.getFetchSize());
this.securityContext.setSession(requestMsg.getWorkContext().getSession());
@@ -108,6 +111,11 @@
this.securityContext.setTransactional(requestMsg.isTransactional());
}
+ @Override
+ public void setRequestWorkItem(RequestWorkItem item) {
+ this.securityContext.setRequestWorkItem(item);
+ }
+
public AtomicRequestID getId() {
return id;
}
@@ -137,6 +145,7 @@
}
public void close() {
+ this.securityContext.setRequestWorkItem(null);
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id, "Processing Close :", this.requestMsg.getCommand()}); //$NON-NLS-1$
if (!error) {
manager.logSRCCommand(this.requestMsg, this.securityContext, Event.END, this.rowCount);
@@ -273,12 +282,12 @@
Assertion.assertTrue(!this.lastBatch);
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id, "Getting results from connector"}); //$NON-NLS-1$
int batchSize = 0;
- List<List> rows = new ArrayList<List>(batchSize/4);
+ List<List<?>> rows = new ResizingArrayList<List<?>>(batchSize/4);
try {
while (batchSize < this.requestMsg.getFetchSize()) {
- List row = this.execution.next();
+ List<?> row = this.execution.next();
if (row == null) {
this.lastBatch = true;
break;
@@ -306,14 +315,14 @@
}
}
} catch (DataNotAvailableException e) {
- if (rows.size() == 0) {
+ if (rows.size() == 0 && this.rowCount != 0) {
throw e;
}
}
if (lastBatch) {
if (this.procedureBatchHandler != null) {
- List row = this.procedureBatchHandler.getParameterRow();
+ List<?> row = this.procedureBatchHandler.getParameterRow();
if (row != null) {
rows.add(row);
this.rowCount++;
@@ -357,5 +366,10 @@
public String toString() {
return this.id.toString();
}
+
+ @Override
+ public boolean isDataAvailable() {
+ return this.securityContext.isDataAvailable();
+ }
}
\ No newline at end of file
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -33,6 +33,7 @@
import org.teiid.adminapi.Session;
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.util.HashCodeUtil;
+import org.teiid.dqp.internal.process.RequestWorkItem;
import org.teiid.translator.ExecutionContext;
@@ -66,6 +67,10 @@
private int batchSize = BufferManager.DEFAULT_CONNECTOR_BATCH_SIZE;
private List<Exception> warnings = new LinkedList<Exception>();
private Session session;
+ private RequestWorkItem worktItem;
+ private boolean dataAvailable;
+ private String generalHint;
+ private String hint;
public ExecutionContextImpl(String vdbName, int vdbVersion, Serializable executionPayload,
String originalConnectionID, String connectorName, String requestId, String partId, String execCount) {
@@ -215,4 +220,41 @@
public void setSession(Session session) {
this.session = session;
}
+
+ public void setRequestWorkItem(RequestWorkItem item) {
+ this.worktItem = item;
+ }
+
+ @Override
+ public synchronized void dataAvailable() {
+ RequestWorkItem requestWorkItem = this.worktItem;
+ dataAvailable = true;
+ if (requestWorkItem != null) {
+ requestWorkItem.moreWork();
+ }
+ }
+
+ public synchronized boolean isDataAvailable() {
+ boolean result = dataAvailable;
+ dataAvailable = false;
+ return result;
+ }
+
+ @Override
+ public String getGeneralHint() {
+ return generalHint;
+ }
+
+ @Override
+ public String getSourceHint() {
+ return hint;
+ }
+
+ public void setGeneralHint(String generalHint) {
+ this.generalHint = generalHint;
+ }
+
+ public void setHint(String hint) {
+ this.hint = hint;
+ }
}
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -178,10 +178,6 @@
}
}
- public static interface ContextProvider {
- DQPWorkContext getContext(String vdbName, int vdbVersion);
- }
-
private ThreadReuseExecutor processWorkerPool;
// Resources
@@ -334,6 +330,7 @@
request.initialize(requestMsg, bufferManager,
dataTierMgr, transactionService, state.sessionTables,
workContext, this.prepPlanCache);
+ request.setExecutor(this.processWorkerPool);
request.setResultSetCacheEnabled(this.rsCache != null);
request.setAuthorizationValidator(this.authorizationValidator);
request.setUserRequestConcurrency(this.getUserRequestSourceConcurrency());
@@ -359,7 +356,7 @@
}
}, timeout));
}
- boolean runInThread = DQPWorkContext.getWorkContext().useCallingThread() || requestMsg.isSync();
+ boolean runInThread = requestMsg.isSync();
synchronized (waitingPlans) {
if (runInThread || currentlyActivePlans <= maxActivePlans) {
startActivePlan(workItem, !runInThread);
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -72,6 +72,7 @@
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Query;
+import org.teiid.query.sql.lang.SourceHint;
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.lang.UnaryFromClause;
import org.teiid.query.sql.symbol.Constant;
@@ -180,6 +181,11 @@
}
AtomicRequestMessage aqr = createRequest(context.getProcessorID(), command, modelName, connectorBindingId, nodeID);
+ SourceHint sh = context.getSourceHint();
+ if (sh != null) {
+ aqr.setGeneralHint(sh.getGeneralHint());
+ aqr.setHint(sh.getSourceHint(aqr.getConnectorName()));
+ }
if (limit > 0) {
aqr.setFetchSize(Math.min(limit, aqr.getFetchSize()));
}
@@ -190,6 +196,7 @@
}
ConnectorManagerRepository cmr = workItem.getDqpWorkContext().getVDB().getAttachment(ConnectorManagerRepository.class);
ConnectorWork work = cmr.getConnectorManager(aqr.getConnectorName()).registerRequest(aqr);
+ work.setRequestWorkItem(workItem);
return new DataTierTupleSource(aqr, workItem, work, this, limit);
}
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -238,12 +238,16 @@
} catch (TranslatorException e) {
results = exceptionOccurred(e, true);
} catch (DataNotAvailableException e) {
- workItem.scheduleWork(new Runnable() {
- @Override
- public void run() {
- workItem.moreWork();
- }
- }, 10, e.getRetryDelay());
+ if (e.getRetryDelay() >= 0) {
+ workItem.scheduleWork(new Runnable() {
+ @Override
+ public void run() {
+ workItem.moreWork();
+ }
+ }, 10, e.getRetryDelay());
+ } else if (this.cwi.isDataAvailable()) {
+ continue;
+ }
throw BlockedException.block(aqr.getAtomicRequestID(), "Blocking on DataNotAvailableException"); //$NON-NLS-1$
}
receiveResults(results);
@@ -326,7 +330,7 @@
return results;
}
- private AtomicResultsMessage getResults()
+ AtomicResultsMessage getResults()
throws BlockedException, TeiidComponentException,
TranslatorException {
AtomicResultsMessage results = null;
@@ -443,7 +447,7 @@
@Override
public void onCompletion(FutureWork<AtomicResultsMessage> future) {
if (!cancelAsynch) {
- workItem.moreWork();
+ workItem.moreWork(); //this is not necessary in some situations with DataNotAvailable
}
canAsynchClose = false;
if (closed.get()) {
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -28,6 +28,7 @@
import java.util.List;
import java.util.Properties;
import java.util.Set;
+import java.util.concurrent.Executor;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.api.exception.query.QueryMetadataException;
@@ -134,6 +135,7 @@
private boolean resultSetCacheEnabled = true;
private int userRequestConcurrency;
private AuthorizationValidator authorizationValidator;
+ private Executor executor;
void initialize(RequestMessage requestMsg,
BufferManager bufferManager,
@@ -240,7 +242,7 @@
multiSourceModels, workContext, context);
context.setPlanToProcessConverter(modifier);
}
-
+ context.setExecutor(this.executor);
context.setSecurityFunctionEvaluator(this);
context.setTempTableStore(tempTableStore);
context.setQueryProcessorFactory(new QueryProcessorFactoryImpl(this.bufferManager, this.processorDataManager, this.capabilitiesFinder, idGenerator, metadata));
@@ -475,4 +477,8 @@
}
}
+ public void setExecutor(Executor executor) {
+ this.executor = executor;
+ }
+
}
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -291,9 +291,13 @@
}
}
} catch (BlockedException e) {
- LogManager.logDetail(LogConstants.CTX_DQP, "Request Thread", requestID, "- processor blocked"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_DQP, "Request Thread", requestID, "- processor blocked"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
} catch (QueryProcessor.ExpiredTimeSliceException e) {
- LogManager.logDetail(LogConstants.CTX_DQP, "Request Thread", requestID, "- time slice expired"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_DQP, "Request Thread", requestID, "- time slice expired"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
this.moreWork();
} catch (Throwable e) {
handleThrowable(e);
@@ -518,6 +522,9 @@
}
addToCache();
synchronized (lobStreams) {
+ if (resultsBuffer.isLobs()) {
+ super.flushBatchDirect(batch, false);
+ }
add = sendResultsIfNeeded(batch);
if (cid != null) {
return;
@@ -526,6 +533,7 @@
//restrict the buffer size for forward only results
if (add && !processor.hasFinalBuffer()
&& !batch.getTerminationFlag()
+ && transactionState != TransactionState.ACTIVE
&& this.getTupleBuffer().getManagedRowCount() >= OUTPUT_BUFFER_MAX_BATCHES * this.getTupleBuffer().getBatchSize()) {
if (!dqpCore.hasWaitingPlans(RequestWorkItem.this)) {
//requestMore will trigger more processing
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -225,7 +225,7 @@
private static final long serialVersionUID = 8261905111156764744L;
private String sql;
private VDBKey vdbInfo;
- private ParseInfo pi;
+ private boolean ansiIdentifiers;
private String sessionId;
private String originalSessionId;
private List<Serializable> parameters;
@@ -240,7 +240,7 @@
Assertion.isNotNull(sql);
this.sql = sql;
this.vdbInfo = new VDBKey(vdbName, vdbVersion);
- this.pi = pi;
+ this.ansiIdentifiers = pi.ansiQuotedIdentifiers;
this.originalSessionId = sessionId;
this.originalUserName = userName;
}
@@ -301,14 +301,14 @@
return false;
}
CacheID that = (CacheID)obj;
- return EquivalenceUtil.areEqual(this.pi, that.pi) && this.vdbInfo.equals(that.vdbInfo) && this.sql.equals(that.sql)
+ return ansiIdentifiers == that.ansiIdentifiers && this.vdbInfo.equals(that.vdbInfo) && this.sql.equals(that.sql)
&& EquivalenceUtil.areEqual(this.userName, that.userName)
&& EquivalenceUtil.areEqual(this.sessionId, that.sessionId)
&& EquivalenceUtil.areEqual(this.parameters, that.parameters);
}
public int hashCode() {
- return HashCodeUtil.hashCode(0, vdbInfo, sql, pi, this.userName, sessionId, parameters);
+ return HashCodeUtil.hashCode(0, vdbInfo, sql, this.userName, sessionId, parameters);
}
@Override
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/message/AtomicRequestMessage.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/message/AtomicRequestMessage.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/message/AtomicRequestMessage.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -84,6 +84,8 @@
private boolean serial;
private DQPWorkContext workContext;
+ private String generalHint;
+ private String hint;
public AtomicRequestMessage() {
// This is only to honor the externalizable interface..
@@ -214,5 +216,21 @@
public DQPWorkContext getWorkContext() {
return workContext;
}
+
+ public String getGeneralHint() {
+ return generalHint;
+ }
+
+ public void setGeneralHint(String generalHint) {
+ this.generalHint = generalHint;
+ }
+
+ public String getHint() {
+ return hint;
+ }
+
+ public void setHint(String hint) {
+ this.hint = hint;
+ }
}
Modified: branches/as7/engine/src/main/java/org/teiid/dqp/service/SessionService.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/service/SessionService.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/service/SessionService.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -32,7 +32,7 @@
import org.teiid.adminapi.impl.SessionMetadata;
import org.teiid.client.security.InvalidSessionException;
import org.teiid.dqp.internal.process.DQPCore;
-import org.teiid.net.TeiidURL.CONNECTION.AuthenticationType;
+import org.teiid.net.socket.AuthenticationType;
import org.teiid.security.Credentials;
@@ -146,7 +146,9 @@
AuthenticationType getAuthenticationType();
- String getKrb5SecurityDomain();
+ String getGssSecurityDomain();
void associateSubjectInContext(String securityDomain, Subject subject);
+
+ Subject getSubjectInContext(String securityDomain);
}
Property changes on: branches/as7/engine/src/main/java/org/teiid/query
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query:3535-3555*
/trunk/engine/src/main/java/org/teiid/query:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query:3535-3555*
/trunk/engine/src/main/java/org/teiid/query:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/ObjectReplicator.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/ObjectReplicator.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/ObjectReplicator.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/ObjectReplicator.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/ObjectReplicator.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/QueryPlugin.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/QueryPlugin.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/QueryPlugin.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/ReplicatedObject.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/ReplicatedObject.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/ReplicatedObject.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/ReplicatedObject.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/ReplicatedObject.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/analysis
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/analysis:3535-3555
/trunk/engine/src/main/java/org/teiid/query/analysis:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/analysis:3535-3555
/trunk/engine/src/main/java/org/teiid/query/analysis:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/eval
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/eval:3535-3555
/trunk/engine/src/main/java/org/teiid/query/eval:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/eval:3535-3555
/trunk/engine/src/main/java/org/teiid/query/eval:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/eval/Evaluator.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -68,6 +68,7 @@
import org.teiid.core.types.basic.StringToSQLXMLTransform;
import org.teiid.core.util.EquivalenceUtil;
import org.teiid.language.Like.MatchMode;
+import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.metadata.FunctionMethod.PushDown;
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.FunctionDescriptor;
@@ -435,7 +436,7 @@
}
Matcher matcher = patternRegex.matcher(search);
- return matcher.matches();
+ return matcher.find();
}
private Boolean evaluate(AbstractSetCriteria criteria, List<?> tuple)
@@ -925,6 +926,17 @@
public Result evaluateXQuery(SaxonXQueryExpression xquery, List<DerivedColumn> cols, List<?> tuple, RowProcessor processor)
throws BlockedException, TeiidComponentException, TeiidProcessingException {
HashMap<String, Object> parameters = new HashMap<String, Object>();
+ Object contextItem = evaluateParameters(cols, tuple, parameters);
+ return XQueryEvaluator.evaluateXQuery(xquery, contextItem, parameters, processor, context);
+ }
+
+ /**
+ * Evaluate the parameters and return the context item if it exists
+ */
+ public Object evaluateParameters(List<DerivedColumn> cols, List<?> tuple,
+ HashMap<String, Object> parameters)
+ throws ExpressionEvaluationException, BlockedException,
+ TeiidComponentException {
Object contextItem = null;
for (DerivedColumn passing : cols) {
Object value = this.evaluate(passing.getExpression(), tuple);
@@ -934,7 +946,7 @@
parameters.put(passing.getAlias(), value);
}
}
- return XQueryEvaluator.evaluateXQuery(xquery, contextItem, parameters, processor, context);
+ return contextItem;
}
private Evaluator.NameValuePair<Object>[] getNameValuePairs(List<?> tuple, List<DerivedColumn> args, boolean xmlNames)
@@ -1047,6 +1059,11 @@
// Execute function
Object result = fd.invokeFunction(values);
+
+ if (context != null && fd.getDeterministic().ordinal() <= Determinism.USER_DETERMINISTIC.ordinal()) {
+ context.setDeterminismLevel(fd.getDeterministic());
+ }
+
return result;
}
@@ -1071,7 +1088,15 @@
return result;
}
- protected ValueIterator evaluateSubquery(SubqueryContainer container, List<?> tuple)
+ /**
+ * @param container
+ * @param tuple
+ * @return
+ * @throws TeiidProcessingException
+ * @throws BlockedException
+ * @throws TeiidComponentException
+ */
+ protected ValueIterator evaluateSubquery(SubqueryContainer<?> container, List<?> tuple)
throws TeiidProcessingException, BlockedException, TeiidComponentException {
throw new UnsupportedOperationException("Subquery evaluation not possible with a base Evaluator"); //$NON-NLS-1$
}
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/function:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/function:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/CharsetUtils.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/CharsetUtils.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/CharsetUtils.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/CharsetUtils.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/CharsetUtils.java:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -36,7 +36,6 @@
import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.metadata.FunctionMethod.PushDown;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.util.CommandContext;
/**
@@ -186,11 +185,6 @@
throw new FunctionExecutionException("ERR.015.001.0002", QueryPlugin.Util.getString("ERR.015.001.0002", getName())); //$NON-NLS-1$ //$NON-NLS-2$
}
- if (getDeterministic().compareTo(Determinism.USER_DETERMINISTIC) <= 0 && values.length > 0 && values[0] instanceof CommandContext) {
- CommandContext cc = (CommandContext)values[0];
- cc.setDeterminismLevel(getDeterministic());
- }
-
// Invoke the method and return the result
try {
if (method.isVarArgs()) {
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java:3149-3171,3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java:3149-3171,3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/FunctionForm.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionForm.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionForm.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionForm.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionForm.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/FunctionLibrary.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionLibrary.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionLibrary.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionLibrary.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionLibrary.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/FunctionMetadataSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionMetadataSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionMetadataSource.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionMetadataSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionMetadataSource.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/FunctionTree.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionTree.java:3149-3171,3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/FunctionTree.java:3149-3171,3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/UDFSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/UDFSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/UDFSource.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/UDFSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/UDFSource.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/aggregate
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/aggregate:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/aggregate:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/metadata
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/metadata:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/metadata:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/metadata:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/metadata:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/function/source
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/function/source:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/source:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/function/source:3535-3555
/trunk/engine/src/main/java/org/teiid/query/function/source:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/function/source/XMLSystemFunctions.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -234,9 +234,39 @@
return true;
}
}
+
+ private static ThreadLocal<TransformerFactory> threadLocalTransformerFactory = new ThreadLocal<TransformerFactory>() {
+ protected TransformerFactory initialValue() {
+ return TransformerFactory.newInstance();
+ }
+ };
+ static ThreadLocal<XMLOutputFactory> threadLocalOutputFactory = new ThreadLocal<XMLOutputFactory>() {
+ protected XMLOutputFactory initialValue() {
+ return newXmlOutputFactory();
+ }
+ };
+ static ThreadLocal<XMLEventFactory> threadLocalEventtFactory = new ThreadLocal<XMLEventFactory>() {
+ protected XMLEventFactory initialValue() {
+ return XMLEventFactory.newInstance();
+ }
+ };
+ private static final String P_OUTPUT_VALIDATE_STRUCTURE = "com.ctc.wstx.outputValidateStructure"; //$NON-NLS-1$
+ static XMLOutputFactory newXmlOutputFactory() throws FactoryConfigurationError {
+ XMLOutputFactory factory = XMLOutputFactory.newInstance();
+ if (factory.isPropertySupported(P_OUTPUT_VALIDATE_STRUCTURE)) {
+ factory.setProperty(P_OUTPUT_VALIDATE_STRUCTURE, false);
+ }
+ return factory;
+ }
+ static XMLOutputFactory xmlOutputFactory = newXmlOutputFactory();
+
+ public static XMLOutputFactory getOutputFactory() throws FactoryConfigurationError {
+ if (XMLType.isThreadSafeXmlFactories()) {
+ return xmlOutputFactory;
+ }
+ return threadLocalOutputFactory.get();
+ }
- private static final String P_OUTPUT_VALIDATE_STRUCTURE = "com.ctc.wstx.outputValidateStructure"; //$NON-NLS-1$
-
public static ClobType xslTransform(CommandContext context, Object xml, Object styleSheet) throws Exception {
Source styleSource = null;
Source xmlSource = null;
@@ -244,7 +274,7 @@
styleSource = convertToSource(styleSheet);
xmlSource = convertToSource(xml);
final Source xmlParam = xmlSource;
- TransformerFactory factory = TransformerFactory.newInstance();
+ TransformerFactory factory = threadLocalTransformerFactory.get();
final Transformer transformer = factory.newTransformer(styleSource);
//this creates a non-validated sqlxml - it may not be valid xml/root-less xml
@@ -284,7 +314,7 @@
try {
XMLOutputFactory factory = getOutputFactory();
XMLEventWriter eventWriter = factory.createXMLEventWriter(writer);
- XMLEventFactory eventFactory = XMLEventFactory.newInstance();
+ XMLEventFactory eventFactory = threadLocalEventtFactory.get();
for (Evaluator.NameValuePair nameValuePair : values) {
if (nameValuePair.value == null) {
continue;
@@ -320,7 +350,7 @@
try {
XMLOutputFactory factory = getOutputFactory();
XMLEventWriter eventWriter = factory.createXMLEventWriter(writer);
- XMLEventFactory eventFactory = XMLEventFactory.newInstance();
+ XMLEventFactory eventFactory = threadLocalEventtFactory.get();
addElement(name, writer, eventWriter, eventFactory, namespaces, attributes, contents);
eventWriter.close();
} catch (XMLStreamException e) {
@@ -465,14 +495,6 @@
}
- private static XMLOutputFactory getOutputFactory() throws FactoryConfigurationError {
- XMLOutputFactory factory = XMLOutputFactory.newInstance();
- if (factory.isPropertySupported(P_OUTPUT_VALIDATE_STRUCTURE)) {
- factory.setProperty(P_OUTPUT_VALIDATE_STRUCTURE, false);
- }
- return factory;
- }
-
public static XMLType xmlPi(String name) {
return xmlPi(name, ""); //$NON-NLS-1$
}
@@ -555,7 +577,7 @@
}
case UNKNOWN: //assume a document
case DOCUMENT: //filter the doc declaration
- XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ XMLInputFactory inputFactory = XMLType.getXmlInputFactory();
if (!(r instanceof BufferedReader)) {
r = new BufferedReader(r);
}
@@ -569,7 +591,7 @@
eventWriter.add(eventReader);
break;
case TEXT:
- XMLEventFactory eventFactory = XMLEventFactory.newInstance();
+ XMLEventFactory eventFactory = threadLocalEventtFactory.get();
char[] buf = new char[1 << 13];
int read = -1;
while ((read = r.read(buf)) != -1) {
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/mapping
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/mapping:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/mapping:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/mapping:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/mapping:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/mapping/relational
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/mapping/relational:3535-3555
/trunk/engine/src/main/java/org/teiid/query/mapping/relational:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/mapping/relational:3535-3555
/trunk/engine/src/main/java/org/teiid/query/mapping/relational:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/mapping/xml
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/mapping/xml:3535-3555
/trunk/engine/src/main/java/org/teiid/query/mapping/xml:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/mapping/xml:3535-3555
/trunk/engine/src/main/java/org/teiid/query/mapping/xml:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -35,6 +35,7 @@
import javax.xml.stream.XMLStreamWriter;
import org.teiid.query.QueryPlugin;
+import org.teiid.query.function.source.XMLSystemFunctions;
/**
@@ -59,7 +60,7 @@
*/
public void write(MappingDocument doc, PrintWriter stream) throws IOException {
try {
- XMLOutputFactory xof = XMLOutputFactory.newInstance();
+ XMLOutputFactory xof = XMLSystemFunctions.getOutputFactory();
writer = xof.createXMLStreamWriter(stream);
writer.writeStartDocument("UTF-8", "1.0"); //$NON-NLS-1$ //$NON-NLS-2$
writer.writeStartElement(ELEM_ROOT);
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/metadata
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/metadata:3535-3555
/trunk/engine/src/main/java/org/teiid/query/metadata:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/metadata:3535-3555
/trunk/engine/src/main/java/org/teiid/query/metadata:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/optimizer:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/optimizer:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/BatchedUpdatePlanner.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/BatchedUpdatePlanner.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/BatchedUpdatePlanner.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/BatchedUpdatePlanner.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/BatchedUpdatePlanner.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/CommandPlanner.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/CommandPlanner.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/CommandPlanner.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/CommandPlanner.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/CommandPlanner.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/DdlPlanner.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/DdlPlanner.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/DdlPlanner.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/DdlPlanner.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/DdlPlanner.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/TriggerActionPlanner.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/TriggerActionPlanner.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/TriggerActionPlanner.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/TriggerActionPlanner.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/TriggerActionPlanner.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/capabilities
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/capabilities:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/capabilities:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/AliasGenerator.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/AliasGenerator.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/AliasGenerator.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/AliasGenerator.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/AliasGenerator.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/OptimizerRule.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/OptimizerRule.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/OptimizerRule.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/OptimizerRule.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/OptimizerRule.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/PartitionAnalyzer.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/PartitionAnalyzer.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PartitionAnalyzer.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/PartitionAnalyzer.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PartitionAnalyzer.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/PlanHints.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanHints.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanHints.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanHints.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanHints.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java:3149-3217,3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java:3149-3217,3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java:3188-3450,3452-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -100,6 +100,7 @@
import org.teiid.query.sql.lang.QueryCommand;
import org.teiid.query.sql.lang.Select;
import org.teiid.query.sql.lang.SetQuery;
+import org.teiid.query.sql.lang.SourceHint;
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.lang.SubqueryContainer;
import org.teiid.query.sql.lang.SubqueryFromClause;
@@ -157,6 +158,7 @@
private QueryMetadataInterface metadata;
private PlanHints hints = new PlanHints();
private Option option;
+ private SourceHint sourceHint;
public ProcessorPlan optimize(
Command command)
@@ -220,7 +222,7 @@
PlanNode plan;
try {
- plan = generatePlan(command);
+ plan = generatePlan(command, true);
} catch (TeiidProcessingException e) {
throw new QueryPlannerException(e, e.getMessage());
}
@@ -259,7 +261,7 @@
result.setWith(withList);
}
result.setOutputElements(topCols);
-
+ result.setSourceHint(sourceHint);
return result;
}
@@ -296,7 +298,7 @@
private void connectSubqueryContainers(PlanNode plan) throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
Set<GroupSymbol> groupSymbols = getGroupSymbols(plan);
- for (PlanNode node : NodeEditor.findAllNodes(plan, NodeConstants.Types.PROJECT | NodeConstants.Types.SELECT | NodeConstants.Types.JOIN)) {
+ for (PlanNode node : NodeEditor.findAllNodes(plan, NodeConstants.Types.PROJECT | NodeConstants.Types.SELECT | NodeConstants.Types.JOIN | NodeConstants.Types.SOURCE)) {
List<SubqueryContainer> subqueryContainers = node.getSubqueryContainers();
if (subqueryContainers.isEmpty()){
continue;
@@ -483,7 +485,10 @@
return plan;
}
- public PlanNode generatePlan(Command cmd) throws TeiidComponentException, TeiidProcessingException {
+ public PlanNode generatePlan(Command cmd, boolean useSourceHint) throws TeiidComponentException, TeiidProcessingException {
+ if (useSourceHint && cmd.getSourceHint() != null && sourceHint == null) {
+ sourceHint = cmd.getSourceHint();
+ }
//cascade the option clause nocache
Option savedOption = option;
option = cmd.getOption();
@@ -564,7 +569,7 @@
if(!usingTriggerAction && command instanceof Insert){
Insert insert = (Insert)command;
if (insert.getQueryExpression() != null) {
- PlanNode plan = generatePlan(insert.getQueryExpression());
+ PlanNode plan = generatePlan(insert.getQueryExpression(), true);
attachLast(sourceNode, plan);
mergeTempMetadata(insert.getQueryExpression(), insert);
projectNode.setProperty(NodeConstants.Info.INTO_GROUP, insert.getGroup());
@@ -699,9 +704,12 @@
} else {
hints.hasSetQuery = true;
SetQuery query = (SetQuery)command;
+ boolean hasSourceHint = sourceHint != null;
PlanNode leftPlan = createQueryPlan( query.getLeftQuery());
PlanNode rightPlan = createQueryPlan( query.getRightQuery());
-
+ if (!hasSourceHint) {
+ sourceHint = null;
+ }
node = NodeFactory.getNewNode(NodeConstants.Types.SET_OP);
node.setProperty(NodeConstants.Info.SET_OPERATION, query.getOperation());
node.setProperty(NodeConstants.Info.USE_ALL, query.isAll());
@@ -839,12 +847,18 @@
if (group.getModelMetadataId() != null) {
node.setProperty(Info.MODEL_ID, group.getModelMetadataId());
}
+ if (ufc.isNoUnnest()) {
+ node.setProperty(Info.NO_UNNEST, Boolean.TRUE);
+ }
node.addGroup(group);
if (nestedCommand != null) {
UpdateInfo info = ProcedureContainerResolver.getUpdateInfo(group, metadata);
if (info != null && info.getPartitionInfo() != null && !info.getPartitionInfo().isEmpty()) {
node.setProperty(NodeConstants.Info.PARTITION_INFO, info.getPartitionInfo());
}
+ if (parent.getType() != NodeConstants.Types.JOIN && nestedCommand.getSourceHint() != null && sourceHint == null) {
+ sourceHint = nestedCommand.getSourceHint();
+ }
addNestedCommand(node, group, nestedCommand, nestedCommand, true);
}
parent.addLastChild(node);
@@ -882,6 +896,9 @@
if (sfc.isTable()) {
sfc.getCommand().setCorrelatedReferences(getCorrelatedReferences(parent, node, sfc));
}
+ if (sfc.isNoUnnest()) {
+ node.setProperty(Info.NO_UNNEST, Boolean.TRUE);
+ }
node.addGroup(group);
addNestedCommand(node, group, nestedCommand, nestedCommand, true);
if (nestedCommand instanceof SetQuery) {
@@ -978,7 +995,7 @@
if (merge) {
mergeTempMetadata(nestedCommand, parentCommand);
- PlanNode childRoot = generatePlan(nestedCommand);
+ PlanNode childRoot = generatePlan(nestedCommand, false);
node.addFirstChild(childRoot);
List<SingleElementSymbol> projectCols = nestedCommand.getProjectedSymbols();
SymbolMap map = SymbolMap.createSymbolMap(group, projectCols, metadata);
@@ -1145,6 +1162,9 @@
if (limit.isImplicit()) {
limitNode.setProperty(Info.IS_IMPLICIT_LIMIT, true);
}
+ if (limit.isStrict()) {
+ limitNode.setProperty(Info.IS_STRICT, true);
+ }
attachLast(limitNode, plan);
plan = limitNode;
}
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java:3149-3217,3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java:3149-3217,3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/RuleStack.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/RuleStack.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RuleStack.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/RuleStack.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RuleStack.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/plantree
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/plantree:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/plantree:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/plantree:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/plantree:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/NodeConstants.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/NodeConstants.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/NodeConstants.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -126,6 +126,7 @@
CORRELATED_REFERENCES, // SymbolMap
MAKE_NOT_DEP, // Boolean
INLINE_VIEW, // If the source node represents an inline view
+ NO_UNNEST,
MAKE_IND,
// Group node properties
@@ -141,12 +142,14 @@
EST_JOIN_COST, // Float value that represents the estimated cost of a merge join (the join strategy for this could be Nested Loop or Merge)
EST_CARDINALITY, // Float represents the estimated cardinality (amount of rows) produced by this node
EST_COL_STATS,
- EST_SELECTIVITY, // Float that represents the selectivity of a criteria node
+ EST_SELECTIVITY, // Float that represents the selectivity of a criteria node
+ MAX_NDV, // The max NDV before the dependent join will be aborted
// Tuple limit and offset
MAX_TUPLE_LIMIT, // Expression that evaluates to the max number of tuples generated
OFFSET_TUPLE_COUNT, // Expression that evaluates to the tuple offset of the starting tuple
IS_IMPLICIT_LIMIT, // Boolean if the limit is created by the rewriter as part of a subquery optimization
+ IS_STRICT, // Boolean if the unordered limit should be enforced strictly
// Common AP Information
ACCESS_PATTERNS, // Collection <List <Object element ID> >
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/plantree/PlanNode.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -38,6 +38,7 @@
import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.lang.SubqueryContainer;
+import org.teiid.query.sql.lang.TableFunctionReference;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.GroupSymbol;
@@ -376,6 +377,13 @@
toSearch = (List<Criteria>) this.getProperty(NodeConstants.Info.JOIN_CRITERIA);
break;
}
+ case NodeConstants.Types.SOURCE: {
+ TableFunctionReference tfr = (TableFunctionReference)this.getProperty(NodeConstants.Info.TABLE_FUNCTION);
+ if (tfr != null) {
+ toSearch = Arrays.asList(tfr);
+ }
+ break;
+ }
}
return ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(toSearch);
}
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -547,8 +547,8 @@
return null;
}
- public static boolean isOrderedLimit(PlanNode node) {
- return node.getType() == NodeConstants.Types.TUPLE_LIMIT && NodeEditor.findNodePreOrder(node, NodeConstants.Types.SORT, NodeConstants.Types.PROJECT | NodeConstants.Types.SET_OP) != null;
+ public static boolean isOrderedOrStrictLimit(PlanNode node) {
+ return node.getType() == NodeConstants.Types.TUPLE_LIMIT && (NodeEditor.findNodePreOrder(node, NodeConstants.Types.SORT, NodeConstants.Types.PROJECT | NodeConstants.Types.SET_OP) != null || node.hasProperty(Info.IS_STRICT));
}
}
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -534,6 +534,9 @@
if (function.getFunctionDescriptor().getPushdown() != PushDown.MUST_PUSHDOWN || EvaluatableVisitor.willBecomeConstant(function)) {
continue;
}
+ if (!getWindowFunctions(Arrays.asList(ss)).isEmpty()) {
+ break; //TODO: support subexpression pushing
+ }
//assume we need the whole thing
requiredSymbols.add(ss);
symbolRequired = true;
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleChooseDependent.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleChooseDependent.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleChooseDependent.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -326,11 +326,13 @@
Expression indepExpr = (Expression) independentExpressions.get(i);
DependentSetCriteria crit = new DependentSetCriteria(SymbolMap.getExpression(depExpr), id);
float ndv = NewCalculateCostUtil.UNKNOWN_VALUE;
+ Float maxNdv = null;
if (dca != null && dca.expectedNdv[i] != null) {
if (dca.expectedNdv[i] > 4*dca.maxNdv[i]) {
continue; //not necessary to use
}
ndv = dca.expectedNdv[i];
+ maxNdv = dca.maxNdv[i];
crit.setMaxNdv(dca.maxNdv[i]);
} else {
Collection<ElementSymbol> elems = ElementCollectorVisitor.getElements(indepExpr, true);
@@ -345,6 +347,9 @@
PlanNode selectNode = RelationalPlanner.createSelectNode(crit, false);
selectNode.setProperty(NodeConstants.Info.IS_DEPENDENT_SET, Boolean.TRUE);
+ if (maxNdv != null) {
+ selectNode.setProperty(NodeConstants.Info.MAX_NDV, maxNdv);
+ }
result.add(selectNode);
}
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -81,7 +81,9 @@
static PlanNode doMerge(PlanNode frame,
PlanNode root, boolean beforeDecomposeJoin,
QueryMetadataInterface metadata) throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
-
+ if (frame.hasBooleanProperty(Info.NO_UNNEST)) {
+ return root;
+ }
GroupSymbol virtualGroup = frame.getGroups().iterator().next();
// check to see if frame represents a proc relational query.
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushLimit.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushLimit.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushLimit.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -45,6 +45,7 @@
import org.teiid.query.optimizer.relational.plantree.NodeEditor;
import org.teiid.query.optimizer.relational.plantree.NodeFactory;
import org.teiid.query.optimizer.relational.plantree.PlanNode;
+import org.teiid.query.optimizer.relational.plantree.NodeConstants.Info;
import org.teiid.query.sql.lang.CompareCriteria;
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.lang.SetQuery;
@@ -135,7 +136,9 @@
Expression childOffset = (Expression)child.getProperty(NodeConstants.Info.OFFSET_TUPLE_COUNT);
combineLimits(limitNode, metadata, parentLimit, parentOffset, childLimit, childOffset);
-
+ if (child.hasBooleanProperty(Info.IS_STRICT)) {
+ limitNode.setProperty(Info.IS_STRICT, true);
+ }
NodeEditor.removeChildNode(limitNode, child);
limitNodes.remove(child);
@@ -143,10 +146,12 @@
}
case NodeConstants.Types.SET_OP:
{
- if (!SetQuery.Operation.UNION.equals(child.getProperty(NodeConstants.Info.SET_OPERATION))
- || !child.hasBooleanProperty(NodeConstants.Info.USE_ALL)) {
- return false;
- }
+ if (!SetQuery.Operation.UNION.equals(child.getProperty(NodeConstants.Info.SET_OPERATION))) {
+ return false;
+ }
+ if (!child.hasBooleanProperty(NodeConstants.Info.USE_ALL) && limitNode.hasBooleanProperty(Info.IS_STRICT)) {
+ return false;
+ }
//distribute the limit
List<PlanNode> grandChildren = new LinkedList<PlanNode>(child.getChildren());
for (PlanNode grandChild : grandChildren) {
@@ -171,13 +176,16 @@
{
GroupSymbol virtualGroup = child.getGroups().iterator().next();
if (virtualGroup.isProcedure()) {
- return false;
+ return false;
}
if (FrameUtil.isProcedure(child.getFirstChild())) {
return false;
}
return true;
}
+ case NodeConstants.Types.SELECT:
+ case NodeConstants.Types.DUP_REMOVE:
+ return !limitNode.hasBooleanProperty(Info.IS_STRICT);
default:
{
return false;
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -343,7 +343,7 @@
}
satisfyAccessPatterns(critNode, currentNode);
- } else if (FrameUtil.isOrderedLimit(currentNode)) {
+ } else if (FrameUtil.isOrderedOrStrictLimit(currentNode)) {
return currentNode;
}
}
@@ -355,7 +355,7 @@
throws QueryPlannerException {
//ensure that the criteria can be pushed further
- if (sourceNode.getChildCount() == 1 && FrameUtil.isOrderedLimit(sourceNode.getFirstChild())) {
+ if (sourceNode.getChildCount() == 1 && FrameUtil.isOrderedOrStrictLimit(sourceNode.getFirstChild())) {
return false;
}
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -423,7 +423,7 @@
//don't push criteria into an invalid location above an ordered limit - shouldn't happen
PlanNode limitNode = NodeEditor.findNodePreOrder(accessNode, NodeConstants.Types.TUPLE_LIMIT, NodeConstants.Types.SOURCE);
- if (limitNode != null && FrameUtil.isOrderedLimit(limitNode)) {
+ if (limitNode != null && FrameUtil.isOrderedOrStrictLimit(limitNode)) {
return false;
}
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -44,7 +44,6 @@
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.lang.JoinType;
import org.teiid.query.sql.symbol.AggregateSymbol;
-import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.visitor.GroupsUsedByElementsVisitor;
import org.teiid.query.util.CommandContext;
@@ -205,10 +204,6 @@
return NodeEditor.findAllNodes(optionalNode, NodeConstants.Types.JOIN);
}
- /**
- * Ensure that the needed elements come only from the left hand side and
- * that cardinality won't matter
- */
static boolean useNonDistinctRows(PlanNode parent) {
while (parent != null) {
if (parent.hasBooleanProperty(NodeConstants.Info.IS_DUP_REMOVAL)) {
@@ -229,16 +224,11 @@
return AggregateSymbol.areAggregatesCardinalityDependent(aggs);
}
case NodeConstants.Types.TUPLE_LIMIT: {
- if (!(parent.getProperty(NodeConstants.Info.MAX_TUPLE_LIMIT) instanceof Constant)
- || parent.getProperty(NodeConstants.Info.OFFSET_TUPLE_COUNT) != null) {
+ if (FrameUtil.isOrderedOrStrictLimit(parent)) {
return true;
}
- Constant constant = (Constant)parent.getProperty(NodeConstants.Info.MAX_TUPLE_LIMIT);
- if (!Integer.valueOf(1).equals(constant.getValue())) {
- return true;
- }
}
- //we assmue that projects of non-deterministic expressions do not matter
+ //we assume that projects of non-deterministic expressions do not matter
}
parent = parent.getParent();
}
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/optimizer/xml
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/xml:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/xml:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/xml:3535-3555
/trunk/engine/src/main/java/org/teiid/query/optimizer/xml:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -200,7 +200,7 @@
if (rsInfo.exceptionOnRowlimit()) {
limit++;
}
- rsQuery.setLimit(new Limit(null, new Constant(new Integer(limit))));
+ rsQuery.setLimit(new Limit(null, new Constant(limit)));
}
// this query is not eligible for staging; proceed normally.
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/parser
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/parser:3535-3555
/trunk/engine/src/main/java/org/teiid/query/parser:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/parser:3535-3555
/trunk/engine/src/main/java/org/teiid/query/parser:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/parser/ParseInfo.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/parser/ParseInfo.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/parser/ParseInfo.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -23,25 +23,23 @@
package org.teiid.query.parser;
import java.io.Serializable;
-import java.util.HashMap;
import java.util.Map;
-import org.teiid.query.sql.lang.CacheHint;
+import org.teiid.core.util.PropertiesUtils;
public class ParseInfo implements Serializable{
private static final long serialVersionUID = -7323683731955992888L;
+ private static final boolean ANSI_QUOTED_DEFAULT = PropertiesUtils.getBooleanProperty(System.getProperties(), "org.teiid.ansiQuotedIdentifiers", true); //$NON-NLS-1$
- public Map<String, Integer> nameCounts = new HashMap<String, Integer>();
+ public Map<String, Integer> nameCounts = null;
public int referenceCount = 0;
// treat a double quoted variable as variable instead of string
- public boolean ansiQuotedIdentifiers=Boolean.valueOf(System.getProperty("org.teiid.ansiQuotedIdentifiers", Boolean.TRUE.toString())).booleanValue(); //$NON-NLS-1$
+ public boolean ansiQuotedIdentifiers=ANSI_QUOTED_DEFAULT;
- public CacheHint cacheHint;
-
public ParseInfo() { }
public boolean useAnsiQuotedIdentifiers() {
Modified: branches/as7/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -22,6 +22,7 @@
package org.teiid.query.parser;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -36,9 +37,11 @@
import org.teiid.query.sql.lang.CacheHint;
import org.teiid.query.sql.lang.FromClause;
import org.teiid.query.sql.lang.JoinType;
+import org.teiid.query.sql.lang.Limit;
import org.teiid.query.sql.lang.Option;
import org.teiid.query.sql.lang.QueryCommand;
import org.teiid.query.sql.lang.SetQuery;
+import org.teiid.query.sql.lang.SourceHint;
import org.teiid.query.sql.lang.ExistsCriteria.SubqueryHint;
import org.teiid.query.sql.proc.Block;
import org.teiid.query.sql.proc.CriteriaSelector;
@@ -180,7 +183,9 @@
fromClause.setMakeNotDep(true);
} else if (parts[i].equalsIgnoreCase(FromClause.MAKEIND)) {
fromClause.setMakeInd(true);
- }
+ } else if (parts[i].equalsIgnoreCase(SubqueryHint.NOUNNEST)) {
+ fromClause.setNoUnnest(true);
+ }
}
}
@@ -204,13 +209,52 @@
if (optToken == null) {
return ""; //$NON-NLS-1$
}
- String hint = optToken.image.substring(2, optToken.image.length() - 2);
+ //handle nested comments
+ String image = optToken.image;
+ while (optToken.specialToken != null) {
+ optToken = optToken.specialToken;
+ image = optToken.image + image;
+ }
+ String hint = image.substring(2, image.length() - 2);
if (hint.startsWith("+")) { //$NON-NLS-1$
hint = hint.substring(1);
}
return hint;
}
+ private static Pattern SOURCE_HINT = Pattern.compile("\\s*sh(?::((?:'[^']*')+))?\\s*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); //$NON-NLS-1$
+ private static Pattern SOURCE_HINT_ARG = Pattern.compile("\\s*([^:]+):((?:'[^']*')+)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); //$NON-NLS-1$
+
+ SourceHint getSourceHint(Token t) {
+ String comment = getComment(t);
+ Matcher matcher = SOURCE_HINT.matcher(comment);
+ if (!matcher.find()) {
+ return null;
+ }
+ SourceHint sourceHint = new SourceHint();
+ String generalHint = matcher.group(1);
+ if (generalHint != null) {
+ sourceHint.setGeneralHint(normalizeStringLiteral(generalHint));
+ }
+ int end = matcher.end();
+ matcher = SOURCE_HINT_ARG.matcher(comment);
+ while (matcher.find(end)) {
+ end = matcher.end();
+ sourceHint.setSourceHint(matcher.group(1), normalizeStringLiteral(matcher.group(2)));
+ }
+ return sourceHint;
+ }
+
+ boolean isNonStrictHint(Token t) {
+ String[] parts = getComment(t).split("\\s"); //$NON-NLS-1$
+ for (int i = 0; i < parts.length; i++) {
+ if (parts[i].equalsIgnoreCase(Limit.NON_STRICT)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private static Pattern CACHE_HINT = Pattern.compile("/\\*\\+?\\s*cache(\\(\\s*(pref_mem)?\\s*(ttl:\\d{1,19})?\\s*(updatable)?\\s*(scope:(session|vdb|user))?[^\\)]*\\))?[^\\*]*\\*\\/.*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); //$NON-NLS-1$
static CacheHint getQueryCacheOption(String query) {
@@ -281,6 +325,9 @@
} else {
functionType = functionType.toLowerCase();
}
+ if (info.nameCounts == null) {
+ info.nameCounts = new HashMap<String, Integer>();
+ }
Integer num = info.nameCounts.get(functionType);
if (num == null) {
num = 0;
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/processor:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/processor:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor/BatchCollector.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/BatchCollector.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/BatchCollector.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/BatchCollector.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/BatchCollector.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor/BatchIterator.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/BatchIterator.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/BatchIterator.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/BatchIterator.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/BatchIterator.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor/CollectionTupleSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/CollectionTupleSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/CollectionTupleSource.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/CollectionTupleSource.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/CollectionTupleSource.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor/DdlPlan.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/DdlPlan.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/DdlPlan.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/DdlPlan.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/DdlPlan.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java:3220-3275,3340-3349,3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java:3220-3275,3340-3349,3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/QueryProcessor.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor/proc
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/proc:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/proc:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/proc:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/proc:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor/relational
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/relational:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/relational:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -38,6 +38,9 @@
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.query.QueryPlugin;
import org.teiid.query.optimizer.relational.rules.NewCalculateCostUtil;
import org.teiid.query.processor.relational.SortUtility.Mode;
import org.teiid.query.rewriter.QueryRewriter;
@@ -116,7 +119,8 @@
}
last = next;
}
- if (distinctCount > setState.maxNdv) {
+ if (!setState.overMax && distinctCount > setState.maxNdv) {
+ LogManager.logWarning(LogConstants.CTX_DQP, QueryPlugin.Util.getString("DependentCriteriaProcessor.dep_join_backoff", valueSource, setState.valueExpression, setState.maxNdv)); //$NON-NLS-1$
setState.overMax = true;
}
}
Modified: branches/as7/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -44,6 +44,7 @@
import org.teiid.query.sql.lang.Create;
import org.teiid.query.sql.lang.Insert;
import org.teiid.query.sql.lang.QueryCommand;
+import org.teiid.query.sql.lang.SourceHint;
import org.teiid.query.sql.lang.WithQueryCommand;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.tempdata.TempTableStore.TransactionMode;
@@ -62,6 +63,7 @@
private QueryProcessor withProcessor;
private TempTableStore tempTableStore;
private boolean multisourceUpdate;
+ private SourceHint sourceHint;
/**
* Constructor for RelationalPlan.
@@ -82,10 +84,21 @@
this.with = with;
}
+ public void setSourceHint(SourceHint sourceHint) {
+ this.sourceHint = sourceHint;
+ }
+
+ public SourceHint getSourceHint() {
+ return sourceHint;
+ }
+
/**
* @see ProcessorPlan#connectDataManager(ProcessorDataManager)
*/
public void initialize(CommandContext context, ProcessorDataManager dataMgr, BufferManager bufferMgr) {
+ if (sourceHint != null && context.getSourceHint() == null) {
+ context.setSourceHint(sourceHint);
+ }
if (this.with != null) {
context = context.clone();
tempTableStore = new TempTableStore(context.getConnectionID(), TransactionMode.NONE);
@@ -207,6 +220,7 @@
public RelationalPlan clone(){
RelationalPlan plan = new RelationalPlan((RelationalNode)root.clone());
+ plan.sourceHint = this.sourceHint;
plan.setOutputElements(outputCols);
if (with != null) {
List<WithQueryCommand> newWith = LanguageObject.Util.deepClone(this.with, WithQueryCommand.class);
Modified: branches/as7/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareEvaluator.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -22,15 +22,20 @@
package org.teiid.query.processor.relational;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.TupleBuffer;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.util.LRUCache;
+import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.processor.BatchCollector;
import org.teiid.query.processor.ProcessorDataManager;
@@ -40,11 +45,9 @@
import org.teiid.query.sql.symbol.ContextReference;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
-import org.teiid.query.sql.symbol.ScalarSubquery;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.util.ValueIterator;
import org.teiid.query.sql.util.VariableContext;
-import org.teiid.query.sql.visitor.FunctionCollectorVisitor;
import org.teiid.query.util.CommandContext;
@@ -57,20 +60,19 @@
public class SubqueryState {
QueryProcessor processor;
BatchCollector collector;
- boolean done;
ProcessorPlan plan;
- boolean nonDeterministic;
List<Object> refValues;
boolean comparable = true;
- void close() {
+ void close(boolean removeBuffer) {
if (processor == null) {
return;
}
processor.closeProcessing();
- collector.getTupleBuffer().remove();
+ if (removeBuffer) {
+ collector.getTupleBuffer().remove();
+ }
processor = null;
- this.done = false;
}
}
@@ -79,11 +81,19 @@
//processing state
private Map<String, SubqueryState> subqueries = new HashMap<String, SubqueryState>();
+ private LRUCache<List<?>, TupleBuffer> cache = new LRUCache<List<?>, TupleBuffer>(1024);
+ private int maxTuples = BufferManager.DEFAULT_PROCESSOR_BATCH_SIZE << 4;
+ private int currentTuples = 0;
public SubqueryAwareEvaluator(Map elements, ProcessorDataManager dataMgr,
CommandContext context, BufferManager manager) {
super(elements, dataMgr, context);
this.manager = manager;
+ //default to 16 batches
+ if (this.manager != null) {
+ this.maxTuples = this.manager.getProcessorBatchSize() << 4;
+ }
+ //TODO the number of cache entries and the max tuples should be based upon the reference count and types involved as well.
}
public void reset() {
@@ -94,23 +104,24 @@
public void close() {
for (SubqueryState state : subqueries.values()) {
- state.close();
+ state.close(true);
}
+ for (TupleBuffer buffer : cache.values()) {
+ buffer.remove();
+ }
+ cache.clear();
}
@Override
- protected ValueIterator evaluateSubquery(SubqueryContainer container,
- List tuple) throws TeiidProcessingException, BlockedException,
+ protected ValueIterator evaluateSubquery(SubqueryContainer<?> container,
+ List<?> tuple) throws TeiidProcessingException, BlockedException,
TeiidComponentException {
ContextReference ref = (ContextReference)container;
- String key = (ref).getContextSymbol();
+ String key = ref.getContextSymbol();
SubqueryState state = this.subqueries.get(key);
if (state == null) {
state = new SubqueryState();
state.plan = container.getCommand().getProcessorPlan().clone();
- if (container instanceof ScalarSubquery) {
- state.nonDeterministic = FunctionCollectorVisitor.isNonDeterministic(container.getCommand());
- }
if (container.getCommand().getCorrelatedReferences() != null) {
for (ElementSymbol es : container.getCommand().getCorrelatedReferences().getKeys()) {
if (DataTypeManager.isNonComparable(DataTypeManager.getDataTypeName(es.getType()))) {
@@ -123,7 +134,16 @@
}
SymbolMap correlatedRefs = container.getCommand().getCorrelatedReferences();
VariableContext currentContext = null;
- boolean shouldClose = state.done && state.nonDeterministic;
+ boolean shouldClose = false;
+ boolean deterministic = true;
+ if (state.processor != null) {
+ Determinism determinism = state.processor.getContext().getDeterminismLevel();
+ deterministic = Determinism.COMMAND_DETERMINISTIC.compareTo(determinism) <= 0;
+ if (!deterministic) {
+ shouldClose = true;
+ }
+ }
+ boolean removeBuffer = true;
if (correlatedRefs != null) {
currentContext = new VariableContext();
for (Map.Entry<ElementSymbol, Expression> entry : container.getCommand().getCorrelatedReferences().asMap().entrySet()) {
@@ -131,30 +151,58 @@
}
List<Object> refValues = currentContext.getLocalValues();
if (!refValues.equals(state.refValues)) {
+ if (state.comparable && deterministic) {
+ if (state.processor != null) {
+ //cache the old value
+ TupleBuffer tb = state.collector.collectTuples();
+ //recheck determinism as the plan may not have been fully processed by the initial check
+ Determinism determinism = state.processor.getContext().getDeterminismLevel();
+ deterministic = Determinism.COMMAND_DETERMINISTIC.compareTo(determinism) <= 0;
+ if (deterministic) {
+ //allowed to track up to 4x the maximum results size
+ maxTuples = Math.max(tb.getRowCount() << 2, maxTuples);
+ ArrayList<Object> cacheKey = new ArrayList<Object>(state.refValues);
+ cacheKey.add(key);
+ tb.saveBatch(); //ensure that we aren't leaving large last batches in memory
+ this.cache.put(cacheKey, tb);
+ removeBuffer = false;
+ this.currentTuples += tb.getRowCount();
+ while (this.currentTuples > maxTuples && !cache.isEmpty()) {
+ //TODO: this should handle empty results better
+ Iterator<TupleBuffer> i = this.cache.values().iterator();
+ TupleBuffer buffer = i.next();
+ buffer.remove();
+ this.currentTuples -= buffer.getRowCount();
+ i.remove();
+ }
+ }
+ }
+ //find if we have cached values
+ List<Object> cacheKey = new ArrayList<Object>(refValues);
+ cacheKey.add(key);
+ TupleBuffer cachedResult = cache.get(cacheKey);
+ if (cachedResult != null) {
+ state.close(false);
+ return new TupleSourceValueIterator(cachedResult.createIndexedTupleSource(), 0);
+ }
+ }
state.refValues = refValues;
shouldClose = true;
}
}
if (shouldClose) {
- //if (state.done && state.comparable) {
- //cache
- //} else {
- state.close();
- //}
+ state.close(removeBuffer);
}
- if (!state.done) {
- if (state.processor == null) {
- CommandContext subContext = context.clone();
- state.plan.reset();
- state.processor = new QueryProcessor(state.plan, subContext, manager, this.dataMgr);
- if (currentContext != null) {
- state.processor.getContext().pushVariableContext(currentContext);
- }
- state.collector = state.processor.createBatchCollector();
- }
- state.done = true;
+ if (state.processor == null) {
+ CommandContext subContext = context.clone();
+ state.plan.reset();
+ state.processor = new QueryProcessor(state.plan, subContext, manager, this.dataMgr);
+ if (currentContext != null) {
+ state.processor.getContext().pushVariableContext(currentContext);
+ }
+ state.collector = state.processor.createBatchCollector();
}
- return new DependentValueSource(state.collector.collectTuples()).getValueIterator(ref.getValueExpression());
+ return new TupleSourceValueIterator(state.collector.collectTuples().createIndexedTupleSource(), 0);
}
}
Modified: branches/as7/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -52,9 +52,11 @@
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.XMLType;
import org.teiid.query.QueryPlugin;
+import org.teiid.query.eval.Evaluator;
import org.teiid.query.function.FunctionDescriptor;
import org.teiid.query.sql.lang.XMLTable;
import org.teiid.query.sql.lang.XMLTable.XMLColumn;
+import org.teiid.query.xquery.saxon.XQueryEvaluator;
import org.teiid.query.xquery.saxon.SaxonXQueryExpression.Result;
import org.teiid.query.xquery.saxon.SaxonXQueryExpression.RowProcessor;
@@ -76,6 +78,8 @@
typeMapping.put(DataTypeManager.DefaultDataClasses.DOUBLE, BuiltInAtomicType.DOUBLE);
}
+ private static RuntimeException EARLY_TERMINATION = new RuntimeException();
+
private XMLTable table;
private List<XMLColumn> projectedColumns;
@@ -84,6 +88,8 @@
private Item item;
private TupleBuffer buffer;
+ private boolean batchAvailable = false;
+ private TeiidRuntimeException asynchException;
private int outputRow = 1;
private boolean usingOutput;
@@ -92,7 +98,7 @@
}
@Override
- public void closeDirect() {
+ public synchronized void closeDirect() {
super.closeDirect();
if(this.buffer != null) {
if (!usingOutput) {
@@ -115,6 +121,8 @@
outputRow = 1;
usingOutput = false;
this.buffer = null;
+ this.batchAvailable = false;
+ this.asynchException = null;
}
public void setTable(XMLTable table) {
@@ -135,14 +143,23 @@
}
@Override
- protected TupleBatch nextBatchDirect() throws BlockedException,
+ protected synchronized TupleBatch nextBatchDirect() throws BlockedException,
TeiidComponentException, TeiidProcessingException {
- evaluate();
+ evaluate(false);
if (this.table.getXQueryExpression().isStreaming()) {
+ while (!batchAvailable) {
+ try {
+ this.wait();
+ } catch (InterruptedException e) {
+ throw new TeiidRuntimeException(e);
+ }
+ }
+ unwrapException(asynchException);
TupleBatch batch = this.buffer.getBatch(outputRow);
outputRow = batch.getEndRow() + 1;
+ batchAvailable = hasNextBatch();
return batch;
}
@@ -164,34 +181,70 @@
return pullBatch();
}
- private void evaluate() throws TeiidComponentException,
+ private void evaluate(final boolean useFinalBuffer) throws TeiidComponentException,
ExpressionEvaluationException, BlockedException,
TeiidProcessingException {
- if (result == null) {
- if (this.buffer == null && this.table.getXQueryExpression().isStreaming()) {
- this.buffer = this.getBufferManager().createTupleBuffer(getOutputElements(), getConnectionID(), TupleSourceType.PROCESSOR);
+ if (result != null || this.buffer != null) {
+ return;
+ }
+ setReferenceValues(this.table);
+ final HashMap<String, Object> parameters = new HashMap<String, Object>();
+ Evaluator eval = getEvaluator(Collections.emptyMap());
+ final Object contextItem = eval.evaluateParameters(this.table.getPassing(), null, parameters);
+
+ if (this.table.getXQueryExpression().isStreaming()) {
+ if (this.buffer == null) {
+ this.buffer = this.getBufferManager().createTupleBuffer(getOutputElements(), getConnectionID(), TupleSourceType.PROCESSOR);
}
- setReferenceValues(this.table);
- try {
- result = getEvaluator(Collections.emptyMap()).evaluateXQuery(this.table.getXQueryExpression(), this.table.getPassing(), null, this);
- if (this.buffer != null) {
- this.buffer.close();
- if (!usingOutput) {
- this.buffer.setForwardOnly(true);
+ Runnable r = new Runnable() {
+ @Override
+ public void run() {
+ try {
+ if (!useFinalBuffer) {
+ buffer.setForwardOnly(true);
+ }
+ XQueryEvaluator.evaluateXQuery(table.getXQueryExpression(), contextItem, parameters, XMLTableNode.this, getContext());
+ buffer.close();
+ } catch (TeiidException e) {
+ asynchException = new TeiidRuntimeException(e);
+ } catch (TeiidRuntimeException e) {
+ asynchException = e;
+ } catch (RuntimeException e) {
+ if (e != EARLY_TERMINATION) {
+ asynchException = new TeiidRuntimeException(e);
+ }
+ } finally {
+ batchAvailable = true;
+ synchronized (XMLTableNode.this) {
+ XMLTableNode.this.notifyAll();
+ }
}
}
- } catch (TeiidRuntimeException e) {
- if (e.getCause() instanceof TeiidComponentException) {
- throw (TeiidComponentException)e.getCause();
- }
- if (e.getCause() instanceof TeiidProcessingException) {
- throw (TeiidProcessingException)e.getCause();
- }
- throw e;
- }
+ };
+ this.getContext().getExecutor().execute(r);
+ return;
}
+ try {
+ result = XQueryEvaluator.evaluateXQuery(this.table.getXQueryExpression(), contextItem, parameters, null, this.getContext());
+ } catch (TeiidRuntimeException e) {
+ unwrapException(e);
+ }
}
+ private void unwrapException(TeiidRuntimeException e)
+ throws TeiidComponentException, TeiidProcessingException {
+ if (e == null) {
+ return;
+ }
+ if (e.getCause() instanceof TeiidComponentException) {
+ throw (TeiidComponentException)e.getCause();
+ }
+ if (e.getCause() instanceof TeiidProcessingException) {
+ throw (TeiidProcessingException)e.getCause();
+ }
+ throw e;
+ }
+
private List<?> processRow() throws ExpressionEvaluationException, BlockedException,
TeiidComponentException, TeiidProcessingException {
List<Object> tuple = new ArrayList<Object>(projectedColumns.size());
@@ -256,23 +309,35 @@
@Override
public TupleBuffer getFinalBuffer() throws BlockedException,
TeiidComponentException, TeiidProcessingException {
- evaluate();
+ evaluate(true);
usingOutput = true;
TupleBuffer finalBuffer = this.buffer;
- this.buffer = null;
- close();
+ if (!this.table.getXQueryExpression().isStreaming()) {
+ close();
+ }
return finalBuffer;
}
@Override
- public void processRow(NodeInfo row) {
+ public synchronized void processRow(NodeInfo row) {
+ if (isClosed()) {
+ throw EARLY_TERMINATION;
+ }
this.item = row;
rowCount++;
try {
this.buffer.addTuple(processRow());
+ if (hasNextBatch()) {
+ this.batchAvailable = true;
+ this.notifyAll();
+ }
} catch (TeiidException e) {
throw new TeiidRuntimeException(e);
}
}
-
+
+ private boolean hasNextBatch() {
+ return this.outputRow + this.buffer.getBatchSize() <= rowCount + 1;
+ }
+
}
\ No newline at end of file
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/processor/xml
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/xml:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/xml:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/processor/xml:3535-3555
/trunk/engine/src/main/java/org/teiid/query/processor/xml:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/report
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/report:3535-3555
/trunk/engine/src/main/java/org/teiid/query/report:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/report:3535-3555
/trunk/engine/src/main/java/org/teiid/query/report:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/resolver
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/resolver:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/resolver:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/resolver/CommandResolver.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/CommandResolver.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/CommandResolver.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/CommandResolver.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/CommandResolver.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/resolver/QueryResolver.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/QueryResolver.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/QueryResolver.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/QueryResolver.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/QueryResolver.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/resolver/VariableResolver.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/VariableResolver.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/VariableResolver.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/VariableResolver.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/VariableResolver.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/resolver/command
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/command:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/command:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/command:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/command:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -343,12 +343,13 @@
visitNodes(obj.getPassing());
postTableFunctionReference(obj, saved);
try {
+ ResolverUtil.setDesiredType(obj.getPassing(), obj);
obj.compileXqueryExpression();
for (XMLTable.XMLColumn column : obj.getColumns()) {
if (column.getDefaultExpression() == null) {
continue;
}
- ResolverVisitor.resolveLanguageObject(column.getDefaultExpression(), metadata);
+ visitNode(column.getDefaultExpression());
Expression ex = ResolverUtil.convertExpression(column.getDefaultExpression(), DataTypeManager.getDataTypeName(column.getSymbol().getType()), metadata);
column.setDefaultExpression(ex);
}
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/resolver/util
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/util:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/util:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/util:3535-3555
/trunk/engine/src/main/java/org/teiid/query/resolver/util:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -74,6 +74,7 @@
import org.teiid.query.sql.symbol.AggregateSymbol;
import org.teiid.query.sql.symbol.AliasSymbol;
import org.teiid.query.sql.symbol.Constant;
+import org.teiid.query.sql.symbol.DerivedColumn;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.ExpressionSymbol;
@@ -288,6 +289,15 @@
return conversion;
}
+
+ public static void setDesiredType(List<DerivedColumn> passing, LanguageObject obj) throws QueryResolverException {
+ for (DerivedColumn dc : passing) {
+ if (dc.getAlias() == null) {
+ ResolverUtil.setDesiredType(dc.getExpression(), DataTypeManager.DefaultDataClasses.XML, obj);
+ break;
+ }
+ }
+ }
/**
* Utility to set the type of an expression if it is a Reference and has a null type.
Modified: branches/as7/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -402,6 +402,7 @@
@Override
public void visit(XMLQuery obj) {
try {
+ ResolverUtil.setDesiredType(obj.getPassing(), obj);
obj.compileXqueryExpression();
} catch (QueryResolverException e) {
handleException(e);
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/rewriter
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/rewriter:3535-3555
/trunk/engine/src/main/java/org/teiid/query/rewriter:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/rewriter:3535-3555
/trunk/engine/src/main/java/org/teiid/query/rewriter:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -754,13 +754,6 @@
return true;
}
- /**
- * Converts a group by with expressions into a group by with only element symbols and an inline view
- * @param query
- * @return
- * @throws TeiidProcessingException
- * @throws TeiidComponentException
- */
private Query rewriteGroupBy(Query query) throws TeiidComponentException, TeiidProcessingException {
if (query.getGroupBy() == null) {
rewriteAggs = false;
@@ -880,6 +873,8 @@
try {
List<ElementSymbol> allIntoElements = Util.deepClone(ResolverUtil.resolveElementsInGroup(into.getGroup(), metadata), ElementSymbol.class);
Insert insert = new Insert(into.getGroup(), allIntoElements, Collections.emptyList());
+ insert.setSourceHint(query.getSourceHint());
+ query.setSourceHint(null);
query.setInto(null);
insert.setQueryExpression(query);
return rewriteInsert(correctDatatypes(insert));
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/sql
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/sql:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/sql:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/sql:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/sql:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/sql/LanguageObject.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/LanguageObject.java:3149-3217,3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/LanguageObject.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/LanguageObject.java:3149-3217,3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/LanguageObject.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/sql/ProcedureReservedWords.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/ProcedureReservedWords.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/ProcedureReservedWords.java:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/ProcedureReservedWords.java:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/ProcedureReservedWords.java:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/sql/lang
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/lang:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/lang:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/lang:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/lang:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Command.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Command.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Command.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -130,6 +130,7 @@
private SymbolMap correlatedReferences;
private CacheHint cacheHint;
+ private SourceHint sourceHint;
/**
* Return type of command to make it easier to build switch statements by command type.
@@ -231,6 +232,7 @@
copy.setOption( (Option) this.getOption().clone() );
}
copy.cacheHint = this.cacheHint;
+ copy.sourceHint = this.sourceHint;
}
/**
@@ -324,6 +326,14 @@
this.cacheHint = cacheHint;
}
+ public SourceHint getSourceHint() {
+ return sourceHint;
+ }
+
+ public void setSourceHint(SourceHint sourceHint) {
+ this.sourceHint = sourceHint;
+ }
+
/**
* Returns a string representation of an instance of this class.
* @return String representation of object
@@ -333,7 +343,8 @@
}
protected boolean sameOptionAndHint(Command cmd) {
- return EquivalenceUtil.areEqual(this.cacheHint, cmd.cacheHint) &&
+ return EquivalenceUtil.areEqual(this.cacheHint, cmd.cacheHint) &&
+ EquivalenceUtil.areEqual(this.cacheHint, cmd.cacheHint) &&
EquivalenceUtil.areEqual(this.option, cmd.option);
}
Modified: branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Delete.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Delete.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Delete.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -161,6 +161,7 @@
Delete other = (Delete) obj;
return EquivalenceUtil.areEqual(getGroup(), other.getGroup()) &&
+ sameOptionAndHint(other) &&
EquivalenceUtil.areEqual(getCriteria(), other.getCriteria());
}
Modified: branches/as7/engine/src/main/java/org/teiid/query/sql/lang/FromClause.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/sql/lang/FromClause.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/sql/lang/FromClause.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -45,6 +45,7 @@
private boolean makeDep;
private boolean makeNotDep;
private boolean makeInd;
+ private boolean noUnnest;
public boolean isOptional() {
return optional;
@@ -72,8 +73,17 @@
clone.makeInd = makeInd;
clone.makeNotDep = makeNotDep;
clone.optional = optional;
+ clone.noUnnest = noUnnest;
return clone;
}
+
+ public void setNoUnnest(boolean noUnnest) {
+ this.noUnnest = noUnnest;
+ }
+
+ public boolean isNoUnnest() {
+ return noUnnest;
+ }
public boolean isMakeDep() {
return this.makeDep;
@@ -92,7 +102,7 @@
}
public boolean hasHint() {
- return optional || makeDep || makeNotDep || makeInd;
+ return optional || makeDep || makeNotDep || makeInd || noUnnest;
}
public boolean equals(Object obj) {
@@ -109,7 +119,8 @@
return other.isOptional() == this.isOptional()
&& other.isMakeDep() == this.isMakeDep()
&& other.isMakeNotDep() == this.isMakeNotDep()
- && other.isMakeInd() == this.isMakeInd();
+ && other.isMakeInd() == this.isMakeInd()
+ && other.isNoUnnest() == this.isNoUnnest();
}
@Override
Modified: branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Insert.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Insert.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Insert.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -223,6 +223,7 @@
return EquivalenceUtil.areEqual(getGroup(), other.getGroup()) &&
EquivalenceUtil.areEqual(getValues(), other.getValues()) &&
EquivalenceUtil.areEqual(getVariables(), other.getVariables()) &&
+ sameOptionAndHint(other) &&
EquivalenceUtil.areEqual(getQueryExpression(), other.getQueryExpression());
}
Modified: branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Limit.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Limit.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Limit.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -32,10 +32,13 @@
public class Limit implements LanguageObject {
+
+ public static String NON_STRICT = "NON_STRICT"; //$NON-NLS-1$
private Expression offset;
private Expression rowLimit;
private boolean implicit;
+ private boolean strict = true;
public Limit(Expression offset, Expression rowLimit) {
this.offset = offset;
@@ -46,6 +49,14 @@
}
+ public void setStrict(boolean strict) {
+ this.strict = strict;
+ }
+
+ public boolean isStrict() {
+ return strict;
+ }
+
public boolean isImplicit() {
return implicit;
}
@@ -96,6 +107,7 @@
public Limit clone() {
Limit clone = new Limit();
clone.implicit = this.implicit;
+ clone.strict = this.strict;
if (this.rowLimit != null) {
clone.setRowLimit((Expression) this.rowLimit.clone());
}
Modified: branches/as7/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -292,11 +292,17 @@
public String getPatternString(String pattern, char escape)
throws ExpressionEvaluationException {
- StringBuffer newPattern = new StringBuffer("^"); //$NON-NLS-1$
+ int startChar = 0;
+ StringBuffer newPattern = new StringBuffer(pattern.length());
+ if (pattern.length() > 0 && pattern.charAt(0) == '%') {
+ startChar = 1;
+ } else {
+ newPattern.append('^');
+ }
boolean escaped = false;
-
- for (int i = 0; i < pattern.length(); i++) {
+ boolean endsWithMatchAny = false;
+ for (int i = startChar; i < pattern.length(); i++) {
char character = pattern.charAt(i);
if (character == escape && character != NULL_ESCAPE_CHAR) {
@@ -313,6 +319,10 @@
appendCharacter(newPattern, character);
escaped = false;
} else {
+ if (character == '%' && i == pattern.length() - 1) {
+ endsWithMatchAny = true;
+ continue;
+ }
newPattern.append(replacements[index]);
}
} else {
@@ -328,7 +338,9 @@
throw new ExpressionEvaluationException(QueryPlugin.Util.getString("MatchCriteria.invalid_escape", new Object[] {pattern, new Character(escape)})); //$NON-NLS-1$
}
- newPattern.append('$');
+ if (!endsWithMatchAny) {
+ newPattern.append('$');
+ }
return newPattern.toString();
}
Copied: branches/as7/engine/src/main/java/org/teiid/query/sql/lang/SourceHint.java (from rev 3666, trunk/engine/src/main/java/org/teiid/query/sql/lang/SourceHint.java)
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/sql/lang/SourceHint.java (rev 0)
+++ branches/as7/engine/src/main/java/org/teiid/query/sql/lang/SourceHint.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.query.sql.lang;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.teiid.core.util.EquivalenceUtil;
+
+public class SourceHint {
+
+ private String generalHint;
+ private Map<String, String> sourceHints;
+
+ public String getGeneralHint() {
+ return generalHint;
+ }
+
+ public void setGeneralHint(String generalHint) {
+ this.generalHint = generalHint;
+ }
+
+ public void setSourceHint(String translatorName, String hint) {
+ if (this.sourceHints == null) {
+ this.sourceHints = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
+ }
+ this.sourceHints.put(translatorName, hint);
+ }
+
+ public String getSourceHint(String sourceName) {
+ if (this.sourceHints == null) {
+ return null;
+ }
+ return this.sourceHints.get(sourceName);
+ }
+
+ public Map<String, String> getSourceHints() {
+ return sourceHints;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof SourceHint)) {
+ return false;
+ }
+ SourceHint other = (SourceHint)obj;
+ return EquivalenceUtil.areEqual(generalHint, other.generalHint)
+ && EquivalenceUtil.areEqual(this.sourceHints, other.sourceHints);
+ }
+
+}
Modified: branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Update.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Update.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/sql/lang/Update.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -206,12 +206,9 @@
Update other = (Update) obj;
return
- // Compare the groups
EquivalenceUtil.areEqual(getGroup(), other.getGroup()) &&
- // Compare the changeList by checking to see if
- // both objects contains exactly the same CompareCriteria objects.
getChangeList().equals(other.getChangeList()) &&
- // Compare the criteria clauses
+ sameOptionAndHint(other) &&
EquivalenceUtil.areEqual(getCriteria(), other.getCriteria());
}
@@ -261,12 +258,12 @@
LinkedHashMap<ElementSymbol, Expression> map = new LinkedHashMap<ElementSymbol, Expression>();
- for (Iterator iter = getChangeList().getClauses().iterator(); iter.hasNext();) {
- SetClause setClause = (SetClause)iter.next();
- ElementSymbol symbol = (ElementSymbol)(setClause.getSymbol()).clone();
+ for (Iterator<SetClause> iter = getChangeList().getClauses().iterator(); iter.hasNext();) {
+ SetClause setClause = iter.next();
+ ElementSymbol symbol = setClause.getSymbol().clone();
symbol.setGroupSymbol(new GroupSymbol(ProcedureReservedWords.INPUTS));
map.put( symbol, setClause.getValue() );
- } // for
+ }
return map;
}
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/sql/navigator
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/navigator:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/navigator:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/navigator:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/navigator:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/sql/proc
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/proc:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/proc:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/proc:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/proc:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/sql/symbol
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/symbol:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/symbol:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/symbol:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/symbol:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/sql/util
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/util:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/util:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/util:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/util:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/sql/visitor
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/visitor:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/visitor:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/sql/visitor:3535-3555
/trunk/engine/src/main/java/org/teiid/query/sql/visitor:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -28,6 +28,7 @@
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.StringUtil;
@@ -78,6 +79,7 @@
import org.teiid.query.sql.lang.SetClauseList;
import org.teiid.query.sql.lang.SetCriteria;
import org.teiid.query.sql.lang.SetQuery;
+import org.teiid.query.sql.lang.SourceHint;
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.lang.SubqueryCompareCriteria;
import org.teiid.query.sql.lang.SubqueryFromClause;
@@ -347,7 +349,7 @@
beginClause(2);
// Columns clause
- List vars = obj.getVariables();
+ List<ElementSymbol> vars = obj.getVariables();
if (vars != null) {
append("("); //$NON-NLS-1$
registerNodes(vars, 0);
@@ -530,6 +532,10 @@
append(FromClause.MAKEIND);
append(SPACE);
}
+ if (obj.isNoUnnest()) {
+ append(SubqueryHint.NOUNNEST);
+ append(SPACE);
+ }
append(END_HINT);
append(SPACE);
}
@@ -628,10 +634,10 @@
append(MAKENOTDEP);
append(" "); //$NON-NLS-1$
- Iterator iter = groups.iterator();
+ Iterator<String> iter = groups.iterator();
while (iter.hasNext()) {
- outputDisplayName((String)iter.next());
+ outputDisplayName(iter.next());
if (iter.hasNext()) {
append(", ");//$NON-NLS-1$
@@ -645,10 +651,10 @@
append(NOCACHE);
append(" "); //$NON-NLS-1$
- Iterator iter = groups.iterator();
+ Iterator<String> iter = groups.iterator();
while (iter.hasNext()) {
- outputDisplayName((String)iter.next());
+ outputDisplayName(iter.next());
if (iter.hasNext()) {
append(", ");//$NON-NLS-1$
@@ -773,7 +779,9 @@
public void visit( Query obj ) {
addCacheHint(obj.getCacheHint());
addWithClause(obj);
- visitNode(obj.getSelect());
+ if (obj.getSelect() != null) {
+ visitDirect(obj.getSelect(), obj);
+ }
if (obj.getInto() != null) {
beginClause(1);
@@ -860,23 +868,55 @@
}
public void visit( Select obj ) {
+ visitDirect(obj, null);
+ }
+
+ private void visitDirect(Select obj, Query query) {
append(SELECT);
- if (obj.isDistinct()) {
+
+ if (query != null) {
+ SourceHint sh = query.getSourceHint();
+ if (sh != null) {
+ append(SPACE);
+ append(BEGIN_HINT);
+ append("sh"); //$NON-NLS-1$
+ if (sh.getGeneralHint() != null) {
+ appendSourceHintValue(sh.getGeneralHint());
+ }
+ if (sh.getSourceHints() != null) {
+ for (Map.Entry<String, String> entry : sh.getSourceHints().entrySet()) {
+ append(entry.getKey());
+ appendSourceHintValue(entry.getValue());
+ }
+ }
+ append(END_HINT);
+ }
+ }
+
+ if (obj.isDistinct()) {
append(SPACE);
append(DISTINCT);
}
beginClause(2);
- Iterator iter = obj.getSymbols().iterator();
+ Iterator<SelectSymbol> iter = obj.getSymbols().iterator();
while (iter.hasNext()) {
- SelectSymbol symbol = (SelectSymbol)iter.next();
+ SelectSymbol symbol = iter.next();
visitNode(symbol);
if (iter.hasNext()) {
append(", "); //$NON-NLS-1$
}
}
- }
+ }
+ private void appendSourceHintValue(String sh) {
+ append(Tokens.COLON);
+ append('\'');
+ append(escapeStringValue(sh, "'")); //$NON-NLS-1$
+ append('\'');
+ append(SPACE);
+ }
+
public void visit( SetCriteria obj ) {
// variable
visitNode(obj.getExpression());
@@ -946,8 +986,8 @@
protected void appendSetQuery( SetQuery parent,
QueryCommand obj,
boolean right ) {
- if (right && ((obj instanceof SetQuery
- && ((parent.isAll() && !((SetQuery)obj).isAll()) || parent.getOperation() != ((SetQuery)obj).getOperation())) || obj.getLimit() != null || obj.getOrderBy() != null)) {
+ if (obj.getLimit() != null || obj.getOrderBy() != null || (right && ((obj instanceof SetQuery
+ && ((parent.isAll() && !((SetQuery)obj).isAll()) || parent.getOperation() != ((SetQuery)obj).getOperation()))))) {
append(Tokens.LPAREN);
visitNode(obj);
append(Tokens.RPAREN);
@@ -1411,6 +1451,9 @@
}
}
+ /**
+ * @param level
+ */
protected void addTabs( int level ) {
}
@@ -1773,6 +1816,14 @@
}
public void visit( Limit obj ) {
+ if (!obj.isStrict()) {
+ append(BEGIN_HINT);
+ append(SPACE);
+ append(Limit.NON_STRICT);
+ append(SPACE);
+ append(END_HINT);
+ append(SPACE);
+ }
if (obj.getRowLimit() == null) {
append(OFFSET);
append(SPACE);
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/tempdata
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata:3535-3555
/trunk/engine/src/main/java/org/teiid/query/tempdata:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata:3535-3555
/trunk/engine/src/main/java/org/teiid/query/tempdata:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/util
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/util:3535-3555
/trunk/engine/src/main/java/org/teiid/query/util:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/util:3535-3555
/trunk/engine/src/main/java/org/teiid/query/util:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/util/CommandContext.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -32,6 +32,7 @@
import java.util.Random;
import java.util.Set;
import java.util.TimeZone;
+import java.util.concurrent.Executor;
import javax.security.auth.Subject;
@@ -42,6 +43,7 @@
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.util.ArgCheck;
+import org.teiid.core.util.ExecutorUtils;
import org.teiid.dqp.internal.process.DQPWorkContext;
import org.teiid.dqp.internal.process.PreparedPlan;
import org.teiid.dqp.internal.process.SessionAwareCache;
@@ -56,6 +58,7 @@
import org.teiid.query.optimizer.relational.PlanToProcessConverter;
import org.teiid.query.parser.ParseInfo;
import org.teiid.query.processor.QueryProcessor;
+import org.teiid.query.sql.lang.SourceHint;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.util.VariableContext;
@@ -133,6 +136,8 @@
private DQPWorkContext dqpWorkContext;
private TransactionContext transactionContext;
private TransactionService transactionService;
+ private SourceHint sourceHint;
+ private Executor executor = ExecutorUtils.getDirectExecutor();
}
private GlobalState globalState = new GlobalState();
@@ -629,4 +634,20 @@
globalState.transactionService = transactionService;
}
+ public SourceHint getSourceHint() {
+ return this.globalState.sourceHint;
+ }
+
+ public void setSourceHint(SourceHint hint) {
+ this.globalState.sourceHint = hint;
+ }
+
+ public Executor getExecutor() {
+ return this.globalState.executor;
+ }
+
+ public void setExecutor(Executor e) {
+ this.globalState.executor = e;
+ }
+
}
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/validator
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/validator:3535-3555
/trunk/engine/src/main/java/org/teiid/query/validator:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/validator:3535-3555
/trunk/engine/src/main/java/org/teiid/query/validator:3507-3666
Modified: branches/as7/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1385,7 +1385,7 @@
boolean hasOrdinal = false;
for (XMLColumn xc : obj.getColumns()) {
if (!xc.isOrdinal()) {
- if (xc.getDefaultExpression() != null && !EvaluatableVisitor.isFullyEvaluatable(obj, false)) {
+ if (xc.getDefaultExpression() != null && !EvaluatableVisitor.isFullyEvaluatable(xc.getDefaultExpression(), false)) {
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_default", xc.getDefaultExpression()), obj); //$NON-NLS-1$
}
continue;
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/xquery
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/xquery:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/xquery:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/xquery:3535-3555*
/trunk/engine/src/main/java/org/teiid/query/xquery:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/query/xquery/saxon
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/query/xquery/saxon:3535-3555
/trunk/engine/src/main/java/org/teiid/query/xquery/saxon:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/query/xquery/saxon:3535-3555
/trunk/engine/src/main/java/org/teiid/query/xquery/saxon:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/vdb
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/vdb:3535-3555*
/trunk/engine/src/main/java/org/teiid/vdb:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/vdb:3535-3555*
/trunk/engine/src/main/java/org/teiid/vdb:3507-3666
Property changes on: branches/as7/engine/src/main/java/org/teiid/vdb/runtime
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/main/java/org/teiid/vdb/runtime:3535-3555
/trunk/engine/src/main/java/org/teiid/vdb/runtime:3507-3597
+ /branches/7.4.x/engine/src/main/java/org/teiid/vdb/runtime:3535-3555
/trunk/engine/src/main/java/org/teiid/vdb/runtime:3507-3666
Modified: branches/as7/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- branches/as7/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2011-11-17 22:30:19 UTC (rev 3667)
@@ -38,6 +38,11 @@
PARSER_END(SQLParser)
+TOKEN_MGR_DECLS :
+{
+ int commentNestingDepth;
+}
+
SKIP :
{
" " | "\t" | "\n" | "\r"
@@ -45,16 +50,25 @@
MORE :
{
- "/*" : IN_MULTI_LINE_COMMENT
+ "/*" { commentNestingDepth = 1 ; } : IN_MULTI_LINE_COMMENT
}
<IN_MULTI_LINE_COMMENT>
-SPECIAL_TOKEN :
-{
- <MULTI_LINE_COMMENT: "*/" > : DEFAULT
-}
+MORE :
+{
+ "/*" { commentNestingDepth += 1 ; }
+}
<IN_MULTI_LINE_COMMENT>
+SPECIAL_TOKEN :
+{
+ "*/" {
+ commentNestingDepth -= 1;
+ SwitchTo( commentNestingDepth==0 ? DEFAULT : IN_MULTI_LINE_COMMENT ) ;
+ }
+}
+
+<IN_MULTI_LINE_COMMENT>
MORE :
{
< ~[] >
@@ -596,8 +610,18 @@
Command userCommand(ParseInfo info) :
{
Command command = null;
+ SourceHint sourceHint = null;
}
{
+ {int index = 1;
+ Token t = null;
+ do
+ t = getToken(index++);
+ while (t != null && t.kind == LPAREN);
+ t = getToken(index);
+ if (t != null)
+ sourceHint = getSourceHint(t);
+ }
(command = queryExpression(info) |
command = storedProcedure(info, new StoredProcedure()) |
command = insert(info) |
@@ -609,6 +633,13 @@
command = createTrigger(info)
)
{
+ if (sourceHint != null) {
+ if (command instanceof SetQuery) {
+ ((SetQuery)command).getProjectedQuery().setSourceHint(sourceHint);
+ } else {
+ command.setSourceHint(sourceHint);
+ }
+ }
return command;
}
}
@@ -1590,7 +1621,6 @@
String group = null;
SetClauseList setClauseList = null;
Criteria criteria = null;
- ElementSymbol elementID = null;
Option option = null;
}
{
@@ -1650,9 +1680,6 @@
}
}
-/**
- * Currently just a place holder to keep consistency with the spec
- */
QueryCommand queryExpression(ParseInfo info) :
{
QueryCommand query = null;
@@ -3164,8 +3191,10 @@
{
Expression limit = null;
Expression offset = null;
+ Token t = null;
}
{
+ {t = getToken(1);}
((<LIMIT> offset = intParam(info)
[<COMMA> limit = intParam(info)])
{
@@ -3180,7 +3209,9 @@
|
(limit = fetchLimit(info)))
{
- return new Limit(offset, limit);
+ Limit result = new Limit(offset, limit);
+ result.setStrict(!isNonStrictHint(t));
+ return result;
}
}
Modified: branches/as7/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- branches/as7/engine/src/main/resources/org/teiid/query/i18n.properties 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/main/resources/org/teiid/query/i18n.properties 2011-11-17 22:30:19 UTC (rev 3667)
@@ -945,4 +945,6 @@
support_required=Without required support property {0}, pushdown will not be enabled for {1} on translator {2}.
full_state_not_supported=Full state transfer is not supported in the resultset cache distribution
RuleAssignOutputElements.couldnt_push_expression=Expression(s) {0} cannot be pushed to source.
-RuleAssignOutputElements.cannot_introduce_expressions=Cannot introduce new expressions {1} in duplicate removal.
\ No newline at end of file
+RuleAssignOutputElements.cannot_introduce_expressions=Cannot introduce new expressions {1} in duplicate removal.
+
+DependentCriteriaProcessor.dep_join_backoff=Not performing dependent join using source {0}, since the number of distinct rows for expression {1} exceeds {2}. You should ensure that your source statistics, including column distinct value counts, accurately reflect the source or use a MAKE_DEP hint to force the join.
\ No newline at end of file
Property changes on: branches/as7/engine/src/test/java/org/teiid/cache
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/cache:3535-3555*
/trunk/engine/src/test/java/org/teiid/cache:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/cache:3535-3555*
/trunk/engine/src/test/java/org/teiid/cache:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/cache/TestDefaultCache.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/cache/TestDefaultCache.java:3535-3555
/trunk/engine/src/test/java/org/teiid/cache/TestDefaultCache.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/cache/TestDefaultCache.java:3535-3555
/trunk/engine/src/test/java/org/teiid/cache/TestDefaultCache.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/common
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/common:3535-3555*
/trunk/engine/src/test/java/org/teiid/common:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/common:3535-3555*
/trunk/engine/src/test/java/org/teiid/common:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/common/buffer
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/common/buffer:3535-3555
/trunk/engine/src/test/java/org/teiid/common/buffer:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/common/buffer:3535-3555
/trunk/engine/src/test/java/org/teiid/common/buffer:3507-3666
Modified: branches/as7/engine/src/test/java/org/teiid/common/buffer/impl/TestBufferFrontedFileStoreCache.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/common/buffer/impl/TestBufferFrontedFileStoreCache.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/common/buffer/impl/TestBufferFrontedFileStoreCache.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -36,7 +36,7 @@
public class TestBufferFrontedFileStoreCache {
- private final class SimpleSerializer implements Serializer<Integer> {
+ private final static class SimpleSerializer implements Serializer<Integer> {
@Override
public Integer deserialize(ObjectInput ois)
throws IOException, ClassNotFoundException {
@@ -138,7 +138,7 @@
assertEquals(0, cache.getInodesInUse());
}
- private CacheEntry get(BufferFrontedFileStoreCache cache, Long oid,
+ private static CacheEntry get(BufferFrontedFileStoreCache cache, Long oid,
Serializer<Integer> s) throws TeiidComponentException {
PhysicalInfo o = cache.lockForLoad(oid, s);
CacheEntry ce = cache.get(o, oid, new WeakReference<Serializer<?>>(s));
@@ -166,8 +166,8 @@
cache.addToCacheGroup(s.getId(), ce.getId());
cache.add(ce, s);
- assertEquals(3, cache.getDataBlocksInUse());
- assertEquals(1, cache.getInodesInUse());
+ assertTrue(cache.getDataBlocksInUse() < 4);
+ assertTrue(cache.getInodesInUse() < 2);
ce = get(cache, 2l, s);
assertEquals(Integer.valueOf(5000), ce.getObject());
@@ -176,7 +176,7 @@
assertEquals(Integer.valueOf(5001), ce.getObject());
}
- private BufferFrontedFileStoreCache createLayeredCache(int bufferSpace, int objectSize) throws TeiidComponentException {
+ private static BufferFrontedFileStoreCache createLayeredCache(int bufferSpace, int objectSize) throws TeiidComponentException {
BufferFrontedFileStoreCache fsc = new BufferFrontedFileStoreCache();
fsc.setMemoryBufferSpace(bufferSpace);
fsc.setMaxStorageObjectSize(objectSize);
Property changes on: branches/as7/engine/src/test/java/org/teiid/common/queue
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/common/queue:3535-3555
/trunk/engine/src/test/java/org/teiid/common/queue:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/common/queue:3535-3555
/trunk/engine/src/test/java/org/teiid/common/queue:3507-3666
Modified: branches/as7/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -587,6 +587,15 @@
assertEquals(1, this.core.getLongRunningRequests().size());
}
+ @Test public void testDataAvailable() throws Exception {
+ agds.dataNotAvailable = -1;
+ RequestMessage reqMsg = exampleRequestMessage("select * FROM BQT1.SmallA");
+ ResultsMessage results = execute("A", 1, reqMsg);
+ if (results.getException() != null) {
+ throw results.getException();
+ }
+ }
+
public void helpTestVisibilityFails(String sql) throws Exception {
RequestMessage reqMsg = exampleRequestMessage(sql);
reqMsg.setTxnAutoWrapMode(RequestMessage.TXN_WRAP_OFF);
Modified: branches/as7/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -169,4 +169,21 @@
}
}
+ @Test public void testAsynch() throws Exception {
+ this.connectorManager.dataNotAvailable = 10;
+ this.connectorManager.setRows(0);
+ helpSetup(3);
+ boolean blocked = false;
+ while (true) {
+ try {
+ assertNull(info.nextTuple());
+ break;
+ } catch (BlockedException e) {
+ blocked = true;
+ Thread.sleep(50);
+ }
+ }
+ assertTrue(blocked);
+ }
+
}
Modified: branches/as7/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -35,6 +35,7 @@
import org.teiid.dqp.internal.datamgr.ConnectorManager;
import org.teiid.dqp.internal.datamgr.ConnectorWork;
import org.teiid.dqp.internal.datamgr.ConnectorWorkItem;
+import org.teiid.dqp.internal.process.RequestWorkItem;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.AtomicResultsMessage;
import org.teiid.query.optimizer.TestOptimizer;
@@ -55,7 +56,7 @@
private int rows = 10;
private SourceCapabilities caps;
public boolean throwExceptionOnExecute;
- public int dataNotAvailable = -1;
+ public int dataNotAvailable = -2;
public int sleep;
private final AtomicInteger executeCount = new AtomicInteger();
private final AtomicInteger closeCount = new AtomicInteger();
@@ -98,9 +99,31 @@
final AtomicResultsMessage msg = ConnectorWorkItem.createResultsMessage(results);
msg.setFinalRow(rows);
return new ConnectorWork() {
+
+ RequestWorkItem item;
+ boolean returnedInitial;
+
+ @Override
+ public boolean isDataAvailable() {
+ return true;
+ }
+
+ @Override
+ public void setRequestWorkItem(RequestWorkItem item) {
+ this.item = item;
+ }
@Override
public AtomicResultsMessage more() throws TranslatorException {
+ if (dataNotAvailable == -1) {
+ dataNotAvailable = -2;
+ item.moreWork(); //this alone is not sufficient, we have to call the data available method to prevent
+ //timing issues
+ throw DataNotAvailableException.NO_POLLING;
+ }
+ if (returnedInitial) {
+ return msg;
+ }
throw new RuntimeException("Should not be called"); //$NON-NLS-1$
}
@@ -117,9 +140,13 @@
if (throwExceptionOnExecute) {
throw new TranslatorException("Connector Exception"); //$NON-NLS-1$
}
- if (dataNotAvailable > -1) {
+ if (dataNotAvailable > -2) {
int delay = dataNotAvailable;
- dataNotAvailable = -1;
+ if (delay == -1 && !returnedInitial) {
+ returnedInitial = true;
+ return ConnectorWorkItem.createResultsMessage(new List[0]);
+ }
+ dataNotAvailable = -2;
throw new DataNotAvailableException(delay);
}
return msg;
Property changes on: branches/as7/engine/src/test/java/org/teiid/query
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query:3535-3555*
/trunk/engine/src/test/java/org/teiid/query:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query:3535-3555*
/trunk/engine/src/test/java/org/teiid/query:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/analysis
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/analysis:3535-3555
/trunk/engine/src/test/java/org/teiid/query/analysis:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/analysis:3535-3555
/trunk/engine/src/test/java/org/teiid/query/analysis:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/function
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/function:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/function:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/function:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/function:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/function/TestFunction.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestFunction.java:3281-3325,3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestFunction.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestFunction.java:3281-3325,3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestFunction.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/function/TestFunctionMetadataReader.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestFunctionMetadataReader.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestFunctionMetadataReader.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestFunctionMetadataReader.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestFunctionMetadataReader.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/function/TestFunctionMethods.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestFunctionMethods.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestFunctionMethods.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestFunctionMethods.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestFunctionMethods.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/function/TestResolvedFunctions.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestResolvedFunctions.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestResolvedFunctions.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/function/TestResolvedFunctions.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/TestResolvedFunctions.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/function/metadata
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/function/metadata:3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/metadata:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/function/metadata:3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/metadata:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/function/source
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/function/source:3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/source:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/function/source:3535-3555
/trunk/engine/src/test/java/org/teiid/query/function/source:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/mapping
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/mapping:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/mapping:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/mapping:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/mapping:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/mapping/xml
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/mapping/xml:3535-3555
/trunk/engine/src/test/java/org/teiid/query/mapping/xml:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/mapping/xml:3535-3555
/trunk/engine/src/test/java/org/teiid/query/mapping/xml:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/metadata
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/metadata:3535-3555
/trunk/engine/src/test/java/org/teiid/query/metadata:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/metadata:3535-3555
/trunk/engine/src/test/java/org/teiid/query/metadata:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/optimizer:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/optimizer:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/FakeFunctionMetadataSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/FakeFunctionMetadataSource.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/FakeFunctionMetadataSource.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/FakeFunctionMetadataSource.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/FakeFunctionMetadataSource.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/InlineViewCase.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/InlineViewCase.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/InlineViewCase.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/InlineViewCase.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/InlineViewCase.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestAccessPatterns.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestAccessPatterns.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestAccessPatterns.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestAccessPatterns.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestAccessPatterns.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestAggregatePushdown.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestAnsiJoinPushdown.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestAnsiJoinPushdown.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestAnsiJoinPushdown.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestAnsiJoinPushdown.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestAnsiJoinPushdown.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestBatchedUpdatePlanner.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestBatchedUpdatePlanner.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestBatchedUpdatePlanner.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestBatchedUpdatePlanner.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestBatchedUpdatePlanner.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestComparableMetadataPushdown.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestComparableMetadataPushdown.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestComparableMetadataPushdown.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestComparableMetadataPushdown.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestComparableMetadataPushdown.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestDependentJoins.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestDependentJoins.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestDependentJoins.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestDependentJoins.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestDependentJoins.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestExpressionsInGroupBy.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestExpressionsInGroupBy.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestExpressionsInGroupBy.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestExpressionsInGroupBy.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestExpressionsInGroupBy.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestInlineView.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestInlineView.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestInlineView.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestInlineView.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestInlineView.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestJoinOptimization.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestJoinOptimization.java:3149-3217,3535-3555,3558-3585
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinOptimization.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestJoinOptimization.java:3149-3217,3535-3555,3558-3585
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinOptimization.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestJoinWithFunction.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestJoinWithFunction.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinWithFunction.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestJoinWithFunction.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinWithFunction.java:3507-3666
Modified: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestLimit.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestLimit.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestLimit.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -709,7 +709,7 @@
// pm3 model supports order by
capFinder.addCapabilities("pm3", caps); //$NON-NLS-1$
- String sql = "SELECT * FROM (SELECT * FROM pm3.g1 limit 100) as v1 where v1.e1 = 1";//$NON-NLS-1$
+ String sql = "SELECT * FROM (SELECT * FROM pm3.g1 /*+ non_strict */ limit 100) as v1 where v1.e1 = 1";//$NON-NLS-1$
String[] expectedSql = new String[] {
"SELECT pm3.g1.e1, pm3.g1.e2, pm3.g1.e3, pm3.g1.e4 FROM pm3.g1 WHERE pm3.g1.e1 = '1' LIMIT 100" //$NON-NLS-1$
};
@@ -852,7 +852,7 @@
* Note here that the criteria made it to the having clause
*/
@Test public void testAggregateCriteriaOverUnSortedLimit() {
- String sql = "select a from (SELECT MAX(e2) as a FROM pm1.g1 GROUP BY e2 LIMIT 1) x where a = 0"; //$NON-NLS-1$
+ String sql = "select a from (SELECT MAX(e2) as a FROM pm1.g1 GROUP BY e2 /*+ non_strict */ LIMIT 1) x where a = 0"; //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestLimit.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestLimit.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestLimit.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestLimit.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestLimit.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestPartitionedJoinPlanning.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestPartitionedJoinPlanning.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestPartitionedJoinPlanning.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestPartitionedJoinPlanning.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestPartitionedJoinPlanning.java:3188-3450,3452-3666
Modified: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -48,6 +48,24 @@
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
+ @Test public void testNoUnnest() {
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT x FROM /*+ no_unnest */ (SELECT e1, max(e2) as x FROM pm1.g1 GROUP BY e1) AS z", //$NON-NLS-1$
+ RealMetadataFactory.example1Cached(), null, TestAggregatePushdown.getAggregatesFinder(),
+ new String[] {
+ "SELECT v_0.c_0 FROM (SELECT MAX(g_0.e2) AS c_0 FROM pm1.g1 AS g_0 GROUP BY g_0.e1) AS v_0"}, TestOptimizer.SHOULD_SUCCEED); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
+ }
+
+ @Test public void testNoUnnestView() {
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT e1 FROM /*+ no_unnest */ vm1.g1", //$NON-NLS-1$
+ RealMetadataFactory.example1Cached(), null, TestAggregatePushdown.getAggregatesFinder(),
+ new String[] {
+ "SELECT v_0.c_0 FROM (SELECT g_0.e1 AS c_0 FROM pm1.g1 AS g_0) AS v_0"}, TestOptimizer.SHOULD_SUCCEED); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
+ }
+
@Test public void testSimpleMergeGroupBy1() {
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT x FROM (SELECT distinct min(e1), max(e2) as x FROM pm1.g1 GROUP BY e1) AS z", //$NON-NLS-1$
RealMetadataFactory.example1Cached(), null, TestAggregatePushdown.getAggregatesFinder(),
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleRaiseNull.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleRaiseNull.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestRuleRaiseNull.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleRaiseNull.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestRuleRaiseNull.java:3188-3450,3452-3666
Modified: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleRemoveSorts.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleRemoveSorts.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleRemoveSorts.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -22,17 +22,16 @@
package org.teiid.query.optimizer;
+import org.junit.Test;
import org.teiid.query.optimizer.TestOptimizer.ComparisonMode;
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.unittest.RealMetadataFactory;
-import junit.framework.TestCase;
-
-public class TestRuleRemoveSorts extends TestCase {
+public class TestRuleRemoveSorts {
/** Tests an order by in a query transformation */
- public void testRemovedOrderByFromQueryTransform() {
+ @Test public void testRemovedOrderByFromQueryTransform() {
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT e1, e2 FROM vm1.g14", RealMetadataFactory.example1Cached(), //$NON-NLS-1$
new String[] { "SELECT pm3.g1.e1, pm3.g1.e2 FROM pm3.g1"}); //$NON-NLS-1$
@@ -43,7 +42,7 @@
* Tests an order by in a query transformation, where the
* physical model does not support pushing order bys
*/
- public void testRemovedOrderByFromQueryTransform2() {
+ @Test public void testRemovedOrderByFromQueryTransform2() {
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT e, e2 FROM vm1.g8", RealMetadataFactory.example1Cached(), //$NON-NLS-1$
new String[] { "SELECT e1, e2 FROM pm1.g1"}); //$NON-NLS-1$
@@ -69,7 +68,7 @@
* Tests an order by in a query transformation, where the
* query transformation contains a function
*/
- public void testRemovedOrderByFromQueryTransform3() {
+ @Test public void testRemovedOrderByFromQueryTransform3() {
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT e, e2 FROM vm1.g16", RealMetadataFactory.example1Cached(), //$NON-NLS-1$
new String[] { "SELECT e1, e2 FROM pm3.g1"}); //$NON-NLS-1$
@@ -92,7 +91,7 @@
}
/** Tests an order by in a query transformation */
- public void testRemovedOrderByFromQueryTransform4() {
+ @Test public void testRemovedOrderByFromQueryTransform4() {
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT e1, e2 FROM vm1.g13", RealMetadataFactory.example1Cached(), //$NON-NLS-1$
new String[] { "SELECT DISTINCT pm3.g1.e1, pm3.g1.e2, pm3.g1.e3, pm3.g1.e4 FROM pm3.g1"}); //$NON-NLS-1$
@@ -115,7 +114,7 @@
}
/** Order by is not removed */
- public void testOrderByWithLimit() throws Exception {
+ @Test public void testOrderByWithLimit() throws Exception {
ProcessorPlan plan = TestOptimizer.helpPlan("select * from (SELECT e1, e2 FROM pm1.g1 order by e1 limit 10) x", RealMetadataFactory.example1Cached(), //$NON-NLS-1$
new String[] { "SELECT g_0.e1 AS c_0, g_0.e2 AS c_1 FROM pm1.g1 AS g_0 ORDER BY c_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestRuleRemoveSorts.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleRemoveSorts.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestRuleRemoveSorts.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleRemoveSorts.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestRuleRemoveSorts.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestSortOptimization.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestSortOptimization.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestSortOptimization.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestSortOptimization.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestSortOptimization.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestStoredProcedurePlanning.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestStoredProcedurePlanning.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestStoredProcedurePlanning.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestStoredProcedurePlanning.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestStoredProcedurePlanning.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestSubqueryPushdown.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestSubqueryPushdown.java:3149-3217,3281-3325,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestSubqueryPushdown.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestSubqueryPushdown.java:3149-3217,3281-3325,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestSubqueryPushdown.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/TestUnionPlanning.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestUnionPlanning.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestUnionPlanning.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestUnionPlanning.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/TestUnionPlanning.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/capabilities
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/capabilities:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/capabilities:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/capabilities:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/capabilities:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/proc
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/proc:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/proc:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/proc:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/proc:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/TestAliasGenerator.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational/TestAliasGenerator.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestAliasGenerator.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational/TestAliasGenerator.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestAliasGenerator.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/TestRuleStack.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational/TestRuleStack.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestRuleStack.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational/TestRuleStack.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestRuleStack.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/plantree
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational/plantree:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational/plantree:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational/plantree:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational/plantree:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/rules
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational/rules:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational/rules:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/relational/rules:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/relational/rules:3507-3666
Modified: branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/rules/TestRuleAccessPatternValidation.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/rules/TestRuleAccessPatternValidation.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/rules/TestRuleAccessPatternValidation.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -85,7 +85,7 @@
//Generate canonical plan
RelationalPlanner p = new RelationalPlanner();
p.initialize(query, null, METADATA, FINDER, null, new CommandContext());
- PlanNode planNode = p.generatePlan(query);
+ PlanNode planNode = p.generatePlan(query, false);
RelationalPlanner planner = new RelationalPlanner();
final RuleStack rules = planner.buildRules();
Modified: branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/rules/TestRulePushSelectCriteria.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/rules/TestRulePushSelectCriteria.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/optimizer/relational/rules/TestRulePushSelectCriteria.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -73,8 +73,8 @@
RelationalPlanner p = new RelationalPlanner();
CommandContext cc = new CommandContext();
p.initialize(command, null, metadata, null, null, cc);
- PlanNode root = p.generatePlan(command);
- PlanNode child = p.generatePlan(subCommand);
+ PlanNode root = p.generatePlan(command, false);
+ PlanNode child = p.generatePlan(subCommand, false);
PlanNode sourceNode = NodeEditor.findNodePreOrder(root, NodeConstants.Types.SOURCE);
sourceNode.addFirstChild(child);
sourceNode.setProperty(NodeConstants.Info.SYMBOL_MAP, SymbolMap.createSymbolMap(sourceNode.getGroups().iterator().next(), (List<SingleElementSymbol>)child.getFirstChild().getProperty(Info.PROJECT_COLS), metadata));
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/optimizer/xml
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/xml:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/xml:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/xml:3535-3555
/trunk/engine/src/test/java/org/teiid/query/optimizer/xml:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/parser
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/parser:3535-3555
/trunk/engine/src/test/java/org/teiid/query/parser:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/parser:3535-3555
/trunk/engine/src/test/java/org/teiid/query/parser:3507-3666
Modified: branches/as7/engine/src/test/java/org/teiid/query/parser/TestOptionsAndHints.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/parser/TestOptionsAndHints.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/parser/TestOptionsAndHints.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -29,6 +29,7 @@
import java.util.List;
import org.junit.Test;
+import org.teiid.api.exception.query.QueryParserException;
import org.teiid.query.sql.lang.AbstractCompareCriteria;
import org.teiid.query.sql.lang.CacheHint;
import org.teiid.query.sql.lang.CompareCriteria;
@@ -57,12 +58,12 @@
import org.teiid.query.sql.proc.HasCriteria;
import org.teiid.query.sql.proc.IfStatement;
import org.teiid.query.sql.proc.Statement;
-import org.teiid.query.sql.symbol.MultipleElementSymbol;
import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.symbol.MultipleElementSymbol;
import org.teiid.query.sql.symbol.Reference;
@SuppressWarnings("nls")
@@ -424,6 +425,7 @@
option.setNoCache(true);
Criteria crit = new CompareCriteria(new ElementSymbol("b"), CompareCriteria.EQ, new Reference(1)); //$NON-NLS-1$
update.setCriteria(crit);
+ update.setOption(option);
TestParser.helpTest("UPDATE m.g SET a = ? WHERE b = ? OPTION NOCACHE", //$NON-NLS-1$
"UPDATE m.g SET a = ? WHERE b = ? OPTION NOCACHE", //$NON-NLS-1$
update);
@@ -1156,4 +1158,33 @@
TestParser.helpTest(sql, "SELECT a FROM db.g WHERE b IN /*+ MJ */ (SELECT a FROM db.g WHERE a2 = 5)", q); //$NON-NLS-1$
}
+ @Test public void testNoUnnest() throws QueryParserException {
+ String sql = "SELECT a FROM /*+ no_unnest */ (SELECT a FROM db.g WHERE a2 = 5) x"; //$NON-NLS-1$
+ assertEquals("SELECT a FROM /*+ NO_UNNEST */ (SELECT a FROM db.g WHERE a2 = 5) AS x", QueryParser.getQueryParser().parseCommand(sql, new ParseInfo()).toString()); //$NON-NLS-1$
+ }
+
+ @Test public void testNonStrictLimit() throws QueryParserException {
+ String sql = "SELECT a FROM x /*+ non_strict */ limit 1"; //$NON-NLS-1$
+ assertEquals("SELECT a FROM x /*+ NON_STRICT */ LIMIT 1", QueryParser.getQueryParser().parseCommand(sql, new ParseInfo()).toString()); //$NON-NLS-1$
+
+ sql = "SELECT a FROM x /*+ non_strict */ offset 1 row"; //$NON-NLS-1$
+ assertEquals("SELECT a FROM x /*+ NON_STRICT */ OFFSET 1 ROWS", QueryParser.getQueryParser().parseCommand(sql, new ParseInfo()).toString()); //$NON-NLS-1$
+
+ sql = "SELECT a FROM x /*+ non_strict */ fetch first 1 rows only"; //$NON-NLS-1$
+ assertEquals("SELECT a FROM x /*+ NON_STRICT */ LIMIT 1", QueryParser.getQueryParser().parseCommand(sql, new ParseInfo()).toString()); //$NON-NLS-1$
+ }
+
+ @Test public void testNestedComments() throws QueryParserException {
+ String sql = "/*+ /*nested*/ */ SELECT a FROM x limit 1"; //$NON-NLS-1$
+ assertEquals("SELECT a FROM x LIMIT 1", QueryParser.getQueryParser().parseCommand(sql, new ParseInfo()).toString()); //$NON-NLS-1$
+ }
+
+ @Test public void testSourceHint() throws QueryParserException {
+ String sql = "SELECT /*+ sh:'foo' oracle:'leading' */ a FROM x limit 1"; //$NON-NLS-1$
+ assertEquals("SELECT /*+sh:'foo' oracle:'leading' */ a FROM x LIMIT 1", QueryParser.getQueryParser().parseCommand(sql, new ParseInfo()).toString()); //$NON-NLS-1$
+
+ sql = "(SELECT /*+ sh:'foo' oracle:'leading' */ a FROM x limit 1) union all select 1"; //$NON-NLS-1$
+ assertEquals("(SELECT /*+sh:'foo' oracle:'leading' */ a FROM x LIMIT 1) UNION ALL SELECT 1", QueryParser.getQueryParser().parseCommand(sql, new ParseInfo()).toString());
+ }
+
}
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/processor:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/processor:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/FakeDataStore.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/FakeDataStore.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/FakeDataStore.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/FakeDataStore.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/FakeDataStore.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/FakeTupleSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/FakeTupleSource.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/FakeTupleSource.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/FakeTupleSource.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/FakeTupleSource.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestAggregateProcessing.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestArrayTable.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestArrayTable.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestArrayTable.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestArrayTable.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestArrayTable.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestBaseProcessorPlan.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestBaseProcessorPlan.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestBaseProcessorPlan.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestBaseProcessorPlan.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestBaseProcessorPlan.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestBatchIterator.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestBatchIterator.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestBatchIterator.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestBatchIterator.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestBatchIterator.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestBatchedUpdatePlan.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestBatchedUpdatePlan.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestBatchedUpdatePlan.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestBatchedUpdatePlan.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestBatchedUpdatePlan.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestCollectionTupleSource.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestCollectionTupleSource.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestCollectionTupleSource.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestCollectionTupleSource.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestCollectionTupleSource.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestDependentJoins.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestDependentJoins.java:3149-3217,3535-3555,3558-3585
/trunk/engine/src/test/java/org/teiid/query/processor/TestDependentJoins.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestDependentJoins.java:3149-3217,3535-3555,3558-3585
/trunk/engine/src/test/java/org/teiid/query/processor/TestDependentJoins.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestFunctionPushdown.java
___________________________________________________________________
Deleted: svn:mergeinfo
- /trunk/engine/src/test/java/org/teiid/query/processor/TestFunctionPushdown.java:3507-3597
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestInherintlyUpdatableViews.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestInherintlyUpdatableViews.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestInherintlyUpdatableViews.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestInherintlyUpdatableViews.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestInherintlyUpdatableViews.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestInsertProcessing.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestInsertProcessing.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestInsertProcessing.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestInsertProcessing.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestInsertProcessing.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestJoinWithFunction.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestJoinWithFunction.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestJoinWithFunction.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestJoinWithFunction.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestJoinWithFunction.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestMaterialization.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestMaterialization.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestMaterialization.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestMaterialization.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestMaterialization.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestOptionalJoins.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestOptionalJoins.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestOptionalJoins.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestOptionalJoins.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestOptionalJoins.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestOrderByProcessing.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestOrderByProcessing.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestOrderByProcessing.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestOrderByProcessing.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestOrderByProcessing.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java:3188-3450,3452-3666
Modified: branches/as7/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2273,7 +2273,28 @@
// Run query
helpProcess(plan, dataManager, expected);
+ }
+
+ @Test public void testCorrelatedSubqueryCaching() throws Exception {
+ String sql = "Select e1 from pm1.g1 where e2 in (select e2 FROM pm2.g1 WHERE pm1.g1.e3 = pm2.g1.e3)"; //$NON-NLS-1$
+ // Create expected results
+ List[] expected = new List[] {
+ Arrays.asList("a"), Arrays.asList((String)null), Arrays.asList("a"), Arrays.asList("c"), Arrays.asList("b"), Arrays.asList("a") //$NON-NLS-1$
+ };
+
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ sampleData1(dataManager);
+
+ // Plan query
+ ProcessorPlan plan = helpGetPlan(sql, RealMetadataFactory.example1Cached());
+
+ // Run query
+ doProcess(plan, dataManager, expected, createCommandContext());
+
+ //three queries - 1 for the outer and 1 each for true/false
+ assertEquals(3, dataManager.getQueries().size());
}
/**
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java:3149-3217,3220-3275,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestProcessor.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestQueryProcessor.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestQueryProcessor.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestQueryProcessor.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestQueryProcessor.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestQueryProcessor.java:3507-3666
Modified: branches/as7/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -193,6 +193,21 @@
process(sql, expected);
}
+ @Test public void testXmlTablePassingSubquery() throws Exception {
+ String sql = "select * from xmltable('/a/b' passing (SELECT xmlelement(name a, xmlAgg(xmlelement(name b, e1))) from pm1.g1) columns val string path '/.') as x"; //$NON-NLS-1$
+
+ List<?>[] expected = new List<?>[] {
+ Arrays.asList("a"),
+ Arrays.asList(""),
+ Arrays.asList("a"),
+ Arrays.asList("c"),
+ Arrays.asList("b"),
+ Arrays.asList("a")
+ };
+
+ process(sql, expected);
+ }
+
@Test public void testXmlTableInView() throws Exception {
String sql = "select * from g1"; //$NON-NLS-1$
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java:3149-3217,3220-3275,3281-3325,3340-3349,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java:3149-3217,3220-3275,3281-3325,3340-3349,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestSQLXMLProcessing.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestSecurityFunctions.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSecurityFunctions.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestSecurityFunctions.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSecurityFunctions.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestSecurityFunctions.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestSetProcessing.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSetProcessing.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestSetProcessing.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestSetProcessing.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestSetProcessing.java:3188-3450,3452-3666
Copied: branches/as7/engine/src/test/java/org/teiid/query/processor/TestSourceHints.java (from rev 3666, trunk/engine/src/test/java/org/teiid/query/processor/TestSourceHints.java)
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/processor/TestSourceHints.java (rev 0)
+++ branches/as7/engine/src/test/java/org/teiid/query/processor/TestSourceHints.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.query.processor;
+
+import static org.junit.Assert.*;
+import static org.teiid.query.processor.TestProcessor.*;
+
+import java.util.List;
+
+import org.junit.Test;
+import org.teiid.common.buffer.TupleSource;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.metadata.MetadataStore;
+import org.teiid.metadata.Schema;
+import org.teiid.metadata.Table;
+import org.teiid.query.mapping.relational.QueryNode;
+import org.teiid.query.metadata.TransformationMetadata;
+import org.teiid.query.sql.lang.Command;
+import org.teiid.query.unittest.RealMetadataFactory;
+import org.teiid.query.util.CommandContext;
+
+@SuppressWarnings("nls")
+public class TestSourceHints {
+
+ @Test public void testUserQueryHint() {
+ String sql = "SELECT /*+ sh:'foo' bar:'leading' */ e1 from pm1.g1 order by e1 limit 1"; //$NON-NLS-1$
+
+ ProcessorPlan plan = helpGetPlan(sql, RealMetadataFactory.example1Cached());
+
+ List<?>[] expected = new List[] {};
+ helpProcess(plan, manager("foo", "leading"), expected);
+ }
+
+ @Test public void testHintInView() {
+ MetadataStore metadataStore = new MetadataStore();
+ Schema p1 = RealMetadataFactory.createPhysicalModel("p1", metadataStore); //$NON-NLS-1$
+ Table t1 = RealMetadataFactory.createPhysicalGroup("t", p1); //$NON-NLS-1$
+ RealMetadataFactory.createElements(t1, new String[] {"a", "b" }, new String[] { "string", "string" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ Schema v1 = RealMetadataFactory.createVirtualModel("v1", metadataStore); //$NON-NLS-1$
+ QueryNode n1 = new QueryNode("SELECT /*+ sh:'x' */ a as c, b FROM p1.t"); //$NON-NLS-1$ //$NON-NLS-2$
+ Table vt1 = RealMetadataFactory.createVirtualGroup("t1", v1, n1); //$NON-NLS-1$
+ RealMetadataFactory.createElements(vt1, new String[] {"c", "b" }, new String[] { "string", "string" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ TransformationMetadata metadata = RealMetadataFactory.createTransformationMetadata(metadataStore, "metadata");
+
+ //top level applies
+ HardcodedDataManager manager = manager("foo", "leading");
+
+ String sql = "SELECT /*+ sh:'foo' bar:'leading' */ c from t1 order by c limit 1"; //$NON-NLS-1$
+ ProcessorPlan plan = helpGetPlan(sql, metadata);
+
+ List<?>[] expected = new List[] {};
+ helpProcess(plan, manager, expected);
+
+ //use the underlying hint
+ manager = manager("x", null);
+ sql = "SELECT c from t1 order by c limit 1"; //$NON-NLS-1$
+ plan = helpGetPlan(sql, metadata);
+ helpProcess(plan, manager, expected);
+
+ //use no hints
+ manager = manager(null, null);
+ sql = "SELECT c from t1 union all select c from t1"; //$NON-NLS-1$
+ plan = helpGetPlan(sql, metadata);
+ helpProcess(plan, manager, expected);
+ }
+
+ private HardcodedDataManager manager(final String general, final String hint) {
+ HardcodedDataManager manager = new HardcodedDataManager() {
+ @Override
+ public TupleSource registerRequest(CommandContext context,
+ Command command, String modelName,
+ String connectorBindingId, int nodeID, int limit)
+ throws TeiidComponentException {
+ if (general == null && hint == null) {
+ assertNull(context.getSourceHint());
+ } else {
+ assertEquals(general, context.getSourceHint().getGeneralHint()); //$NON-NLS-1$
+ assertEquals(hint, context.getSourceHint().getSourceHint("bar")); //$NON-NLS-1$
+ }
+ return CollectionTupleSource.createNullTupleSource();
+ }
+ };
+ return manager;
+ }
+
+}
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestSourceHints.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+ /trunk/engine/src/test/java/org/teiid/query/processor/TestSourceHints.java:3598-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestTempTables.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestTempTables.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestTempTables.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestTempTables.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestTempTables.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestTextTable.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestTextTable.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestTextTable.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestTextTable.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestTextTable.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestTriggerActions.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestTriggerActions.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestTriggerActions.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestTriggerActions.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestTriggerActions.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestWindowFunctions.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestWindowFunctions.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestWindowFunctions.java:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestWindowFunctions.java:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestWindowFunctions.java:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/TestWithClauseProcessing.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestWithClauseProcessing.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestWithClauseProcessing.java:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/TestWithClauseProcessing.java:3149-3217,3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/TestWithClauseProcessing.java:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/eval
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/eval:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/eval:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/eval:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/eval:3507-3666
Modified: branches/as7/engine/src/test/java/org/teiid/query/processor/eval/TestCriteriaEvaluator.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/processor/eval/TestCriteriaEvaluator.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/processor/eval/TestCriteriaEvaluator.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -156,10 +156,6 @@
helpTestMatch("xx", "%", MatchCriteria.NULL_ESCAPE_CHAR, true); //$NON-NLS-1$ //$NON-NLS-2$
}
- @Test public void testMatch6() throws Exception {
- helpTestMatch("xx", "%", MatchCriteria.NULL_ESCAPE_CHAR, true); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
@Test public void testMatch7() throws Exception {
helpTestMatch("a", "a%", MatchCriteria.NULL_ESCAPE_CHAR, true); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -172,10 +168,6 @@
helpTestMatch("a.", "a%", MatchCriteria.NULL_ESCAPE_CHAR, true); //$NON-NLS-1$ //$NON-NLS-2$
}
- @Test public void testMatch10() throws Exception {
- helpTestMatch("a.", "a%", MatchCriteria.NULL_ESCAPE_CHAR, true); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
@Test public void testMatch11() throws Exception {
helpTestMatch("ax.", "a%", MatchCriteria.NULL_ESCAPE_CHAR, true); //$NON-NLS-1$ //$NON-NLS-2$
}
Modified: branches/as7/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -42,12 +42,14 @@
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.function.FunctionDescriptor;
+import org.teiid.query.parser.QueryParser;
import org.teiid.query.processor.FakeDataManager;
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.resolver.TestFunctionResolving;
import org.teiid.query.sql.lang.CollectionValueIterator;
import org.teiid.query.sql.lang.IsNullCriteria;
import org.teiid.query.sql.lang.Query;
+import org.teiid.query.sql.lang.QueryCommand;
import org.teiid.query.sql.lang.SubqueryContainer;
import org.teiid.query.sql.symbol.CaseExpression;
import org.teiid.query.sql.symbol.Constant;
@@ -294,7 +296,7 @@
}
@Test public void testScalarSubqueryFails() throws Exception{
- ScalarSubquery expr = new ScalarSubquery(new Query());
+ ScalarSubquery expr = new ScalarSubquery((QueryCommand) QueryParser.getQueryParser().parseCommand("select x from y"));
ArrayList values = new ArrayList(2);
values.add("a"); //$NON-NLS-1$
values.add("b"); //$NON-NLS-1$
@@ -303,7 +305,7 @@
helpTestWithValueIterator(expr, values, null);
fail("Expected ExpressionEvaluationException but got none"); //$NON-NLS-1$
} catch (ExpressionEvaluationException e) {
- assertEquals("Error Code:ERR.015.006.0058 Message:Unable to evaluate (<undefined>): Error Code:ERR.015.006.0058 Message:The command of this scalar subquery returned more than one value: <undefined>", e.getMessage()); //$NON-NLS-1$
+ assertEquals("Error Code:ERR.015.006.0058 Message:Unable to evaluate (SELECT x FROM y): Error Code:ERR.015.006.0058 Message:The command of this scalar subquery returned more than one value: SELECT x FROM y", e.getMessage()); //$NON-NLS-1$
}
}
@@ -502,6 +504,11 @@
assertEquals(Boolean.FALSE, Evaluator.evaluate(ex));
}
+ @Test public void testLikeRegex4() throws Exception {
+ Expression ex = TestFunctionResolving.getExpression("'xay' like_regex 'a'");
+ assertEquals(Boolean.TRUE, Evaluator.evaluate(ex));
+ }
+
@Test public void testLikePlus() throws Exception {
Expression ex = TestFunctionResolving.getExpression("'+' like '+'");
assertEquals(Boolean.TRUE, Evaluator.evaluate(ex));
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/proc
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/proc:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/proc:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/proc:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/proc:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/relational
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/relational:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/relational:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/relational:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/processor/xml
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/xml:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/xml:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/processor/xml:3535-3555
/trunk/engine/src/test/java/org/teiid/query/processor/xml:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/resolver
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/resolver:3535-3555
/trunk/engine/src/test/java/org/teiid/query/resolver:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/resolver:3535-3555
/trunk/engine/src/test/java/org/teiid/query/resolver:3507-3666
Modified: branches/as7/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -94,6 +94,8 @@
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.SingleElementSymbol;
+import org.teiid.query.sql.symbol.XMLQuery;
+import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.CommandCollectorVisitor;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.sql.visitor.FunctionCollectorVisitor;
@@ -2986,5 +2988,15 @@
@Test public void testTrim1() {
helpResolve("select trim('x' from e1) from pm1.g1");
}
+
+ @Test public void testXmlTableWithParam() {
+ helpResolve("select * from xmltable('/a' passing ?) as x");
+ }
+
+ @Test public void testXmlQueryWithParam() {
+ Query q = (Query)helpResolve("select xmlquery('/a' passing ?)");
+ XMLQuery ex = (XMLQuery) SymbolMap.getExpression((Expression) q.getSelect().getSymbols().get(0));
+ assertEquals(DataTypeManager.DefaultDataClasses.XML, ex.getPassing().get(0).getExpression().getType());
+ }
}
\ No newline at end of file
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/rewriter
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/rewriter:3535-3555
/trunk/engine/src/test/java/org/teiid/query/rewriter:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/rewriter:3535-3555
/trunk/engine/src/test/java/org/teiid/query/rewriter:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/sql
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/sql:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/sql:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/sql:3535-3555*
/trunk/engine/src/test/java/org/teiid/query/sql:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/sql/lang
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/sql/lang:3535-3555
/trunk/engine/src/test/java/org/teiid/query/sql/lang:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/sql/lang:3535-3555
/trunk/engine/src/test/java/org/teiid/query/sql/lang:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/sql/proc
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/sql/proc:3535-3555
/trunk/engine/src/test/java/org/teiid/query/sql/proc:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/sql/proc:3535-3555
/trunk/engine/src/test/java/org/teiid/query/sql/proc:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/sql/symbol
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/sql/symbol:3535-3555
/trunk/engine/src/test/java/org/teiid/query/sql/symbol:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/sql/symbol:3535-3555
/trunk/engine/src/test/java/org/teiid/query/sql/symbol:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/sql/util
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/sql/util:3535-3555
/trunk/engine/src/test/java/org/teiid/query/sql/util:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/sql/util:3535-3555
/trunk/engine/src/test/java/org/teiid/query/sql/util:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/sql/visitor
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/sql/visitor:3535-3555
/trunk/engine/src/test/java/org/teiid/query/sql/visitor:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/sql/visitor:3535-3555
/trunk/engine/src/test/java/org/teiid/query/sql/visitor:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/unittest
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/unittest:3535-3555
/trunk/engine/src/test/java/org/teiid/query/unittest:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/unittest:3535-3555
/trunk/engine/src/test/java/org/teiid/query/unittest:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/util
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/util:3535-3555
/trunk/engine/src/test/java/org/teiid/query/util:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/util:3535-3555
/trunk/engine/src/test/java/org/teiid/query/util:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/query/validator
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/query/validator:3535-3555
/trunk/engine/src/test/java/org/teiid/query/validator:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/query/validator:3535-3555
/trunk/engine/src/test/java/org/teiid/query/validator:3507-3666
Modified: branches/as7/engine/src/test/java/org/teiid/query/validator/TestValidator.java
===================================================================
--- branches/as7/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -1791,6 +1791,10 @@
@Test public void testXMLTablePassingMultipleContext() {
helpValidate("select * from pm1.g1, xmltable('/' passing xmlparse(DOCUMENT '<a/>'), xmlparse(DOCUMENT '<b/>')) as x", new String[] {"XMLTABLE('/' PASSING XMLPARSE(DOCUMENT '<a/>'), XMLPARSE(DOCUMENT '<b/>')) AS x"}, RealMetadataFactory.example1Cached());
}
+
+ @Test public void testInvalidDefault() {
+ helpValidate("select * from pm1.g1, xmltable('/' passing xmlparse(DOCUMENT '<a/>') columns y string default 'a', x string default (select e1 from pm1.g1)) as x", new String[] {"XMLTABLE('/' PASSING XMLPARSE(DOCUMENT '<a/>') COLUMNS y string DEFAULT 'a', x string DEFAULT (SELECT e1 FROM pm1.g1)) AS x"}, RealMetadataFactory.example1Cached());
+ }
@Ignore("this is actually handled by saxon and will show up during resolving")
@Test public void testXMLTablePassingSameName() {
Property changes on: branches/as7/engine/src/test/java/org/teiid/vdb
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/vdb:3535-3555*
/trunk/engine/src/test/java/org/teiid/vdb:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/vdb:3535-3555*
/trunk/engine/src/test/java/org/teiid/vdb:3507-3666
Property changes on: branches/as7/engine/src/test/java/org/teiid/vdb/runtime
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/java/org/teiid/vdb/runtime:3535-3555
/trunk/engine/src/test/java/org/teiid/vdb/runtime:3507-3597
+ /branches/7.4.x/engine/src/test/java/org/teiid/vdb/runtime:3535-3555
/trunk/engine/src/test/java/org/teiid/vdb/runtime:3507-3666
Property changes on: branches/as7/engine/src/test/resources/text
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/resources/text:3535-3555*
/trunk/engine/src/test/resources/text:3507-3597
+ /branches/7.4.x/engine/src/test/resources/text:3535-3555*
/trunk/engine/src/test/resources/text:3507-3666
Property changes on: branches/as7/engine/src/test/resources/text/TextParts_HeaderRow2.csv
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/resources/text/TextParts_HeaderRow2.csv:3535-3555
/trunk/engine/src/test/resources/text/TextParts_HeaderRow2.csv:3507-3597
+ /branches/7.4.x/engine/src/test/resources/text/TextParts_HeaderRow2.csv:3535-3555
/trunk/engine/src/test/resources/text/TextParts_HeaderRow2.csv:3507-3666
Property changes on: branches/as7/engine/src/test/resources/text/cdm_dos.txt
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/resources/text/cdm_dos.txt:3535-3555
/trunk/engine/src/test/resources/text/cdm_dos.txt:3507-3597
+ /branches/7.4.x/engine/src/test/resources/text/cdm_dos.txt:3535-3555
/trunk/engine/src/test/resources/text/cdm_dos.txt:3507-3666
Property changes on: branches/as7/engine/src/test/resources/text/cdm_dos_win.txt
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/resources/text/cdm_dos_win.txt:3149-3164,3172-3217,3535-3555
/trunk/engine/src/test/resources/text/cdm_dos_win.txt:3188-3450,3452-3597
+ /branches/7.4.x/engine/src/test/resources/text/cdm_dos_win.txt:3149-3164,3172-3217,3535-3555
/trunk/engine/src/test/resources/text/cdm_dos_win.txt:3188-3450,3452-3666
Property changes on: branches/as7/engine/src/test/resources/text/test-file.txt.csv
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/engine/src/test/resources/text/test-file.txt.csv:3535-3555
/trunk/engine/src/test/resources/text/test-file.txt.csv:3507-3597
+ /branches/7.4.x/engine/src/test/resources/text/test-file.txt.csv:3535-3555
/trunk/engine/src/test/resources/text/test-file.txt.csv:3507-3666
Modified: branches/as7/hibernate-dialect/pom.xml
===================================================================
--- branches/as7/hibernate-dialect/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/hibernate-dialect/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
Modified: branches/as7/jboss-integration/pom.xml
===================================================================
--- branches/as7/jboss-integration/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/jboss-integration/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/AssosiateCallerIdentityLoginModule.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/AssosiateCallerIdentityLoginModule.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/AssosiateCallerIdentityLoginModule.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -33,6 +33,8 @@
import org.jboss.security.SecurityContext;
import org.jboss.security.SubjectInfo;
import org.jboss.security.auth.spi.AbstractServerLoginModule;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
/**
* This login modules simply takes the subject in the current context and adds
@@ -69,6 +71,8 @@
return true;
}
+ LogManager.logDetail(LogConstants.CTX_SECURITY, "Adding Passthrough principal="+principal.getName()); //$NON-NLS-1$
+
// Put the principal name into the sharedState map
sharedState.put("javax.security.auth.login.name", principal.getName()); //$NON-NLS-1$
sharedState.put("javax.security.auth.login.password", ""); //$NON-NLS-1$ //$NON-NLS-2$
Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Transport.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Transport.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Transport.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -54,7 +54,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
-import org.teiid.net.TeiidURL.CONNECTION.AuthenticationType;
+import org.teiid.net.socket.AuthenticationType;
import org.teiid.security.SecurityHelper;
import org.teiid.services.BufferServiceImpl;
import org.teiid.services.SessionServiceImpl;
@@ -116,7 +116,7 @@
this.sessionService.setVDBRepository(getVdbRepository());
this.sessionService.setSecurityHelper(this.csr.getSecurityHelper());
this.sessionService.setAuthenticationType(getAuthenticationType());
- this.sessionService.setKrb5SecurityDomain(this.krb5Domain);
+ this.sessionService.setGssSecurityDomain(this.krb5Domain);
this.sessionService.start();
// create the necessary services
Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -58,7 +58,7 @@
import org.teiid.dqp.internal.process.DQPCore;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.net.TeiidURL.CONNECTION.AuthenticationType;
+import org.teiid.net.socket.AuthenticationType;
import org.teiid.services.BufferServiceImpl;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.LocalServerConnection;
@@ -167,7 +167,7 @@
transport.setSessionExpirationTimeLimit(Element.AUTHENTICATION_SESSION_EXPIRATION_TIME_LIMIT_ATTRIBUTE.asLong(operation));
}
if (Element.AUTHENTICATION_KRB5_DOMAIN_ATTRIBUTE.isDefined(operation)) {
- transport.setAuthenticationType(AuthenticationType.KRB5);
+ transport.setAuthenticationType(AuthenticationType.GSS);
transport.setKrb5Domain(Element.AUTHENTICATION_KRB5_DOMAIN_ATTRIBUTE.asString(operation));
}
else {
Modified: branches/as7/metadata/pom.xml
===================================================================
--- branches/as7/metadata/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/metadata/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: branches/as7/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
===================================================================
--- branches/as7/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -30,12 +30,9 @@
import org.jboss.vfs.VirtualFileFilter;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
-import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.core.TeiidException;
import org.teiid.core.TeiidRuntimeException;
-import org.teiid.core.id.UUID;
import org.teiid.core.index.IEntryResult;
-import org.teiid.core.util.ArgCheck;
import org.teiid.core.util.StringUtil;
import org.teiid.internal.core.index.Index;
import org.teiid.metadata.*;
@@ -49,12 +46,90 @@
public class IndexMetadataFactory {
private Index[] indexes;
- private RecordFactory recordFactory = new RecordFactory();
+ private RecordFactory recordFactory = new RecordFactory() {
+
+ protected AbstractMetadataRecord getMetadataRecord(char[] record) {
+ if (record == null || record.length == 0) {
+ return null;
+ }
+ char c = record[0];
+ switch (c) {
+ case MetadataConstants.RECORD_TYPE.ANNOTATION: {
+ final List<String> tokens = RecordFactory.getStrings(record, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+
+ // Extract the index version information from the record
+ int indexVersion = recordFactory.getIndexVersion(record);
+ String uuid = tokens.get(2);
+
+ // The tokens are the standard header values
+ int tokenIndex = 6;
+
+ if(recordFactory.includeAnnotationProperties(indexVersion)) {
+ // The next token are the properties, ignore it not going to be read any way
+ tokenIndex++;
+ }
+
+ // The next token is the description
+ annotationCache.put(uuid, tokens.get(tokenIndex++));
+ return null;
+ }
+ case MetadataConstants.RECORD_TYPE.PROPERTY: {
+ final List<String> tokens = RecordFactory.getStrings(record, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+
+ String uuid = tokens.get(1);
+ LinkedHashMap<String, String> result = extensionCache.get(uuid);
+ if (result == null) {
+ result = new LinkedHashMap<String, String>();
+ extensionCache.put(uuid, result);
+ }
+ // The tokens are the standard header values
+ int tokenIndex = 2;
+ result.put( tokens.get(tokenIndex++), tokens.get(tokenIndex++));
+ return null;
+ }
+ default:
+ AbstractMetadataRecord abstractMetadataRecord = super.getMetadataRecord(record);
+ if (abstractMetadataRecord == null) {
+ return null; //record type no longer used
+ }
+ String parentName = null;
+ if (record[0] == MetadataConstants.RECORD_TYPE.TABLE) {
+ parentName = ((Table)abstractMetadataRecord).getParent().getName();
+ } else if (record[0] == MetadataConstants.RECORD_TYPE.CALLABLE) {
+ parentName = ((Procedure)abstractMetadataRecord).getParent().getName();
+ }
+ if (parentName != null) {
+ Map<Character, List<AbstractMetadataRecord>> map = schemaEntries.get(parentName);
+ if (map == null) {
+ map = new HashMap<Character, List<AbstractMetadataRecord>>();
+ schemaEntries.put(parentName, map);
+ }
+ List<AbstractMetadataRecord> typeRecords = map.get(record[0]);
+ if (typeRecords == null) {
+ typeRecords = new ArrayList<AbstractMetadataRecord>();
+ map.put(record[0], typeRecords);
+ }
+ typeRecords.add(abstractMetadataRecord);
+ }
+ Map<String, AbstractMetadataRecord> uuidMap = getByType(record[0]);
+ uuidMap.put(abstractMetadataRecord.getUUID(), abstractMetadataRecord);
+ if (parentId != null) {
+ List<AbstractMetadataRecord> typeChildren = getByParent(parentId, record[0], AbstractMetadataRecord.class, true);
+ typeChildren.add(abstractMetadataRecord);
+ }
+ return abstractMetadataRecord;
+ }
+ }
+
+ };
private Map<String, String> annotationCache = new HashMap<String, String>();
private Map<String, LinkedHashMap<String, String>> extensionCache = new HashMap<String, LinkedHashMap<String,String>>();
- private Map<String, Datatype> datatypeCache;
- private Map<String, KeyRecord> primaryKeyCache = new HashMap<String, KeyRecord>();
- private Map<String, Table> tableCache = new HashMap<String, Table>();
+ //map of schema name to record entries
+ private Map<String, Map<Character, List<AbstractMetadataRecord>>> schemaEntries = new HashMap<String, Map<Character, List<AbstractMetadataRecord>>>();
+ //map of parent uuid to record entries
+ private Map<String, Map<Character, List<AbstractMetadataRecord>>> childRecords = new HashMap<String, Map<Character, List<AbstractMetadataRecord>>>();
+ //map of type to maps of uuids
+ private Map<Character, LinkedHashMap<String, AbstractMetadataRecord>> allRecords = new HashMap<Character, LinkedHashMap<String, AbstractMetadataRecord>>();
private MetadataStore store;
private HashSet<VirtualFile> indexFiles = new HashSet<VirtualFile>();
private LinkedHashMap<String, Resource> vdbEntries;
@@ -83,7 +158,53 @@
//just use the defaults for model visibility
addEntriesPlusVisibilities(vdb, new VDBMetaData());
}
-
+
+ Map<String, AbstractMetadataRecord> getByType(char type) {
+ LinkedHashMap<String, AbstractMetadataRecord> uuidMap = allRecords.get(type);
+ if (uuidMap == null) {
+ uuidMap = new LinkedHashMap<String, AbstractMetadataRecord>();
+ allRecords.put(type, uuidMap);
+ }
+ return uuidMap;
+ }
+
+ <T extends AbstractMetadataRecord> List<T> getByParent(String parentId, char type, @SuppressWarnings("unused") Class<T> clazz, boolean create) {
+ Map<Character, List<AbstractMetadataRecord>> children = childRecords.get(parentId);
+ if (children == null) {
+ children = new HashMap<Character, List<AbstractMetadataRecord>>();
+ childRecords.put(parentId, children);
+ }
+ List<AbstractMetadataRecord> typeChildren = children.get(type);
+ if (typeChildren == null) {
+ if (!create) {
+ return Collections.emptyList();
+ }
+ typeChildren = new ArrayList<AbstractMetadataRecord>(2);
+ children.put(type, typeChildren);
+ }
+ return (List<T>) typeChildren;
+ }
+
+ private void loadAll() {
+ for (Index index : this.indexes) {
+ try {
+ IEntryResult[] results = SimpleIndexUtil.queryIndex(new Index[] {index}, new char[0], true, true, false);
+ recordFactory.getMetadataRecord(results);
+ } catch (TeiidException e) {
+ throw new TeiidRuntimeException(e);
+ }
+ }
+ //associate the annotation/extension metadata
+ for (Map<String, AbstractMetadataRecord> map : allRecords.values()) {
+ for (AbstractMetadataRecord metadataRecord : map.values()) {
+ String uuid = metadataRecord.getUUID();
+
+ metadataRecord.setAnnotation(this.annotationCache.get(uuid));
+ metadataRecord.setProperties(this.extensionCache.get(uuid));
+ }
+ }
+ }
+
public MetadataStore getMetadataStore(Collection<Datatype> systemDatatypes) throws IOException {
if (this.store == null) {
this.store = new MetadataStore();
@@ -94,72 +215,27 @@
tmp.add(index);
}
this.indexes = tmp.toArray(new Index[tmp.size()]);
- getAnnotationCache();
- getExtensionCache();
- Map<String, Datatype> datatypes = getDatatypeCache();
+ loadAll();
+ //force close, since we cached the index files
+ for (Index index : tmp) {
+ index.close();
+ }
+ Map<String, AbstractMetadataRecord> uuidToRecord = getByType(MetadataConstants.RECORD_TYPE.DATATYPE);
+ for (AbstractMetadataRecord datatypeRecordImpl : uuidToRecord.values()) {
+ this.store.addDatatype((Datatype) datatypeRecordImpl);
+ }
if (systemDatatypes != null) {
for (Datatype datatype : systemDatatypes) {
- datatypes.put(datatype.getUUID(), datatype);
+ uuidToRecord.put(datatype.getUUID(), datatype);
}
}
- List<KeyRecord> keys = findMetadataRecords(MetadataConstants.RECORD_TYPE.PRIMARY_KEY, null, false);
- for (KeyRecord keyRecord : keys) {
- this.primaryKeyCache.put(keyRecord.getUUID(), keyRecord);
- }
getModels();
getTables();
getProcedures();
- //force close, since we cached the index files
- for (Index index : tmp) {
- index.close();
- }
}
return store;
}
- private void getExtensionCache() {
- IEntryResult[] properties = queryIndex(MetadataConstants.RECORD_TYPE.PROPERTY, null, false);
-
- for (IEntryResult iEntryResult : properties) {
- final String str = new String(iEntryResult.getWord());
- final List<String> tokens = RecordFactory.getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
-
- String uuid = tokens.get(1);
- LinkedHashMap<String, String> result = this.extensionCache.get(uuid);
- if (result == null) {
- result = new LinkedHashMap<String, String>();
- this.extensionCache.put(uuid, result);
- }
- // The tokens are the standard header values
- int tokenIndex = 2;
- result.put( tokens.get(tokenIndex++), tokens.get(tokenIndex++));
- }
- }
-
- private void getAnnotationCache() {
- IEntryResult[] results = queryIndex(MetadataConstants.RECORD_TYPE.ANNOTATION, null, false);
-
- for (IEntryResult iEntryResult : results) {
- final String str = new String(iEntryResult.getWord());
- final List<String> tokens = RecordFactory.getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
-
- // Extract the index version information from the record
- int indexVersion = recordFactory.getIndexVersion(iEntryResult.getWord());
- String uuid = tokens.get(2);
-
- // The tokens are the standard header values
- int tokenIndex = 6;
-
- if(recordFactory.includeAnnotationProperties(indexVersion)) {
- // The next token are the properties, ignore it not going to be read any way
- tokenIndex++;
- }
-
- // The next token is the description
- this.annotationCache.put(uuid, tokens.get(tokenIndex++));
- }
- }
-
public void addIndexFile(VirtualFile f) {
this.indexFiles.add(f);
}
@@ -215,15 +291,24 @@
}
public void getModels() {
- Collection<Schema> records = findMetadataRecords(MetadataConstants.RECORD_TYPE.MODEL, null, false);
- for (Schema modelRecord : records) {
- store.addSchema(modelRecord);
+ Collection<AbstractMetadataRecord> records = getByType(MetadataConstants.RECORD_TYPE.MODEL).values();
+ for (AbstractMetadataRecord modelRecord : records) {
+ store.addSchema((Schema) modelRecord);
}
}
public void getTables() {
for (Schema model : store.getSchemas().values()) {
- List<Table> records = findMetadataRecords(MetadataConstants.RECORD_TYPE.TABLE, model.getName() + IndexConstants.NAME_DELIM_CHAR + IndexConstants.RECORD_STRING.MATCH_CHAR, true);
+ Map<Character, List<AbstractMetadataRecord>> entries = schemaEntries.get(model.getName());
+ if (entries == null) {
+ continue;
+ }
+ List recs = entries.get(MetadataConstants.RECORD_TYPE.TABLE);
+ if (recs == null) {
+ continue;
+ }
+ List<Table> records = recs;
+
//load non-materialized first, so that the uuid->table cache is populated
Collections.sort(records, new Comparator<Table>() {
@Override
@@ -238,10 +323,9 @@
}
});
for (Table tableRecord : records) {
- tableCache.put(tableRecord.getUUID(), tableRecord);
- List<Column> columns = new ArrayList<Column>(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.COLUMN));
+ List<Column> columns = new ArrayList<Column>(getByParent(tableRecord.getUUID(), MetadataConstants.RECORD_TYPE.COLUMN, Column.class, false));
for (Column columnRecordImpl : columns) {
- columnRecordImpl.setDatatype(getDatatypeCache().get(columnRecordImpl.getDatatypeUUID()));
+ columnRecordImpl.setDatatype((Datatype) getByType(MetadataConstants.RECORD_TYPE.DATATYPE).get(columnRecordImpl.getDatatypeUUID()));
columnRecordImpl.setParent(tableRecord);
String fullName = columnRecordImpl.getName();
if (fullName.startsWith(tableRecord.getName() + '.')) {
@@ -250,7 +334,7 @@
}
Collections.sort(columns);
tableRecord.setColumns(columns);
- tableRecord.setAccessPatterns(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.ACCESS_PATTERN));
+ tableRecord.setAccessPatterns(getByParent(tableRecord.getUUID(), MetadataConstants.RECORD_TYPE.ACCESS_PATTERN, KeyRecord.class, false));
Map<String, Column> uuidColumnMap = new HashMap<String, Column>();
for (Column columnRecordImpl : columns) {
uuidColumnMap.put(columnRecordImpl.getUUID(), columnRecordImpl);
@@ -259,18 +343,18 @@
loadColumnSetRecords(columnSetRecordImpl, uuidColumnMap);
columnSetRecordImpl.setParent(tableRecord);
}
- tableRecord.setForiegnKeys(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.FOREIGN_KEY));
+ tableRecord.setForiegnKeys(getByParent(tableRecord.getUUID(), MetadataConstants.RECORD_TYPE.FOREIGN_KEY, ForeignKey.class, false));
for (ForeignKey foreignKeyRecord : tableRecord.getForeignKeys()) {
foreignKeyRecord.setPrimaryKey(getPrimaryKey(foreignKeyRecord.getUniqueKeyID()));
loadColumnSetRecords(foreignKeyRecord, uuidColumnMap);
foreignKeyRecord.setParent(tableRecord);
}
- tableRecord.setUniqueKeys(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.UNIQUE_KEY));
+ tableRecord.setUniqueKeys(getByParent(tableRecord.getUUID(), MetadataConstants.RECORD_TYPE.UNIQUE_KEY, KeyRecord.class, false));
for (KeyRecord columnSetRecordImpl : tableRecord.getUniqueKeys()) {
loadColumnSetRecords(columnSetRecordImpl, uuidColumnMap);
columnSetRecordImpl.setParent(tableRecord);
}
- tableRecord.setIndexes(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.INDEX));
+ tableRecord.setIndexes(getByParent(tableRecord.getUUID(), MetadataConstants.RECORD_TYPE.INDEX, KeyRecord.class, false));
for (KeyRecord columnSetRecordImpl : tableRecord.getIndexes()) {
loadColumnSetRecords(columnSetRecordImpl, uuidColumnMap);
columnSetRecordImpl.setParent(tableRecord);
@@ -308,8 +392,8 @@
}
}
if (tableRecord.isMaterialized()) {
- tableRecord.setMaterializedStageTable(tableCache.get(tableRecord.getMaterializedStageTable().getUUID()));
- tableRecord.setMaterializedTable(tableCache.get(tableRecord.getMaterializedTable().getUUID()));
+ tableRecord.setMaterializedStageTable((Table)getByType(MetadataConstants.RECORD_TYPE.TABLE).get(tableRecord.getMaterializedStageTable().getUUID()));
+ tableRecord.setMaterializedTable((Table)getByType(MetadataConstants.RECORD_TYPE.TABLE).get(tableRecord.getMaterializedTable().getUUID()));
}
model.addTable(tableRecord);
}
@@ -317,28 +401,16 @@
}
private KeyRecord getPrimaryKey(String uuid) {
- KeyRecord key = this.primaryKeyCache.get(uuid);
+ KeyRecord key = (KeyRecord)this.getByType(MetadataConstants.RECORD_TYPE.PRIMARY_KEY).get(uuid);
if (key == null) {
throw new TeiidRuntimeException(uuid+" PrimaryKey "+TransformationMetadata.NOT_EXISTS_MESSAGE); //$NON-NLS-1$
}
return key;
}
- public Map<String, Datatype> getDatatypeCache() {
- if (this.datatypeCache == null) {
- this.datatypeCache = new HashMap<String, Datatype>();
- Collection<Datatype> dataTypes = findMetadataRecords(MetadataConstants.RECORD_TYPE.DATATYPE, null, false);
- for (Datatype datatypeRecordImpl : dataTypes) {
- datatypeCache.put(datatypeRecordImpl.getUUID(), datatypeRecordImpl);
- this.store.addDatatype(datatypeRecordImpl);
- }
- }
- return datatypeCache;
- }
-
private Column findElement(String fullName) {
- Column columnRecord = (Column)getRecordByType(fullName, MetadataConstants.RECORD_TYPE.COLUMN);
- columnRecord.setDatatype(getDatatypeCache().get(columnRecord.getDatatypeUUID()));
+ Column columnRecord = (Column)getRecordByType(fullName, MetadataConstants.RECORD_TYPE.COLUMN);
+ columnRecord.setDatatype((Datatype) getByType(MetadataConstants.RECORD_TYPE.DATATYPE).get(columnRecord.getDatatypeUUID()));
return columnRecord;
}
@@ -348,31 +420,34 @@
private AbstractMetadataRecord getRecordByType(final String entityName, final char recordType, boolean mustExist) {
// Query the index files
- final Collection results = findMetadataRecords(recordType,entityName,false);
-
- int resultSize = results.size();
- if(resultSize == 1) {
- // get the columnset record for this result
- return (AbstractMetadataRecord) results.iterator().next();
- }
- if(resultSize == 0) {
+ AbstractMetadataRecord record = getByType(recordType).get(entityName);
+
+ if(record == null) {
if (mustExist) {
// there should be only one for the UUID
throw new TeiidRuntimeException(entityName+TransformationMetadata.NOT_EXISTS_MESSAGE);
}
return null;
}
- throw new TeiidRuntimeException(RuntimeMetadataPlugin.Util.getString("TransformationMetadata.0", entityName)); //$NON-NLS-1$
+ return record;
}
public void getProcedures() {
for (Schema model : store.getSchemas().values()) {
- Collection<Procedure> procedureRecordImpls = findMetadataRecords(MetadataConstants.RECORD_TYPE.CALLABLE, model.getName() + IndexConstants.NAME_DELIM_CHAR + IndexConstants.RECORD_STRING.MATCH_CHAR, true);
- for (Procedure procedureRecord : procedureRecordImpls) {
+ Map<Character, List<AbstractMetadataRecord>> entries = schemaEntries.get(model.getName());
+ if (entries == null) {
+ continue;
+ }
+ List recs = entries.get(MetadataConstants.RECORD_TYPE.CALLABLE);
+ if (recs == null) {
+ continue;
+ }
+ List<Procedure> records = recs;
+ for (Procedure procedureRecord : records) {
// get the parameter metadata info
for (int i = 0; i < procedureRecord.getParameters().size(); i++) {
ProcedureParameter paramRecord = (ProcedureParameter) this.getRecordByType(procedureRecord.getParameters().get(i).getUUID(), MetadataConstants.RECORD_TYPE.CALLABLE_PARAMETER);
- paramRecord.setDatatype(getDatatypeCache().get(paramRecord.getDatatypeUUID()));
+ paramRecord.setDatatype((Datatype) getByType(MetadataConstants.RECORD_TYPE.DATATYPE).get(paramRecord.getDatatypeUUID()));
procedureRecord.getParameters().set(i, paramRecord);
paramRecord.setProcedure(procedureRecord);
}
@@ -404,22 +479,6 @@
}
}
- /**
- * Finds children by parent uuid - note that this is not the best way to query for columns,
- * but it removes the need to store the parent uuid
- * @param parentRecord
- * @param childRecordType
- * @return
- */
- private List findChildRecords(final AbstractMetadataRecord parentRecord, final char childRecordType) {
- // construct the pattern string
- String patternStr = getUUIDMatchPattern(childRecordType, parentRecord.getUUID(), true);
- // Query the model index files
- IEntryResult[] results = queryIndex(childRecordType, patternStr.toCharArray(), false, true, false);
-
- return loadRecords(results);
- }
-
private void loadColumnSetRecords(ColumnSet<?> indexRecord, Map<String, Column> columns) {
for (int i = 0; i < indexRecord.getColumns().size(); i++) {
String uuid = indexRecord.getColumns().get(i).getUUID();
@@ -436,180 +495,5 @@
}
}
}
-
- private List findMetadataRecords(final char recordType,
- final String entityName, final boolean isPartialName) {
- IEntryResult[] results = queryIndex(recordType, entityName, isPartialName);
- List<AbstractMetadataRecord> records = loadRecords(results);
- return records;
- }
- private List<AbstractMetadataRecord> loadRecords(
- IEntryResult[] results) {
- List<AbstractMetadataRecord> records = recordFactory.getMetadataRecord(results);
-
- for (AbstractMetadataRecord metadataRecord : records) {
- String uuid = metadataRecord.getUUID();
-
- metadataRecord.setAnnotation(this.annotationCache.get(uuid));
- metadataRecord.setProperties(this.extensionCache.get(uuid));
- }
- return records;
- }
-
- /**
- * Return the pattern match string that could be used to match a UUID in
- * an index record. All index records contain a header portion of the form:
- * recordType|pathInModel|UUID|nameInSource|parentObjectID|
- * @param uuid The UUID for which the pattern match string is to be constructed.
- * @return The pattern match string of the form: recordType|*|uuid|*
- */
- private String getUUIDMatchPattern(final char recordType, String uuid, boolean parent) {
- ArgCheck.isNotNull(uuid);
- // construct the pattern string
- String patternStr = String.valueOf(recordType) + IndexConstants.RECORD_STRING.RECORD_DELIMITER + IndexConstants.RECORD_STRING.MATCH_CHAR + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- if (parent) {
- for (int i = 0; i < 3; i++) {
- patternStr += String.valueOf(IndexConstants.RECORD_STRING.MATCH_CHAR) + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- }
- }
- patternStr += uuid.toLowerCase() + IndexConstants.RECORD_STRING.RECORD_DELIMITER + IndexConstants.RECORD_STRING.MATCH_CHAR;
- return patternStr;
- }
-
- /**
- * Return all index file records that match the specified entity name
- * @param indexName
- * @param entityName the name to match
- * @param isPartialName true if the entity name is a partially qualified
- * @return results
- * @throws QueryMetadataException
- */
- private IEntryResult[] queryIndex(final char recordType, final String entityName, final boolean isPartialName) {
-
- IEntryResult[] results = null;
-
- // Query based on UUID
- if (StringUtil.startsWithIgnoreCase(entityName,UUID.PROTOCOL)) {
- String patternString = null;
- if (recordType == MetadataConstants.RECORD_TYPE.DATATYPE) {
- patternString = getDatatypeUUIDMatchPattern(entityName);
- } else {
- patternString = getUUIDMatchPattern(recordType,entityName, false);
- }
- results = queryIndex(recordType, patternString.toCharArray(), false, true, true);
- }
-
- // Query based on partially qualified name
- else if (isPartialName) {
- String patternString = getMatchPattern(recordType,entityName);
- results = queryIndex(recordType, patternString.toCharArray(), false, true, false);
- }
-
- // Query based on fully qualified name
- else {
- String prefixString = getPrefixPattern(recordType,entityName);
- results = queryIndex(recordType, prefixString.toCharArray(), true, true, entityName != null);
- }
-
- return results;
- }
-
- /**
- * Return the pattern match string that could be used to match a UUID in
- * a datatype index record. The RECORD_TYPE.DATATYPE records contain a header portion of the form:
- * recordType|datatypeID|basetypeID|fullName|objectID|nameInSource|...
- * @param uuid The UUID for which the pattern match string is to be constructed.
- * @return The pattern match string of the form: recordType|*|*|*|uuid|*
- */
- private String getDatatypeUUIDMatchPattern(final String uuid) {
- ArgCheck.isNotNull(uuid);
- String uuidString = uuid;
- if (StringUtil.startsWithIgnoreCase(uuid,UUID.PROTOCOL)) {
- uuidString = uuid.toLowerCase();
- }
- // construct the pattern string
- String patternStr = "" //$NON-NLS-1$
- + MetadataConstants.RECORD_TYPE.DATATYPE //recordType
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + IndexConstants.RECORD_STRING.MATCH_CHAR //datatypeID
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + IndexConstants.RECORD_STRING.MATCH_CHAR //basetypeID
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + IndexConstants.RECORD_STRING.MATCH_CHAR //fullName
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + uuidString //objectID
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + IndexConstants.RECORD_STRING.MATCH_CHAR;
- return patternStr;
- }
-
- /**
- * Return the prefix match string that could be used to exactly match a fully
- * qualified entity name in an index record. All index records
- * contain a header portion of the form:
- * recordType|pathInModel|UUID|nameInSource|parentObjectID|
- * @param name The fully qualified name for which the prefix match
- * string is to be constructed.
- * @return The pattern match string of the form: recordType|name|
- */
- private String getPrefixPattern(final char recordType, final String name) {
-
- // construct the pattern string
- String patternStr = "" //$NON-NLS-1$
- + recordType
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- if(name != null) {
- patternStr = patternStr + name.trim().toUpperCase() + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- }
-
- return patternStr;
- }
-
- /**
- * Return the pattern match string that could be used to match a
- * partially/fully qualified entity name in an index record. All index records
- * contain a header portion of the form:
- * recordType|pathInModel|UUID|nameInSource|parentObjectID|
- * @param name The partially/fully qualified name for which
- * the pattern match string is to be constructed.
- * @return The pattern match string of the form: recordType|name|*
- */
- private String getMatchPattern(final char recordType, final String name) {
- ArgCheck.isNotNull(name);
-
- // construct the pattern string
- String patternStr = "" //$NON-NLS-1$
- + recordType
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- if(name != null) {
- patternStr = patternStr + name.trim().toUpperCase()
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER
- + IndexConstants.RECORD_STRING.MATCH_CHAR;
- }
- return patternStr;
- }
-
- /**
- * Return all index file records that match the specified record pattern.
- * @param indexes the array of MtkIndex instances to query
- * @param pattern
- * @return results
- * @throws QueryMetadataException
- */
- private IEntryResult[] queryIndex(char recordType, final char[] pattern, boolean isPrefix, boolean isCaseSensitive, boolean returnFirstMatch) {
- // The the index file name for the record type
- final String indexName = SimpleIndexUtil.getIndexFileNameForRecordType(recordType);
- Index[] search = SimpleIndexUtil.getIndexes(indexName, this.indexes);
-
- if (search.length == 0) {
- search = this.indexes;
- }
-
- try {
- return SimpleIndexUtil.queryIndex(search, pattern, isPrefix, isCaseSensitive, returnFirstMatch);
- } catch (TeiidException e) {
- throw new TeiidRuntimeException(e);
- }
- }
}
Modified: branches/as7/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
===================================================================
--- branches/as7/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -24,13 +24,11 @@
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import org.teiid.core.id.UUID;
import org.teiid.core.index.IEntryResult;
import org.teiid.core.util.Assertion;
-import org.teiid.core.util.StringUtil;
import org.teiid.internal.core.index.EntryResult;
import org.teiid.internal.core.index.IIndexConstants;
import org.teiid.metadata.AbstractMetadataRecord;
@@ -134,6 +132,8 @@
public static final int CURRENT_INDEX_VERSION = PROCEDURE_UPDATE_COUNT_VERSION;
private int version = NONVERSIONED_RECORD_INDEX_VERSION;
+
+ protected String parentId;
/**
* Return a collection of {@link AbstractMetadataRecord}
@@ -157,7 +157,8 @@
* instances for specified IEntryResult.
* @param entryResult
*/
- private AbstractMetadataRecord getMetadataRecord(final char[] record) {
+ protected AbstractMetadataRecord getMetadataRecord(final char[] record) {
+ parentId = null;
if (record == null || record.length == 0) {
return null;
}
@@ -182,7 +183,7 @@
case MetadataConstants.RECORD_TYPE.MAPPING_TRANSFORM:
case MetadataConstants.RECORD_TYPE.PROC_TRANSFORM: return createTransformationRecord(record);
default:
- throw new IllegalArgumentException("Invalid record type for creating MetadataRecord "+record[0]); //$NON-NLS-1$
+ return null;
}
}
@@ -299,8 +300,7 @@
* Create a ModelRecord instance from the specified index record
*/
public Schema createModelRecord(final char[] record) {
- final String str = new String(record);
- final List<String> tokens = getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+ final List<String> tokens = getStrings(record, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
final Schema model = new Schema();
// The tokens are the standard header values
@@ -332,8 +332,7 @@
* Create a TransformationRecord instance from the specified index record
*/
public TransformationRecordImpl createTransformationRecord(final char[] record) {
- final String str = new String(record);
- final List<String> tokens = getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+ final List<String> tokens = getStrings(record, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
final TransformationRecordImpl transform = new TransformationRecordImpl();
// Extract the index version information from the record
@@ -343,11 +342,12 @@
int tokenIndex = 2;
// The next token is the UUID of the transformed object
- getObjectValue(tokens.get(tokenIndex++));
+ transform.setUUID(getObjectValue(tokens.get(tokenIndex++)));
// The next token is the UUID of the transformation object
if(includeTransformationUUID(indexVersion)) {
- transform.setUUID(getObjectValue((tokens.get(tokenIndex++))));
+ tokenIndex++;
+ //transform.setUUID(getObjectValue((tokens.get(tokenIndex++))));
}
// The next token is the transformation definition
@@ -384,8 +384,7 @@
* Create a TableRecord instance from the specified index record
*/
public Table createTableRecord(final char[] record) {
- final String str = new String(record);
- final List<String> tokens = getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+ final List<String> tokens = getStrings(record, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
final Table table = new Table();
// Extract the index version information from the record
@@ -456,8 +455,7 @@
* Create a ColumnRecord instance from the specified index record
*/
public Column createColumnRecord(final char[] record) {
- final String str = new String(record);
- final List<String> tokens = getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+ final List<String> tokens = getStrings(record, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
final Column column = new Column();
// Extract the index version information from the record
@@ -543,8 +541,7 @@
* Create a ColumnSetRecord instance from the specified index record
*/
public ColumnSet createColumnSetRecord(final char[] record, ColumnSet columnSet) {
- final String str = new String(record);
- final List<String> tokens = getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+ final List<String> tokens = getStrings(record, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
// Extract the index version information from the record
int indexVersion = getIndexVersion(record);
@@ -573,8 +570,7 @@
* Create a ForeignKeyRecord instance from the specified index record
*/
public ForeignKey createForeignKeyRecord(final char[] record) {
- final String str = new String(record);
- final List<String> tokens = getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+ final List<String> tokens = getStrings(record, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
final ForeignKey fkRecord = new ForeignKey();
// Extract the index version information from the record
@@ -603,8 +599,7 @@
* Create a DatatypeRecord instance from the specified index record
*/
public Datatype createDatatypeRecord(final char[] record) {
- final String str = new String(record);
- final List<String> tokens = getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+ final List<String> tokens = getStrings(record, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
final Datatype dt = new Datatype();
// Extract the index version information from the record
@@ -686,9 +681,7 @@
* Create a ProcedureRecord instance from the specified index record
*/
public Procedure createProcedureRecord(final char[] record) {
-
- final String str = new String(record);
- final List<String> tokens = getStrings(str, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
+ final List<String> tokens = getStrings(record, IndexConstants.RECORD_STRING.RECORD_DELIMITER);
final Procedure procRd = new Procedure();
// Extract the index version information from the record
@@ -847,26 +840,35 @@
}
return false;
}
+
+ public static List<String> getStrings(final String record, final char listDelimiter) {
+ return getStrings(record.toCharArray(), listDelimiter);
+ }
- public static List<String> getStrings(final String values, final char listDelimiter) {
- if (StringUtil.isEmpty(values)) {
+ public static List<String> getStrings(final char[] record, final char listDelimiter) {
+ if (record == null || record.length == 0) {
return Collections.emptyList();
}
- if (values.length() == 1 && values.charAt(0) == IndexConstants.RECORD_STRING.SPACE) {
+ if (record.length == 1 && record[0] == IndexConstants.RECORD_STRING.SPACE) {
return Collections.emptyList();
}
- final List<String> tokens = StringUtil.split(values,String.valueOf(listDelimiter));
- final List<String> result = new ArrayList<String>(tokens.size());
- for (Iterator iter = tokens.iterator(); iter.hasNext();) {
- String token = (String)iter.next();
- if (token != null) {
- result.add(new String(token));
- }
+ List<String> result = new ArrayList<String>();
+ int start = 0;
+ for (int i = 0; i < record.length; i++) {
+ if (record[i] == listDelimiter) {
+ if (i != start) {
+ result.add(new String(record, start, i - start));
+ }
+ start = i+1;
+ }
}
+ if (start < record.length) {
+ result.add(new String(record, start, record.length - start));
+ }
return result;
}
-
- public char getListDelimiter(final int indexVersionNumber) {
+
+ public char getListDelimiter(final int indexVersionNumber) {
if (indexVersionNumber < DELIMITER_INDEX_VERSION) {
return IndexConstants.RECORD_STRING.LIST_DELIMITER_OLD;
}
@@ -950,6 +952,7 @@
final String parentObjectID) {
record.setUUID(getObjectValue(objectID));
+ String parentName = fullName;
if (fullName != null) {
String name = fullName;
if (record instanceof ProcedureParameter || record instanceof KeyRecord) { //take only the last part
@@ -958,10 +961,23 @@
int index = fullName.indexOf(IndexConstants.NAME_DELIM_CHAR);
if (index > 0) {
name = new String(fullName.substring(index + 1));
+ parentName = new String(fullName.substring(0, index));
}
}
record.setName(name);
}
+ if (parentName != null) {
+ if (record instanceof Table) {
+ Schema s = new Schema();
+ s.setName(parentName);
+ ((Table)record).setParent(s);
+ } else if (record instanceof Procedure) {
+ Schema s = new Schema();
+ s.setName(parentName);
+ ((Procedure)record).setParent(s);
+ }
+ }
+ parentId = getObjectValue(parentObjectID);
record.setNameInSource(getObjectValue(nameInSource));
}
Property changes on: branches/as7/metadata/src/test/java/org/teiid/cdk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/metadata/src/test/java/org/teiid/cdk:3535-3555*
/trunk/metadata/src/test/java/org/teiid/cdk:3507-3597
+ /branches/7.4.x/metadata/src/test/java/org/teiid/cdk:3535-3555*
/trunk/metadata/src/test/java/org/teiid/cdk:3507-3666
Property changes on: branches/as7/metadata/src/test/java/org/teiid/cdk/api
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/metadata/src/test/java/org/teiid/cdk/api:3535-3555
/trunk/metadata/src/test/java/org/teiid/cdk/api:3507-3597
+ /branches/7.4.x/metadata/src/test/java/org/teiid/cdk/api:3535-3555
/trunk/metadata/src/test/java/org/teiid/cdk/api:3507-3666
Property changes on: branches/as7/metadata/src/test/java/org/teiid/cdk/unittest
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/metadata/src/test/java/org/teiid/cdk/unittest:3535-3555
/trunk/metadata/src/test/java/org/teiid/cdk/unittest:3507-3597
+ /branches/7.4.x/metadata/src/test/java/org/teiid/cdk/unittest:3535-3555
/trunk/metadata/src/test/java/org/teiid/cdk/unittest:3507-3666
Property changes on: branches/as7/metadata/src/test/java/org/teiid/core
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/metadata/src/test/java/org/teiid/core:3535-3555*
/trunk/metadata/src/test/java/org/teiid/core:3507-3597
+ /branches/7.4.x/metadata/src/test/java/org/teiid/core:3535-3555*
/trunk/metadata/src/test/java/org/teiid/core:3507-3666
Property changes on: branches/as7/metadata/src/test/java/org/teiid/core/util
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/metadata/src/test/java/org/teiid/core/util:3535-3555
/trunk/metadata/src/test/java/org/teiid/core/util:3507-3597
+ /branches/7.4.x/metadata/src/test/java/org/teiid/core/util:3535-3555
/trunk/metadata/src/test/java/org/teiid/core/util:3507-3666
Property changes on: branches/as7/metadata/src/test/java/org/teiid/internal
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/metadata/src/test/java/org/teiid/internal:3535-3555*
/trunk/metadata/src/test/java/org/teiid/internal:3507-3597
+ /branches/7.4.x/metadata/src/test/java/org/teiid/internal:3535-3555*
/trunk/metadata/src/test/java/org/teiid/internal:3507-3666
Property changes on: branches/as7/metadata/src/test/java/org/teiid/internal/core
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/metadata/src/test/java/org/teiid/internal/core:3535-3555*
/trunk/metadata/src/test/java/org/teiid/internal/core:3507-3597
+ /branches/7.4.x/metadata/src/test/java/org/teiid/internal/core:3535-3555*
/trunk/metadata/src/test/java/org/teiid/internal/core:3507-3666
Property changes on: branches/as7/metadata/src/test/java/org/teiid/internal/core/index
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/metadata/src/test/java/org/teiid/internal/core/index:3535-3555
/trunk/metadata/src/test/java/org/teiid/internal/core/index:3507-3597
+ /branches/7.4.x/metadata/src/test/java/org/teiid/internal/core/index:3535-3555
/trunk/metadata/src/test/java/org/teiid/internal/core/index:3507-3666
Modified: branches/as7/pom.xml
===================================================================
--- branches/as7/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -5,7 +5,7 @@
<artifactId>teiid-parent</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
<description>Federated SQL and XML query engine.</description>
<properties>
<ant.version>1.7.0</ant.version>
@@ -74,6 +74,9 @@
This profile is activated manually, as in "mvn ... -P release ..."
-->
<id>release</id>
+ <properties>
+ <maven.javadoc.skip>true</maven.javadoc.skip>
+ </properties>
<modules>
<module>documentation</module>
<module>build</module>
@@ -126,15 +129,6 @@
</plugins>
</pluginManagement>
<plugins>
- <!-- workaround for build errors with javadoc:aggregate-jar -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.2.1</version>
- <configuration>
- <preparationGoals>clean install</preparationGoals>
- </configuration>
- </plugin>
<!-- Specify the compiler options and settings -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Modified: branches/as7/runtime/pom.xml
===================================================================
--- branches/as7/runtime/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: branches/as7/runtime/src/main/java/org/teiid/odbc/ODBCClientRemote.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/odbc/ODBCClientRemote.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/java/org/teiid/odbc/ODBCClientRemote.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -80,7 +80,7 @@
void sendMoveCursor(ResultSetImpl rs, int rowCount, ResultsFuture<Integer> results);
- void sendCommandComplete(String sql, int updateCount);
+ void sendCommandComplete(String sql, Integer count);
// CommandComplete (B)
void sendUpdateCount(String sql, int updateCount);
Modified: branches/as7/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -54,7 +54,7 @@
import org.teiid.jdbc.TeiidDriver;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.net.TeiidURL.CONNECTION.AuthenticationType;
+import org.teiid.net.socket.AuthenticationType;
import org.teiid.odbc.PGUtil.PgColInfo;
import org.teiid.query.parser.SQLParserUtil;
import org.teiid.runtime.RuntimePlugin;
@@ -189,7 +189,7 @@
if (this.authType.equals(AuthenticationType.CLEARTEXT)) {
this.client.useClearTextAuthentication();
}
- else if (this.authType.equals(AuthenticationType.KRB5)) {
+ else if (this.authType.equals(AuthenticationType.GSS)) {
this.client.useAuthenticationGSS();
}
}
@@ -205,17 +205,21 @@
if (authType.equals(AuthenticationType.CLEARTEXT)) {
password = data.readString();
}
- else if (authType.equals(AuthenticationType.KRB5)) {
+ else if (authType.equals(AuthenticationType.GSS)) {
byte[] serviceToken = data.readServiceToken();
LogonResult result = this.logon.neogitiateGssLogin(this.props, serviceToken, false);
- if (!Boolean.TRUE.equals(result.getProperty(ILogon.KRB5_ESTABLISHED))) {
- serviceToken = (byte[])result.getProperty(ILogon.KRB5TOKEN);
+ serviceToken = (byte[])result.getProperty(ILogon.KRB5TOKEN);
+ if (Boolean.TRUE.equals(result.getProperty(ILogon.KRB5_ESTABLISHED))) {
+ passthroughAuthentication = ";PassthroughAuthentication=true;authenticationType=KRB5"; //$NON-NLS-1$
+ info.put(ILogon.KRB5TOKEN, serviceToken);
+ }
+ else {
this.client.authenticationGSSContinue(serviceToken);
- return;
+ return;
}
- passthroughAuthentication = ";PassthroughAuthentication=true"; //$NON-NLS-1$
}
+ // this is local connection
String url = "jdbc:teiid:"+databaseName+";ApplicationName=ODBC"+passthroughAuthentication; //$NON-NLS-1$ //$NON-NLS-2$
if (password != null) {
@@ -264,7 +268,7 @@
try {
List<PgColInfo> cols = getPgColInfo(stmt.getResultSet().getMetaData());
cursorMap.put(cursorName, new Cursor(cursorName, sql, stmt, null, stmt.getResultSet(), cols));
- client.sendCommandComplete("DECLARE CURSOR", 0); //$NON-NLS-1$
+ client.sendCommandComplete("DECLARE CURSOR", null); //$NON-NLS-1$
completion.getResultsReceiver().receiveResults(0);
} catch (Throwable e) {
completion.getResultsReceiver().exceptionOccurred(e);
@@ -332,7 +336,7 @@
if (cursor != null) {
cursor.rs.close();
cursor.stmt.close();
- this.client.sendCommandComplete("CLOSE CURSOR", 0); //$NON-NLS-1$
+ this.client.sendCommandComplete("CLOSE CURSOR", null); //$NON-NLS-1$
}
}
@@ -937,7 +941,7 @@
String plan_name = m.group(1);
plan_name = SQLParserUtil.normalizeId(plan_name);
closePreparedStatement(plan_name);
- client.sendCommandComplete("DEALLOCATE", 0); //$NON-NLS-1$
+ client.sendCommandComplete("DEALLOCATE", null); //$NON-NLS-1$
results.getResultsReceiver().receiveResults(1);
}
else {
Modified: branches/as7/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -246,8 +246,8 @@
return bufferMgr.getReadAttempts();
}
- public long getMemoryBufferSpace() {
- return memoryBufferSpace;
+ public int getMemoryBufferSpace() {
+ return (int)memoryBufferSpace;
}
public int getMaxStorageObjectSize() {
Modified: branches/as7/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -60,7 +60,7 @@
import org.teiid.logging.LogManager;
import org.teiid.net.ServerConnection;
import org.teiid.net.TeiidURL;
-import org.teiid.net.TeiidURL.CONNECTION.AuthenticationType;
+import org.teiid.net.socket.AuthenticationType;
import org.teiid.runtime.RuntimePlugin;
import org.teiid.security.Credentials;
import org.teiid.security.SecurityHelper;
@@ -77,7 +77,7 @@
private long sessionMaxLimit = DEFAULT_MAX_SESSIONS;
private long sessionExpirationTimeLimit = DEFAULT_SESSION_EXPIRATION;
private AuthenticationType authenticationType = AuthenticationType.CLEARTEXT;
- private String krb5SecurityDomain;
+ private String gssSecurityDomain;
/*
* Injected state
@@ -397,13 +397,18 @@
this.securityHelper.associateSecurityContext(securityDomain, this.securityHelper.createSecurityContext(securityDomain, principal, null, subject));
}
- public void setKrb5SecurityDomain(String domain) {
- this.krb5SecurityDomain = domain;
+ @Override
+ public Subject getSubjectInContext(String securityDomain) {
+ return this.securityHelper.getSubjectInContext(securityDomain);
}
+ public void setGssSecurityDomain(String domain) {
+ this.gssSecurityDomain = domain;
+ }
+
@Override
- public String getKrb5SecurityDomain(){
- return this.krb5SecurityDomain;
+ public String getGssSecurityDomain(){
+ return this.gssSecurityDomain;
}
protected Collection<String> getDomainsForUser(List<String> domains, String username) {
Modified: branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -23,6 +23,7 @@
package org.teiid.transport;
import org.teiid.core.ComponentNotFoundException;
+import org.teiid.net.socket.AuthenticationType;
import org.teiid.security.SecurityHelper;
@@ -35,5 +36,7 @@
<T> T getClientService(Class<T> iface) throws ComponentNotFoundException;
SecurityHelper getSecurityHelper();
+
+ AuthenticationType getAuthenticationType();
}
Modified: branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistryImpl.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistryImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/java/org/teiid/transport/ClientServiceRegistryImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -26,6 +26,7 @@
import org.teiid.core.ComponentNotFoundException;
import org.teiid.core.util.ReflectionHelper;
+import org.teiid.net.socket.AuthenticationType;
import org.teiid.runtime.RuntimePlugin;
import org.teiid.security.SecurityHelper;
@@ -58,6 +59,7 @@
private HashMap<String, ClientService> clientServices = new HashMap<String, ClientService>();
private SecurityHelper securityHelper;
private Type type = Type.JDBC;
+ private AuthenticationType authenticationType = AuthenticationType.CLEARTEXT;
public ClientServiceRegistryImpl() {
@@ -66,6 +68,10 @@
public ClientServiceRegistryImpl(Type type) {
this.type = type;
}
+
+ public void setAuthenticationType(AuthenticationType authenticationType) {
+ this.authenticationType = authenticationType;
+ }
public <T> T getClientService(Class<T> iface) throws ComponentNotFoundException {
ClientService cs = getClientService(iface.getName());
@@ -92,5 +98,10 @@
public void setSecurityHelper(SecurityHelper securityHelper) {
this.securityHelper = securityHelper;
}
+
+ @Override
+ public AuthenticationType getAuthenticationType() {
+ return authenticationType;
+ }
}
Modified: branches/as7/runtime/src/main/java/org/teiid/transport/LogonImpl.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/transport/LogonImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/java/org/teiid/transport/LogonImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -50,7 +50,7 @@
import org.teiid.logging.LogManager;
import org.teiid.net.CommunicationException;
import org.teiid.net.TeiidURL;
-import org.teiid.net.TeiidURL.CONNECTION.AuthenticationType;
+import org.teiid.net.socket.AuthenticationType;
import org.teiid.runtime.RuntimePlugin;
import org.teiid.security.Credentials;
@@ -66,6 +66,14 @@
}
public LogonResult logon(Properties connProps) throws LogonException, TeiidComponentException, CommunicationException {
+ if (this.service.getGssSecurityDomain() != null && connProps.get(ILogon.KRB5TOKEN) != null) {
+ Subject user = this.service.getSubjectInContext(this.service.getGssSecurityDomain());
+ if (user == null) {
+ throw new LogonException(RuntimePlugin.Util.getString("krb5_user_not_found")); //$NON-NLS-1$
+ }
+ return logon(connProps, (byte[])connProps.get(ILogon.KRB5TOKEN));
+ }
+
if (!AuthenticationType.CLEARTEXT.equals(service.getAuthenticationType())) {
throw new LogonException(RuntimePlugin.Util.getString("wrong_logon_type_jaas")); //$NON-NLS-1$
}
@@ -144,7 +152,7 @@
@Override
public LogonResult neogitiateGssLogin(Properties connProps, byte[] serviceTicket, boolean createSession) throws LogonException {
- if (!AuthenticationType.KRB5.equals(service.getAuthenticationType())) {
+ if (!AuthenticationType.GSS.equals(service.getAuthenticationType())) {
throw new LogonException(RuntimePlugin.Util.getString("wrong_logon_type_krb5")); //$NON-NLS-1$
}
@@ -152,7 +160,7 @@
String password = connProps.getProperty(TeiidURL.CONNECTION.PASSWORD);
try {
- String securityDomain = service.getKrb5SecurityDomain();
+ String securityDomain = service.getGssSecurityDomain();
if (securityDomain == null) {
throw new LogonException(RuntimePlugin.Util.getString("no_security_domains")); //$NON-NLS-1$
}
@@ -164,6 +172,11 @@
if (result == null) {
throw new LogonException(RuntimePlugin.Util.getString("krb5_login_failed")); //$NON-NLS-1$
}
+
+ if (result.context.isEstablished()) {
+ service.associateSubjectInContext(securityDomain, subject);
+ }
+
if (!result.context.isEstablished() || !createSession) {
LogonResult logonResult = new LogonResult(new SessionToken(0, "temp"), "internal", 0, "internal"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
logonResult.addProperty(ILogon.KRB5TOKEN, result.serviceTicket);
@@ -173,7 +186,6 @@
LogManager.logDetail(LogConstants.CTX_SECURITY, "Kerberos context established"); //$NON-NLS-1$
//connProps.setProperty(TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION, "true"); //$NON-NLS-1$
- service.associateSubjectInContext(securityDomain, subject);
return logon(connProps, result.serviceTicket);
} catch (LoginException e) {
throw new LogonException(e, RuntimePlugin.Util.getString("krb5_login_failed")); //$NON-NLS-1$
Modified: branches/as7/runtime/src/main/java/org/teiid/transport/ODBCClientInstance.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/transport/ODBCClientInstance.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/java/org/teiid/transport/ODBCClientInstance.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -36,7 +36,7 @@
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
import org.teiid.net.CommunicationException;
-import org.teiid.net.TeiidURL.CONNECTION.AuthenticationType;
+import org.teiid.net.socket.AuthenticationType;
import org.teiid.net.socket.ObjectChannel;
import org.teiid.net.socket.ServiceInvocationStruct;
import org.teiid.odbc.ODBCClientRemote;
Modified: branches/as7/runtime/src/main/java/org/teiid/transport/ODBCSocketListener.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/transport/ODBCSocketListener.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/java/org/teiid/transport/ODBCSocketListener.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -22,17 +22,13 @@
package org.teiid.transport;
import java.net.InetSocketAddress;
-import java.util.Properties;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.DefaultChannelPipeline;
import org.teiid.client.security.ILogon;
import org.teiid.common.buffer.StorageManager;
-import org.teiid.core.TeiidException;
-import org.teiid.jdbc.EmbeddedProfile;
import org.teiid.jdbc.TeiidDriver;
-import org.teiid.net.ServerConnection;
-import org.teiid.net.TeiidURL.CONNECTION.AuthenticationType;
+import org.teiid.net.socket.AuthenticationType;
import org.teiid.net.socket.ObjectChannel;
public class ODBCSocketListener extends SocketListener {
@@ -47,18 +43,6 @@
super(address, config, csr, storageManager);
this.maxLobSize = maxLobSize;
this.driver = new TeiidDriver();
- this.driver.setEmbeddedProfile(new EmbeddedProfile() {
- @Override
- protected ServerConnection createServerConnection(Properties info)
- throws TeiidException {
- //When using the non-blocking api, we don't want to use the calling thread
- return new LocalServerConnection(info, false) {
- protected ClientServiceRegistry getClientServiceRegistry() {
- return csr;
- }
- };
- }
- });
this.logonService = logon;
}
Modified: branches/as7/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -56,11 +56,13 @@
import org.teiid.client.util.ResultsFuture;
import org.teiid.core.util.ObjectConverterUtil;
import org.teiid.core.util.ReflectionHelper;
+import org.teiid.core.util.SqlUtil;
import org.teiid.core.util.StringUtil;
import org.teiid.jdbc.ResultSetImpl;
import org.teiid.jdbc.TeiidSQLException;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
+import org.teiid.logging.MessageLevel;
import org.teiid.net.socket.ServiceInvocationStruct;
import org.teiid.odbc.ODBCClientRemote;
import org.teiid.odbc.PGUtil.PgColInfo;
@@ -154,7 +156,7 @@
} else {
sendContents();
if (sql != null) {
- sendCommandComplete(sql, 0);
+ sendCommandComplete(sql, rowsSent);
}
result.getResultsReceiver().receiveResults(rowsSent);
processNext = false;
@@ -233,11 +235,7 @@
@Override
public void useClearTextAuthentication() {
- try {
- sendAuthenticationCleartextPassword();
- } catch (IOException e) {
- terminate(e);
- }
+ sendAuthenticationCleartextPassword();
}
@Override
@@ -420,42 +418,28 @@
}
@Override
- public void sendCommandComplete(String sql, int updateCount) {
+ public void sendCommandComplete(String sql, Integer count) {
startMessage('C');
- // TODO remove remarks at the beginning
String tag;
- if (StringUtil.startsWithIgnoreCase(sql, "INSERT")) {
- tag = "INSERT 0 " + updateCount;
- } else if (StringUtil.startsWithIgnoreCase(sql, "DELETE")) {
- tag = "DELETE " + updateCount;
- } else if (StringUtil.startsWithIgnoreCase(sql, "UPDATE")) {
- tag = "UPDATE " + updateCount;
- } else if (StringUtil.startsWithIgnoreCase(sql, "SELECT") || StringUtil.startsWithIgnoreCase(sql, "CALL")) {
- tag = "SELECT";
- } else if (StringUtil.startsWithIgnoreCase(sql, "BEGIN") || StringUtil.startsWithIgnoreCase(sql, "START TRANSACTION")) {
+ if (StringUtil.startsWithIgnoreCase(sql, "BEGIN") || StringUtil.startsWithIgnoreCase(sql, "START TRANSACTION")) {
tag = "BEGIN";
- } else if (StringUtil.startsWithIgnoreCase(sql, "COMMIT")) {
- tag = "COMMIT";
- } else if (StringUtil.startsWithIgnoreCase(sql, "ROLLBACK")) {
- tag = "ROLLBACK";
+ } else if (sql.indexOf(' ') == -1) {
+ //should already be a completion tag
+ tag = sql.toUpperCase();
+ if (count != null) {
+ tag += " " + count;
+ }
} else if (StringUtil.startsWithIgnoreCase(sql, "SET ")) {
tag = "SET";
- } else if (StringUtil.startsWithIgnoreCase(sql, "DECLARE CURSOR")) {
- tag = "DECLARE CURSOR";
- } else if (StringUtil.startsWithIgnoreCase(sql, "CLOSE CURSOR")) {
- tag = "CLOSE CURSOR";
- } else if (StringUtil.startsWithIgnoreCase(sql, "FETCH")) {
- tag = "FETCH "+ updateCount;
- } else if (StringUtil.startsWithIgnoreCase(sql, "MOVE")) {
- tag = "MOVE "+ updateCount;
- } else if (StringUtil.startsWithIgnoreCase(sql, "RELEASE")) {
- tag = "RELEASE "+ updateCount;
- } else if (StringUtil.startsWithIgnoreCase(sql, "SAVEPOINT")) {
- tag = "SAVEPOINT "+ updateCount;
+ } else {
+ tag = SqlUtil.getKeyword(sql).toUpperCase();
+ if (tag.equals("EXEC") || tag.equals("CALL")) {
+ tag = "SELECT";
+ }
+ if (count != null) {
+ tag += " " + count;
+ }
}
- else {
- tag = sql;
- }
writeString(tag);
sendMessage();
}
@@ -609,7 +593,15 @@
}
private void sendErrorResponse(Throwable t) {
- trace(t.getMessage());
+ if (t instanceof SQLException) {
+ //we are just re-logging an exception raised by the engine
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_ODBC, MessageLevel.DETAIL)) {
+ LogManager.logWarning(LogConstants.CTX_ODBC, t, "Error occurred"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ } else {
+ //should be in the odbc layer
+ LogManager.logError(LogConstants.CTX_ODBC, t, RuntimePlugin.Util.getString("PgBackendProtocol.unexpected_error")); //$NON-NLS-1$
+ }
SQLException e = TeiidSQLException.create(t);
startMessage('E');
write('S');
@@ -661,7 +653,7 @@
}
private void sendErrorResponse(String message) {
- trace("Exception:", message);
+ LogManager.logWarning(LogConstants.CTX_ODBC, message); //$NON-NLS-1$
startMessage('E');
write('S');
writeString("ERROR");
@@ -699,7 +691,7 @@
sendMessage();
}
- private void sendAuthenticationCleartextPassword() throws IOException {
+ private void sendAuthenticationCleartextPassword() {
startMessage('R');
writeInt(3);
sendMessage();
@@ -809,7 +801,9 @@
initBuffer(estimatedLength);
}
this.dataOut.writeByte((byte)newMessageType);
- this.dataOut.writerIndex(this.dataOut.writerIndex() + 4);
+ int nextByte = this.dataOut.writerIndex() + 4;
+ this.dataOut.ensureWritableBytes(nextByte);
+ this.dataOut.writerIndex(nextByte);
}
private void initBuffer(int estimatedLength) {
Property changes on: branches/as7/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java:3535-3555
+ /branches/7.4.x/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java:3535-3555
/trunk/runtime/src/main/java/org/teiid/transport/SSLConfiguration.java:3598-3666
Modified: branches/as7/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
===================================================================
--- branches/as7/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -95,7 +95,7 @@
public void onConnection() throws CommunicationException {
Handshake handshake = new Handshake();
-
+ handshake.setAuthType(csr.getAuthenticationType());
if (usingEncryption) {
keyGen = new DhKeyGenerator();
byte[] publicKey;
Property changes on: branches/as7/runtime/src/main/java/org/teiid/transport/pg
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/runtime/src/main/java/org/teiid/transport/pg:3535-3555*
/trunk/runtime/src/main/java/org/teiid/transport/pg:3507-3597
+ /branches/7.4.x/runtime/src/main/java/org/teiid/transport/pg:3535-3555*
/trunk/runtime/src/main/java/org/teiid/transport/pg:3507-3666
Property changes on: branches/as7/runtime/src/main/java/org/teiid/transport/pg/PGbytea.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/runtime/src/main/java/org/teiid/transport/pg/PGbytea.java:3535-3555
/trunk/runtime/src/main/java/org/teiid/transport/pg/PGbytea.java:3507-3597
+ /branches/7.4.x/runtime/src/main/java/org/teiid/transport/pg/PGbytea.java:3535-3555
/trunk/runtime/src/main/java/org/teiid/transport/pg/PGbytea.java:3507-3666
Modified: branches/as7/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- branches/as7/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2011-11-17 22:30:19 UTC (rev 3667)
@@ -93,8 +93,9 @@
SSLConfiguration.no_anonymous=The anonymous cipher suite TLS_DH_anon_WITH_AES_128_CBC_SHA is not available. Please change the transport to be non-SSL or use non-anonymous SSL.
PgBackendProtocol.ssl_error=Could not initialize ODBC SSL. non-SSL connections will still be allowed.
+PgBackendProtocol.unexpected_error=Unexpected error occurred
wrong_logon_type_jaas = Wrong logon method is being used. Server is not set up for JAAS based authentication. Correct your client's 'AuthenticationType' property.
wrong_logon_type_krb5 = Wrong logon method is being used. Server is not set up for Kerberos based authentication. Correct your client's 'AuthenticationType' property.
krb5_login_failed=Kerberos context login failed
no_security_domains=No security domain configured for Kerberos authentication. Can not authenticate.
-failed_load_module=Failed to load module {0} for translator {1}
\ No newline at end of file
+krb5_user_not_found=GSS authentication is in use, however authenticated user not found in the context to proceed.
Property changes on: branches/as7/runtime/src/main/resources/org/teiid/transport
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/runtime/src/main/resources/org/teiid/transport:3535-3555*
/trunk/runtime/src/main/resources/org/teiid/transport:3507-3597
+ /branches/7.4.x/runtime/src/main/resources/org/teiid/transport:3535-3555*
/trunk/runtime/src/main/resources/org/teiid/transport:3507-3666
Property changes on: branches/as7/runtime/src/test/java/org/teiid/dqp
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/runtime/src/test/java/org/teiid/dqp:3535-3555*
/trunk/runtime/src/test/java/org/teiid/dqp:3507-3597
+ /branches/7.4.x/runtime/src/test/java/org/teiid/dqp:3535-3555*
/trunk/runtime/src/test/java/org/teiid/dqp:3507-3666
Property changes on: branches/as7/runtime/src/test/java/org/teiid/dqp/service
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/runtime/src/test/java/org/teiid/dqp/service:3535-3555*
/trunk/runtime/src/test/java/org/teiid/dqp/service:3507-3597
+ /branches/7.4.x/runtime/src/test/java/org/teiid/dqp/service:3535-3555*
/trunk/runtime/src/test/java/org/teiid/dqp/service:3507-3666
Property changes on: branches/as7/runtime/src/test/java/org/teiid/dqp/service/buffer
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/runtime/src/test/java/org/teiid/dqp/service/buffer:3535-3555
/trunk/runtime/src/test/java/org/teiid/dqp/service/buffer:3507-3597
+ /branches/7.4.x/runtime/src/test/java/org/teiid/dqp/service/buffer:3535-3555
/trunk/runtime/src/test/java/org/teiid/dqp/service/buffer:3507-3666
Modified: branches/as7/runtime/src/test/java/org/teiid/transport/TestLogonImpl.java
===================================================================
--- branches/as7/runtime/src/test/java/org/teiid/transport/TestLogonImpl.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/runtime/src/test/java/org/teiid/transport/TestLogonImpl.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -34,7 +34,7 @@
import org.teiid.dqp.internal.process.DQPWorkContext;
import org.teiid.dqp.service.SessionService;
import org.teiid.net.TeiidURL;
-import org.teiid.net.TeiidURL.CONNECTION.AuthenticationType;
+import org.teiid.net.socket.AuthenticationType;
public class TestLogonImpl extends TestCase {
Modified: branches/as7/test-integration/common/pom.xml
===================================================================
--- branches/as7/test-integration/common/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/test-integration/common/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>test-integration-common</artifactId>
Property changes on: branches/as7/test-integration/common/src/test/java/org/teiid/cdk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/java/org/teiid/cdk:3535-3555*
/trunk/test-integration/common/src/test/java/org/teiid/cdk:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/java/org/teiid/cdk:3535-3555*
/trunk/test-integration/common/src/test/java/org/teiid/cdk:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/java/org/teiid/cdk/api
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/java/org/teiid/cdk/api:3535-3555
/trunk/test-integration/common/src/test/java/org/teiid/cdk/api:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/java/org/teiid/cdk/api:3535-3555
/trunk/test-integration/common/src/test/java/org/teiid/cdk/api:3507-3666
Modified: branches/as7/test-integration/common/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java
===================================================================
--- branches/as7/test-integration/common/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/test-integration/common/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -352,7 +352,7 @@
}
@Test public void testVisitIUnion1() throws Exception {
- String expected = "SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE 100 >= 200 AND 500 < 600 GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING 100 >= 200 AND 500 < 600 ORDER BY g1.e1, g1.e2 DESC, g1.e3, g1.e4 DESC UNION (SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE 100 >= 200 AND 500 < 600 GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING 100 >= 200 AND 500 < 600 ORDER BY g1.e1, g1.e2 DESC, g1.e3, g1.e4 DESC) ORDER BY e1, e2 DESC, e3, e4 DESC";//$NON-NLS-1$
+ String expected = "(SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE 100 >= 200 AND 500 < 600 GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING 100 >= 200 AND 500 < 600 ORDER BY g1.e1, g1.e2 DESC, g1.e3, g1.e4 DESC) UNION (SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE 100 >= 200 AND 500 < 600 GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING 100 >= 200 AND 500 < 600 ORDER BY g1.e1, g1.e2 DESC, g1.e3, g1.e4 DESC) ORDER BY e1, e2 DESC, e3, e4 DESC";//$NON-NLS-1$
assertEquals(expected, getString(TestSetQueryImpl.example()));
}
Property changes on: branches/as7/test-integration/common/src/test/java/org/teiid/dqp
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/java/org/teiid/dqp:3535-3555*
/trunk/test-integration/common/src/test/java/org/teiid/dqp:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/java/org/teiid/dqp:3535-3555*
/trunk/test-integration/common/src/test/java/org/teiid/dqp:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/java/org/teiid/dqp/internal
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/java/org/teiid/dqp/internal:3535-3555*
/trunk/test-integration/common/src/test/java/org/teiid/dqp/internal:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/java/org/teiid/dqp/internal:3535-3555*
/trunk/test-integration/common/src/test/java/org/teiid/dqp/internal:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/java/org/teiid/dqp/internal/process
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/java/org/teiid/dqp/internal/process:3535-3555
/trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/java/org/teiid/dqp/internal/process:3535-3555
/trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process:3507-3666
Modified: branches/as7/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
===================================================================
--- branches/as7/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -25,13 +25,18 @@
import static org.junit.Assert.*;
import java.io.IOException;
+import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.Statement;
import org.junit.Before;
import org.junit.Test;
+import org.teiid.client.util.ResultsFuture;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.jdbc.AbstractMMQueryTestCase;
import org.teiid.jdbc.FakeServer;
+import org.teiid.jdbc.StatementCallback;
+import org.teiid.jdbc.TeiidStatement;
import org.teiid.jdbc.TestMMDatabaseMetaData;
@@ -182,4 +187,28 @@
@Test(expected=SQLException.class) public void testLogMsg1() throws Exception {
execute("call logMsg(level=>'foo', context=>'org.teiid.foo', msg=>'hello world')"); //$NON-NLS-1$
}
+
+ @Test public void testAsynch() throws Exception {
+ Statement s = this.internalConnection.createStatement();
+ TeiidStatement ts = s.unwrap(TeiidStatement.class);
+ final ResultsFuture<Integer> result = new ResultsFuture<Integer>();
+ ts.submitExecute("select * from SYS.Schemas", new StatementCallback() {
+ int rowCount;
+ @Override
+ public void onRow(Statement s, ResultSet rs) {
+ rowCount++;
+ }
+
+ @Override
+ public void onException(Statement s, Exception e) {
+ result.getResultsReceiver().exceptionOccurred(e);
+ }
+
+ @Override
+ public void onComplete(Statement s) {
+ result.getResultsReceiver().receiveResults(rowCount);
+ }
+ });
+ assertEquals(4, result.get().intValue());
+ }
}
Property changes on: branches/as7/test-integration/common/src/test/java/org/teiid/transport
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/java/org/teiid/transport:3535-3555*
/trunk/test-integration/common/src/test/java/org/teiid/transport:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/java/org/teiid/transport:3535-3555*
/trunk/test-integration/common/src/test/java/org/teiid/transport:3507-3666
Modified: branches/as7/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java
===================================================================
--- branches/as7/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -26,6 +26,7 @@
import java.net.InetSocketAddress;
import java.sql.Connection;
+import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Properties;
@@ -90,6 +91,29 @@
TestMMDatabaseMetaData.compareResultSet(s.getResultSet());
}
+ @Test public void testLobStreaming() throws Exception {
+ Statement s = conn.createStatement();
+ assertTrue(s.execute("select xmlelement(name \"root\") from tables"));
+ s.getResultSet().next();
+ assertEquals("<root></root>", s.getResultSet().getString(1));
+ }
+
+ @Test public void testXmlTableScrollable() throws Exception {
+ Statement s = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
+ assertTrue(s.execute("select * from xmltable('/root/row' passing (select xmlelement(name \"root\", xmlagg(xmlelement(name \"row\", xmlforest(t.name)) order by t.name)) from tables as t, columns as t1) columns \"Name\" string) as x"));
+ ResultSet rs = s.getResultSet();
+ int count = 0;
+ while (rs.next()) {
+ count++;
+ }
+ assertEquals(7812, count);
+ rs.beforeFirst();
+ while (rs.next()) {
+ count--;
+ }
+ assertEquals(0, count);
+ }
+
/**
* Ensures if you start more than the maxActivePlans
* where all the plans take up more than output buffer limit
Property changes on: branches/as7/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java:3455-3509,3535-3555
/trunk/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java:3455-3509,3535-3555
/trunk/test-integration/common/src/test/java/org/teiid/transport/TestJDBCSocketTransport.java:3507-3666
Modified: branches/as7/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java
===================================================================
--- branches/as7/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java 2011-11-17 22:30:19 UTC (rev 3667)
@@ -181,6 +181,18 @@
TestMMDatabaseMetaData.compareResultSet(s.getResultSet());
}
+ @Test public void testTransactionalMultibatch() throws Exception {
+ Statement s = conn.createStatement();
+ conn.setAutoCommit(false);
+ assertTrue(s.execute("select tables.name from tables, columns limit 1025"));
+ int count = 0;
+ while (s.getResultSet().next()) {
+ count++;
+ }
+ assertEquals(1025, count);
+ conn.setAutoCommit(true);
+ }
+
@Test public void testMultibatchSelect() throws Exception {
Statement s = conn.createStatement();
assertTrue(s.execute("select * from tables, columns"));
@@ -221,6 +233,20 @@
String clob = rs.getString(1);
assertEquals(3000, clob.length());
}
+
+ @Test public void testMultiRowBuffering() throws Exception {
+ Statement s = conn.createStatement();
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < 11; i++) {
+ sb.append("select '' union all ");
+ }
+ sb.append("select ''");
+ assertTrue(s.execute(sb.toString()));
+ ResultSet rs = s.getResultSet();
+ assertTrue(rs.next());
+ String str = rs.getString(1);
+ assertEquals(0, str.length());
+ }
@Test public void testTransactionCycle() throws Exception {
//TODO: drill in to ensure that the underlying statement has been set to autocommit false
Property changes on: branches/as7/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java:3149-3217,3281-3325,3535-3555
/trunk/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java:3188-3450,3452-3597
+ /branches/7.4.x/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java:3149-3217,3281-3325,3535-3555
/trunk/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java:3188-3450,3452-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestJDBCSocketTransport
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestJDBCSocketTransport:3535-3555*
/trunk/test-integration/common/src/test/resources/TestJDBCSocketTransport:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestJDBCSocketTransport:3535-3555*
/trunk/test-integration/common/src/test/resources/TestJDBCSocketTransport:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestJDBCSocketTransport/testSelect.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestJDBCSocketTransport/testSelect.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestJDBCSocketTransport/testSelect.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestJDBCSocketTransport/testSelect.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestJDBCSocketTransport/testSelect.expected:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestODBCSocketTransport
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestODBCSocketTransport:3535-3555*
/trunk/test-integration/common/src/test/resources/TestODBCSocketTransport:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestODBCSocketTransport:3535-3555*
/trunk/test-integration/common/src/test/resources/TestODBCSocketTransport:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestODBCSocketTransport/testColumnMetadataWithAlias.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestODBCSocketTransport/testColumnMetadataWithAlias.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testColumnMetadataWithAlias.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestODBCSocketTransport/testColumnMetadataWithAlias.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testColumnMetadataWithAlias.expected:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestODBCSocketTransport/testPk.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestODBCSocketTransport/testPk.expected:3281-3325,3535-3555
/trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testPk.expected:3188-3450,3452-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestODBCSocketTransport/testPk.expected:3281-3325,3535-3555
/trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testPk.expected:3188-3450,3452-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestODBCSocketTransport/testPkPrepared.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestODBCSocketTransport/testPkPrepared.expected:3281-3325,3535-3555
/trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testPkPrepared.expected:3188-3450,3452-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestODBCSocketTransport/testPkPrepared.expected:3281-3325,3535-3555
/trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testPkPrepared.expected:3188-3450,3452-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestODBCSocketTransport/testSelect.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestODBCSocketTransport/testSelect.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testSelect.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestODBCSocketTransport/testSelect.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testSelect.expected:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel:3535-3555*
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel:3535-3555*
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testDataTypes.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testDataTypes.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testDataTypes.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testDataTypes.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testDataTypes.expected:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeyColumns.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeyColumns.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeyColumns.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeyColumns.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeyColumns.expected:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeys.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeys.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeys.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeys.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeys.expected:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedureParams.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedureParams.expected:3220-3275,3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedureParams.expected:3188-3450,3452-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedureParams.expected:3220-3275,3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedureParams.expected:3188-3450,3452-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedures.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedures.expected:3220-3275,3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedures.expected:3188-3450,3452-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedures.expected:3220-3275,3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedures.expected:3188-3450,3452-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testReferenceKeyColumns.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testReferenceKeyColumns.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testReferenceKeyColumns.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testReferenceKeyColumns.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testReferenceKeyColumns.expected:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testSchemas.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testSchemas.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testSchemas.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testSchemas.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testSchemas.expected:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testTableIsSystem.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testTableIsSystem.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTableIsSystem.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testTableIsSystem.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTableIsSystem.expected:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected:3507-3666
Property changes on: branches/as7/test-integration/common/src/test/resources/TestSystemVirtualModel/testVDBResources.expected
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testVDBResources.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testVDBResources.expected:3507-3597
+ /branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testVDBResources.expected:3535-3555
/trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testVDBResources.expected:3507-3666
Modified: branches/as7/test-integration/db/pom.xml
===================================================================
--- branches/as7/test-integration/db/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/test-integration/db/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Property changes on: branches/as7/test-integration/db/src/main/java/org/teiid/internal
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/db/src/main/java/org/teiid/internal:3535-3555*
/trunk/test-integration/db/src/main/java/org/teiid/internal:3507-3597
+ /branches/7.4.x/test-integration/db/src/main/java/org/teiid/internal:3535-3555*
/trunk/test-integration/db/src/main/java/org/teiid/internal:3507-3666
Property changes on: branches/as7/test-integration/db/src/main/java/org/teiid/internal/core
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/db/src/main/java/org/teiid/internal/core:3535-3555*
/trunk/test-integration/db/src/main/java/org/teiid/internal/core:3507-3597
+ /branches/7.4.x/test-integration/db/src/main/java/org/teiid/internal/core:3535-3555*
/trunk/test-integration/db/src/main/java/org/teiid/internal/core:3507-3666
Property changes on: branches/as7/test-integration/db/src/main/java/org/teiid/internal/core/xml
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/db/src/main/java/org/teiid/internal/core/xml:3535-3555
/trunk/test-integration/db/src/main/java/org/teiid/internal/core/xml:3507-3597
+ /branches/7.4.x/test-integration/db/src/main/java/org/teiid/internal/core/xml:3535-3555
/trunk/test-integration/db/src/main/java/org/teiid/internal/core/xml:3507-3666
Property changes on: branches/as7/test-integration/db/src/test/java/com
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/db/src/test/java/com:3535-3555*
/trunk/test-integration/db/src/test/java/com:3507-3597
+ /branches/7.4.x/test-integration/db/src/test/java/com:3535-3555*
/trunk/test-integration/db/src/test/java/com:3507-3666
Property changes on: branches/as7/test-integration/db/src/test/java/org/teiid/internal
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/db/src/test/java/org/teiid/internal:3535-3555*
/trunk/test-integration/db/src/test/java/org/teiid/internal:3507-3597
+ /branches/7.4.x/test-integration/db/src/test/java/org/teiid/internal:3535-3555*
/trunk/test-integration/db/src/test/java/org/teiid/internal:3507-3666
Property changes on: branches/as7/test-integration/db/src/test/java/org/teiid/internal/core
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/test-integration/db/src/test/java/org/teiid/internal/core:3535-3555*
/trunk/test-integration/db/src/test/java/org/teiid/internal/core:3507-3597
+ /branches/7.4.x/test-integration/db/src/test/java/org/teiid/internal/core:3535-3555*
/trunk/test-integration/db/src/test/java/org/teiid/internal/core:3507-3666
Modified: branches/as7/test-integration/pom.xml
===================================================================
--- branches/as7/test-integration/pom.xml 2011-11-17 16:00:27 UTC (rev 3666)
+++ branches/as7/test-integration/pom.xml 2011-11-17 22:30:19 UTC (rev 3667)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.6.0.Beta2-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
13 years, 1 month
teiid SVN: r3665 - branches.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-11-17 10:20:42 -0500 (Thu, 17 Nov 2011)
New Revision: 3665
Added:
branches/7.6.x/
Log:
adding 7.6 branch
13 years, 1 month
teiid SVN: r3664 - trunk/build/kits/jboss-container.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-11-17 07:09:19 -0500 (Thu, 17 Nov 2011)
New Revision: 3664
Modified:
trunk/build/kits/jboss-container/teiid-releasenotes.html
Log:
updating feature list
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-11-16 23:54:12 UTC (rev 3663)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-11-17 12:09:19 UTC (rev 3664)
@@ -30,16 +30,22 @@
<LI><B>File Enhancements</B> - the file translator can now optionally (via the ExceptionIfFileNotFound property) throw an exception if the path refers to a file that doesn't exist. The file resource adapter can be configured to map file names and can prevent parent path .. references. See the Admin Guide or the file-ds.xml template for more.
<LI><B>TEXTTABLE Enhancements</B> - TEXTTABLE can now parse fixed width files that do not use a row delimiter and can optionally produce fixed values that haven't been trimmed.
<LI><B>Temp table transactions</B> - Internal materialized views and temp table usage from a session and within procedures can take advantage of greater transaction support.
- <LI><B>Buffering Improvements</B> - Added the ability to inline memory based or small lobs and added tracking of the memory held by soft references. Also switched to a concurrent LFRU algorithm that significantly reduces writes and read misses with temporary tables. Added a memory buffer to better handle file storage.
- The memory buffer may be optional be configured as off-heap for better large memory performance - see the Admin Guide for more. Overhead is now tracked to help prevent memory errors when dealing with 10s of millions or more of batches/pages. Serialization and disk utilization were also improved.
+ <LI><B>Buffering Improvements</B>
+ <ul>
+ <li>Added the ability to inline memory based or small lobs.
+ <li>Added tracking of the memory held by soft references and general batch overhead. This ensures more efficient cache/memory utilization when dealing with 10s of millions or more of batches/pages.
+ <li>Also switched to a concurrent LFRU algorithm that significantly reduces writes and read misses with temporary tables.
+ <li>Added a memory buffer to better handle file storage as fixed blocks. The memory buffer may optionally be configured as off-heap for better large memory performance - see the Admin Guide for more.
+ <li>Serialization was improved for both internal batches and client/server batches.
+ </ul>
<LI><B>GSSAPI</B> - both the Teiid JDBC client/server and the ODBC pg backend can now support GSSAPI for single sign-on.
<LI><B>Server-side Query Timeouts</B> - default query timeouts can be configured at both the VDB (via the query-timeout VDB property) and entire server (via the teiid-jboss-beans.xml queryTimeout property).
- <LI><B>Native Queries</B> - added the ability to specify native query SQL for JDBC physical tables and stored procedures via extension metadata.
- <LI><B>View removal hint</B> - the NO_UNNEST hint now also applies to from clause views and subqueries. It will instruct the planner to not perform view flattening.
+ <LI><B>Native Queries</B> - added the ability to specify native query SQL for JDBC physical tables and stored procedures via extension metadata. See the Reference for more.
+ <LI><B>View removal hint</B> - the NO_UNNEST hint now also applies to FROM clause views and subqueries. It will instruct the planner to not perform view flattening.
<LI><B>Non-blocking statement execution</B> - Teiid JDBC extensions TeiidStatement and TeiidPreparedStatement can be used to submit queries against embedded connections with a callback to process results in a non-blocking manner.
<LI><B>NON_STRICT limit hint</B> - the NON_STRICT hint can be used with unordered limits to tell the optimizer to not inhibit push operations even if the results will not be consistent with the logical application of the limit.
- <LI><B>Source Hints</B> - user and transformation queries can specify a meta source hint, e.g. SELECT /*+ sh my-oracle:'leading' */ * FROM TBL. The hint information will be passed to the passed to the translator. The Oracle translator will by default treat the source hint as an Oracle hint.
- <LI><B>Hive Translator</B> - Hive translator has been added as technology preview.
+ <LI><B>Source Hints</B> - user and transformation queries can specify a meta source hint, e.g. SELECT /*+ sh my-oracle:'leading' */ * FROM TBL. The hint information will be passed to the translator. The Oracle translator will by default treat the source hint as an Oracle hint. See the Reference and Developers Guide for more.
+ <LI><B>Hive Translator</B> - Hive translator has been added as a technology preview.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
13 years, 1 month