teiid SVN: r2332 - trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-07-08 11:38:23 -0400 (Thu, 08 Jul 2010)
New Revision: 2332
Modified:
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-ds.xml
Log:
temporary fix for incorrect version, will be fixed fully by removing versions from rars
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-ds.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-ds.xml 2010-07-08 01:49:34 UTC (rev 2331)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-ws-weather/weather-ds.xml 2010-07-08 15:38:23 UTC (rev 2332)
@@ -4,7 +4,7 @@
<no-tx-connection-factory>
<jndi-name>WeatherDS</jndi-name>
- <rar-name>connector-ws-7.0.0-SNAPSHOT.rar</rar-name>
+ <rar-name>connector-ws-${project.version}.rar</rar-name>
<connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
<config-property name="EndPoint">http://www.weather.gov/forecasts/xml/sample_products/browser_interface/nd...</config-property>
14 years, 5 months
teiid SVN: r2331 - in trunk/connectors/translator-jdbc/src: main/java/org/teiid/translator/jdbc/sqlserver and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-07-07 21:49:34 -0400 (Wed, 07 Jul 2010)
New Revision: 2331
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/ConcatFunctionModifier.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java
Log:
TEIID-1147 fix for sybase concat
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/ConcatFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/ConcatFunctionModifier.java 2010-07-07 17:10:31 UTC (rev 2330)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/ConcatFunctionModifier.java 2010-07-08 01:49:34 UTC (rev 2331)
@@ -86,7 +86,7 @@
return Arrays.asList(langFactory.createSearchedCaseExpression(cases, function, TypeFacility.RUNTIME_TYPES.STRING));
}
- private boolean isNotNull(Expression expr) {
+ public static boolean isNotNull(Expression expr) {
if (expr instanceof Literal) {
Literal literal = (Literal)expr;
return literal.getValue() != null;
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2010-07-07 17:10:31 UTC (rev 2330)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2010-07-08 01:49:34 UTC (rev 2331)
@@ -188,5 +188,10 @@
public boolean supportsAggregatesEnhancedNumeric() {
return true;
}
-
+
+ @Override
+ public boolean nullPlusNonNullIsNull() {
+ return true;
+ }
+
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-07-07 17:10:31 UTC (rev 2330)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-07-08 01:49:34 UTC (rev 2331)
@@ -43,6 +43,7 @@
import org.teiid.translator.jdbc.FunctionModifier;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.ModFunctionModifier;
+import org.teiid.translator.jdbc.oracle.ConcatFunctionModifier;
@Translator(name="sybase")
@@ -59,8 +60,18 @@
public void start() throws TranslatorException {
super.start();
- registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier("%", getLanguageFactory())); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.CONCAT, new AliasModifier("+")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier("%", getLanguageFactory())); //$NON-NLS-1$
+ if (nullPlusNonNullIsNull()) {
+ registerFunctionModifier(SourceSystemFunctions.CONCAT, new AliasModifier("+")); //$NON-NLS-1$
+ } else {
+ registerFunctionModifier(SourceSystemFunctions.CONCAT, new ConcatFunctionModifier(getLanguageFactory()) {
+ @Override
+ public List<?> translate(Function function) {
+ function.setName("+"); //$NON-NLS-1$
+ return super.translate(function);
+ }
+ });
+ }
registerFunctionModifier(SourceSystemFunctions.LCASE, new AliasModifier("lower")); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.IFNULL, new AliasModifier("isnull")); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.UCASE, new AliasModifier("upper")); //$NON-NLS-1$
@@ -100,8 +111,18 @@
public List<?> translate(Function function) {
List<Object> result = new ArrayList<Object>();
result.add("cast("); //$NON-NLS-1$
+ boolean needsEnd = false;
+ if (!nullPlusNonNullIsNull() && !ConcatFunctionModifier.isNotNull(function.getParameters().get(0))) {
+ result.add("CASE WHEN "); //$NON-NLS-1$
+ result.add(function.getParameters().get(0));
+ result.add(" IS NOT NULL THEN "); //$NON-NLS-1$
+ needsEnd = true;
+ }
result.add("'1970-01-01 ' + "); //$NON-NLS-1$
result.addAll(convertTimeToString(function));
+ if (needsEnd) {
+ result.add(" END"); //$NON-NLS-1$
+ }
result.add(" AS datetime)"); //$NON-NLS-1$
return result;
}
@@ -302,4 +323,8 @@
public boolean supportsAggregatesEnhancedNumeric() {
return getDatabaseVersion().compareTo(FIFTEEN_0_2) >= 0;
}
+
+ public boolean nullPlusNonNullIsNull() {
+ return false;
+ }
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java 2010-07-07 17:10:31 UTC (rev 2330)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java 2010-07-08 01:49:34 UTC (rev 2331)
@@ -80,7 +80,7 @@
@Test
public void testConcatFunction() {
String input = "SELECT concat(part_name, 'b') FROM PARTS"; //$NON-NLS-1$
- String output = "SELECT (PARTS.PART_NAME + 'b') FROM PARTS"; //$NON-NLS-1$
+ String output = "SELECT CASE WHEN PARTS.PART_NAME IS NULL THEN NULL ELSE (PARTS.PART_NAME + 'b') END FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
@@ -146,6 +146,15 @@
output);
}
+ @Test public void testConvertTimestampTime() {
+ String input = "SELECT convert(TIMESTAMPVALUE, time) FROM BQT1.SMALLA"; //$NON-NLS-1$
+ String output = "SELECT cast(CASE WHEN SmallA.TimestampValue IS NOT NULL THEN '1970-01-01 ' + convert(varchar, SmallA.TimestampValue, 8) END AS datetime) FROM SmallA"; //$NON-NLS-1$
+
+ helpTestVisitor(getBQTVDB(),
+ input,
+ output);
+ }
+
@Test
public void testConvertFunctionChar() {
String input = "SELECT convert(PART_NAME, char) FROM PARTS"; //$NON-NLS-1$
14 years, 5 months
teiid SVN: r2330 - in trunk: build/assembly/adminshell and 3 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-07-07 13:10:31 -0400 (Wed, 07 Jul 2010)
New Revision: 2330
Modified:
trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
trunk/build/assembly/adminshell/adminshell-dist.xml
trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java
trunk/runtime/src/main/java/org/teiid/transport/ObjectEncoder.java
trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
Log:
TEIID-1145 fix for vdb truncation.
Modified: trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2010-07-07 01:34:45 UTC (rev 2329)
+++ trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2010-07-07 17:10:31 UTC (rev 2330)
@@ -26,7 +26,6 @@
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.InputStream;
import java.util.Collection;
import java.util.HashMap;
import java.util.Properties;
@@ -37,7 +36,6 @@
import org.teiid.adminapi.Admin;
import org.teiid.adminapi.AdminException;
import org.teiid.adminapi.AdminFactory;
-import org.teiid.adminapi.AdminProcessingException;
import org.teiid.adminapi.ProcessObject;
import org.teiid.adminapi.PropertyDefinition;
import org.teiid.adminapi.Request;
@@ -47,7 +45,6 @@
import org.teiid.adminapi.VDB;
import org.teiid.adminapi.WorkerPoolStatistics;
import org.teiid.adminshell.Help.Doc;
-import org.teiid.core.util.ObjectConverterUtil;
/**
@@ -302,13 +299,13 @@
return false;
}
- private static void writeFile(String deployedName, String fileName,
+ /*private static void writeFile(String deployedName, String fileName,
InputStream contents) throws IOException, AdminProcessingException {
if (contents == null) {
throw new AdminProcessingException(deployedName + " not found for exporting");//$NON-NLS-1$
}
ObjectConverterUtil.write(contents, fileName);
- }
+ }*/
@Doc(text = "Deploy a VDB from file")
public static void deployVDB(
Modified: trunk/build/assembly/adminshell/adminshell-dist.xml
===================================================================
--- trunk/build/assembly/adminshell/adminshell-dist.xml 2010-07-07 01:34:45 UTC (rev 2329)
+++ trunk/build/assembly/adminshell/adminshell-dist.xml 2010-07-07 17:10:31 UTC (rev 2330)
@@ -1,4 +1,3 @@
-<!--This script builds a JAR for the CDK -->
<assembly>
<id>adminshell-dist</id>
Modified: trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java
===================================================================
--- trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java 2010-07-07 01:34:45 UTC (rev 2329)
+++ trunk/client/src/main/java/org/teiid/netty/handler/codec/serialization/ObjectEncoderOutputStream.java 2010-07-07 17:10:31 UTC (rev 2330)
@@ -63,7 +63,7 @@
out.writeInt(baos.getCount()); //includes the lob references
out.write(baos.getBuffer(), 0, baos.getCount());
- byte[] chunk = new byte[1 << 16];
+ byte[] chunk = new byte[(1 << 16) - 1];
for (InputStream is : oout.getStreams()) {
while (true) {
int bytes = is.read(chunk);
Modified: trunk/runtime/src/main/java/org/teiid/transport/ObjectEncoder.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/ObjectEncoder.java 2010-07-07 01:34:45 UTC (rev 2329)
+++ trunk/runtime/src/main/java/org/teiid/transport/ObjectEncoder.java 2010-07-07 17:10:31 UTC (rev 2330)
@@ -63,7 +63,7 @@
@ChannelPipelineCoverage("all")
public class ObjectEncoder implements ChannelDownstreamHandler {
private static final byte[] LENGTH_PLACEHOLDER = new byte[4];
- private static final int CHUNK_SIZE = 1 << 16;
+ private static final int CHUNK_SIZE = (1 << 16) - 1;
private final int estimatedLength;
Modified: trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2010-07-07 01:34:45 UTC (rev 2329)
+++ trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2010-07-07 17:10:31 UTC (rev 2330)
@@ -128,6 +128,7 @@
FakeService fs = conn.getService(FakeService.class);
assertEquals(150, fs.lobMethod(new ByteArrayInputStream(new byte[100]), new StringReader(new String(new char[50]))));
assertEquals(0, fs.lobMethod(new ByteArrayInputStream(new byte[0]), new StringReader(new String(new char[0]))));
+ assertEquals((1 << 17) + 50, fs.lobMethod(new ByteArrayInputStream(new byte[1 << 17]), new StringReader(new String(new char[50]))));
}
@Test public void testServerRemoteStreaming() throws Exception {
14 years, 5 months
teiid SVN: r2329 - in trunk: engine/src/main/java/org/teiid/query/processor/relational and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-07-06 21:34:45 -0400 (Tue, 06 Jul 2010)
New Revision: 2329
Modified:
trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentProcedureExecutionNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/SelectNode.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/IfInstruction.java
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestSelectNode.java
Log:
TEIID-1144 fix for blockedexception handling that causes problems with timeslicing. also updating the ping logic.
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-07-06 18:36:27 UTC (rev 2328)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-07-07 01:34:45 UTC (rev 2329)
@@ -107,13 +107,16 @@
@Override
public void run() {
- if (ping == null || !ping.isDone()) {
+ if (ping == null) {
ping = isOpen();
}
- if (ping != null && ping.isDone()) {
+ if (ping != null) {
try {
- ping.get();
+ ping.get(1, TimeUnit.SECONDS);
+ ping = null;
return;
+ } catch (TimeoutException e) {
+ return;
} catch (Throwable e) {
handlePingError(e);
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentProcedureExecutionNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentProcedureExecutionNode.java 2010-07-06 18:36:27 UTC (rev 2328)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentProcedureExecutionNode.java 2010-07-07 01:34:45 UTC (rev 2329)
@@ -23,7 +23,6 @@
package org.teiid.query.processor.relational;
import java.util.List;
-import java.util.Map;
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidComponentException;
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java 2010-07-06 18:36:27 UTC (rev 2328)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java 2010-07-07 01:34:45 UTC (rev 2329)
@@ -61,7 +61,7 @@
// Saved state when blocked on evaluating a row - must be reset
private TupleBatch currentBatch;
- private int currentRow;
+ private int currentRow = 1;
public ProjectNode(int nodeID) {
super(nodeID);
@@ -71,7 +71,7 @@
super.reset();
currentBatch = null;
- currentRow = 0;
+ currentRow = 1;
}
/**
@@ -147,70 +147,50 @@
public TupleBatch nextBatchDirect()
throws BlockedException, TeiidComponentException, TeiidProcessingException {
-
- // currentBatch and currentRow hold temporary state saved in the case
- // of a BlockedException while evaluating an expression. If that has
- // not occurred, currentBatch will be null and currentRow will be < 0.
- // blockedOnPrepare indicates that the BlockedException happened
- // during the call to prepareToProcessTuple
-
- TupleBatch batch = this.currentBatch;
- int beginRow = this.currentRow;
-
- if(batch == null) {
+
+ if(currentBatch == null) {
// There was no saved batch, so get a new one
//in the case of select with no from, should return only
//one batch with one row
if(this.getChildren()[0] == null){
- batch = new TupleBatch(0, new List[]{Arrays.asList(new Object[] {})});
- batch.setTerminationFlag(true);
+ currentBatch = new TupleBatch(1, new List[]{Arrays.asList(new Object[] {})});
+ currentBatch.setTerminationFlag(true);
}else{
- batch = this.getChildren()[0].nextBatch();
+ currentBatch = this.getChildren()[0].nextBatch();
}
// Check for no project needed and pass through
- if(batch.getRowCount() == 0 || !needsProject) {
- // Just pass the batch through without processing
- return batch;
+ if(!needsProject) {
+ TupleBatch result = currentBatch;
+ currentBatch = null;
+ return result;
}
-
- // Set the beginRow based on beginning row of the batch
- beginRow = batch.getBeginRow();
-
- } else {
- // There was a saved batch, but we grabbed the state so it can now be removed
- this.currentBatch = null;
- this.currentRow = 0;
}
- for(int row = beginRow; row <= batch.getEndRow(); row++) {
- List tuple = batch.getTuple(row);
+ while (currentRow <= currentBatch.getEndRow() && !isBatchFull()) {
+ List tuple = currentBatch.getTuple(currentRow);
List projectedTuple = new ArrayList(selectSymbols.size());
// Walk through symbols
- try {
- for(int i=0; i<selectSymbols.size(); i++) {
- SelectSymbol symbol = (SelectSymbol) selectSymbols.get(i);
- updateTuple(symbol, tuple, projectedTuple);
- }
- } catch(BlockedException e) {
- // Expression blocked, so save state and rethrow
- this.currentBatch = batch;
- this.currentRow = row;
- throw e;
- }
+ for(int i=0; i<selectSymbols.size(); i++) {
+ SelectSymbol symbol = (SelectSymbol) selectSymbols.get(i);
+ updateTuple(symbol, tuple, projectedTuple);
+ }
// Add to batch
addBatchRow(projectedTuple);
+ currentRow++;
}
-
- // Check for termination tuple
- if(batch.getTerminationFlag()) {
- terminateBatches();
+
+ if (currentRow > currentBatch.getEndRow()) {
+ if(currentBatch.getTerminationFlag()) {
+ terminateBatches();
+ }
+ currentBatch = null;
}
-
- return pullBatch();
+
+ return pullBatch();
}
private void updateTuple(SelectSymbol symbol, List values, List tuple)
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2010-07-06 18:36:27 UTC (rev 2328)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2010-07-07 01:34:45 UTC (rev 2329)
@@ -41,6 +41,7 @@
import org.teiid.logging.MessageLevel;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.processor.ProcessorDataManager;
+import org.teiid.query.processor.QueryProcessor;
import org.teiid.query.processor.BatchCollector.BatchProducer;
import org.teiid.query.sql.symbol.AliasSymbol;
import org.teiid.query.sql.symbol.SingleElementSymbol;
@@ -287,6 +288,11 @@
this.nodeStatistics.collectCumulativeNodeStats(null, RelationalNodeStatistics.BLOCKEDEXCEPTION_STOP);
}
throw e;
+ } catch (QueryProcessor.ExpiredTimeSliceException e) {
+ if(recordStats && this.context.getCollectNodeStatistics()) {
+ this.nodeStatistics.stopBatchTimer();
+ }
+ throw e;
} catch (TeiidComponentException e) {
// stop timer for this batch (MetaMatrixComponentException)
if(recordStats && this.context.getCollectNodeStatistics()) {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/SelectNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/SelectNode.java 2010-07-06 18:36:27 UTC (rev 2328)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/SelectNode.java 2010-07-07 01:34:45 UTC (rev 2329)
@@ -49,10 +49,8 @@
private int[] projectionIndexes;
// State if blocked on evaluating a criteria
- private boolean blockedOnCriteria = false;
- private boolean blockedOnPrepare = false;
- private TupleBatch blockedBatch = null;
- private int blockedRow = 0;
+ private TupleBatch currentBatch;
+ private int currentRow = 1;
public SelectNode(int nodeID) {
super(nodeID);
@@ -61,10 +59,8 @@
public void reset() {
super.reset();
- blockedOnCriteria = false;
- blockedOnPrepare = false;
- blockedBatch = null;
- blockedRow = 0;
+ currentBatch = null;
+ currentRow = 1;
}
public void setCriteria(Criteria criteria) {
@@ -91,45 +87,28 @@
*/
public TupleBatch nextBatchDirect()
throws BlockedException, TeiidComponentException, TeiidProcessingException {
-
- TupleBatch batch = blockedBatch;
- if(! blockedOnCriteria && ! blockedOnPrepare) {
- batch = this.getChildren()[0].nextBatch();
+
+ if(currentBatch == null) {
+ currentBatch = this.getChildren()[0].nextBatch();
}
-
- int row = blockedRow;
- if(! blockedOnCriteria && ! blockedOnPrepare) {
- row = batch.getBeginRow();
- } else {
- // Reset blocked state
- blockedOnCriteria = false;
- blockedOnPrepare = false;
- blockedBatch = null;
- blockedRow = 0;
- }
-
- for(; row <= batch.getEndRow(); row++) {
- List tuple = batch.getTuple(row);
-
- // Evaluate criteria with tuple
- try {
- if(getEvaluator(this.elementMap).evaluate(this.criteria, tuple)) {
- addBatchRow(projectTuple(this.projectionIndexes, tuple));
- }
- } catch(BlockedException e) {
- // Save state and rethrow
- blockedOnCriteria = true;
- blockedBatch = batch;
- blockedRow = row;
- throw e;
- }
- }
- if(batch.getTerminationFlag()) {
- terminateBatches();
- }
+ while (currentRow <= currentBatch.getEndRow() && !isBatchFull()) {
+ List tuple = currentBatch.getTuple(currentRow);
- return pullBatch();
+ if(getEvaluator(this.elementMap).evaluate(this.criteria, tuple)) {
+ addBatchRow(projectTuple(this.projectionIndexes, tuple));
+ }
+ currentRow++;
+ }
+
+ if (currentRow > currentBatch.getEndRow()) {
+ if(currentBatch.getTerminationFlag()) {
+ terminateBatches();
+ }
+ currentBatch = null;
+ }
+
+ return pullBatch();
}
protected void getNodeString(StringBuffer str) {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/IfInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/IfInstruction.java 2010-07-06 18:36:27 UTC (rev 2328)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/IfInstruction.java 2010-07-07 01:34:45 UTC (rev 2329)
@@ -54,8 +54,7 @@
private DefaultCondition defaultCondition;
// State if condition evaluation blocked
- private boolean blockedOnCondition = false;
- private int blockedConditionIndex = 0;
+ private int conditionIndex = 0;
/**
* Constructor for IfInstruction.
@@ -148,37 +147,22 @@
thens.add(defaultCondition);
}
- int conditionIndex = this.blockedConditionIndex;
- if(blockedOnCondition) {
- // Remove state - we have recovered and will reset if necessary
- this.blockedOnCondition = false;
- this.blockedConditionIndex = 0;
- } else{
- conditionIndex = 0;
- }
-
Condition condition = null;
boolean foundTrueCondition = false;
for(; conditionIndex < thens.size(); conditionIndex++){
condition = (Condition)thens.get(conditionIndex);
- // evaluate may block if criteria evaluation blocks
- try {
- if(condition.evaluate(env, context)) {
- foundTrueCondition = true;
- //break from the loop; only the first "then" Program
- //whose criteria evaluates to true will be executed
- break;
- }
- } catch(BlockedException e) {
- // Save state and rethrow
- this.blockedOnCondition = true;
- this.blockedConditionIndex = conditionIndex;
- throw e;
+ // evaluate may block if criteria evaluation blocks
+ if(condition.evaluate(env, context)) {
+ foundTrueCondition = true;
+ //break from the loop; only the first "then" Program
+ //whose criteria evaluates to true will be executed
+ break;
}
}
+ conditionIndex = 0;
// This IF instruction should be processed exactly once, so the
// program containing the IF instruction needs to have it's
Modified: trunk/engine/src/test/java/org/teiid/query/processor/relational/TestSelectNode.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/relational/TestSelectNode.java 2010-07-06 18:36:27 UTC (rev 2328)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestSelectNode.java 2010-07-07 01:34:45 UTC (rev 2329)
@@ -22,12 +22,15 @@
package org.teiid.query.processor.relational;
+import static org.junit.Assert.*;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.junit.Test;
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.BufferManager;
import org.teiid.common.buffer.BufferManagerFactory;
@@ -35,13 +38,13 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.query.eval.Evaluator;
import org.teiid.query.function.FunctionDescriptor;
import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.processor.BatchIterator;
import org.teiid.query.processor.FakeDataManager;
import org.teiid.query.processor.ProcessorDataManager;
-import org.teiid.query.processor.relational.RelationalNode;
-import org.teiid.query.processor.relational.SelectNode;
+import org.teiid.query.processor.QueryProcessor;
import org.teiid.query.sql.lang.CompareCriteria;
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.symbol.Constant;
@@ -50,34 +53,28 @@
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.util.CommandContext;
-import junit.framework.TestCase;
+public class TestSelectNode {
-
-/**
- */
-public class TestSelectNode extends TestCase {
-
- /**
- * Constructor for TestSelectNode.
- * @param arg0
- */
- public TestSelectNode(String arg0) {
- super(arg0);
- }
-
public void helpTestSelect(List elements, Criteria criteria, List[] data, List childElements, ProcessorDataManager dataMgr, List[] expected) throws TeiidComponentException, TeiidProcessingException {
helpTestSelect(elements, criteria, childElements, dataMgr, expected, new FakeRelationalNode(2, data));
}
public void helpTestSelect(List elements, Criteria criteria, List childElements, ProcessorDataManager dataMgr, List[] expected, RelationalNode child) throws TeiidComponentException, TeiidProcessingException {
- BufferManager mgr = BufferManagerFactory.getStandaloneBufferManager();
+ SelectNode selectNode = new SelectNode(1);
+ helpTestSelect(elements, criteria, childElements, dataMgr, expected, child, selectNode);
+ }
+
+ private void helpTestSelect(List elements, Criteria criteria, List childElements,
+ ProcessorDataManager dataMgr, List[] expected,
+ RelationalNode child,
+ SelectNode selectNode) throws TeiidComponentException,
+ TeiidProcessingException {
+ BufferManager mgr = BufferManagerFactory.getStandaloneBufferManager();
CommandContext context = new CommandContext("pid", "test", null, null, 1); //$NON-NLS-1$ //$NON-NLS-2$
child.setElements(childElements);
- child.initialize(context, mgr, dataMgr);
-
- SelectNode selectNode = new SelectNode(1);
- selectNode.setCriteria(criteria);
+ child.initialize(context, mgr, dataMgr);
+ selectNode.setCriteria(criteria);
selectNode.setElements(elements);
selectNode.addChild(child);
selectNode.initialize(context, mgr, dataMgr);
@@ -93,16 +90,18 @@
break;
} catch (BlockedException e) {
continue;
+ } catch (QueryProcessor.ExpiredTimeSliceException e) {
+ continue;
}
}
}
assertFalse(iterator.hasNext());
- }
+ }
/**
* Ensures that a final empty batch is reindexed so that the batch iterator works correctly
*/
- public void testEmptyBatchIndexing() throws TeiidComponentException, TeiidProcessingException {
+ @Test public void testEmptyBatchIndexing() throws TeiidComponentException, TeiidProcessingException {
ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);
@@ -138,10 +137,41 @@
helpTestSelect(elements, crit, childElements, null, new List[0], child);
}
- public void testNoRows() throws TeiidComponentException, TeiidProcessingException {
+ @Test public void testTimeslicing() throws TeiidComponentException, TeiidProcessingException {
ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);
+ List elements = new ArrayList();
+ elements.add(es1);
+
+ CompareCriteria crit = new CompareCriteria(es1, CompareCriteria.EQ, new Constant(new Integer(1)));
+
+ List[] data = new List[] {
+ Arrays.asList(1),
+ Arrays.asList(1),
+ Arrays.asList(1)
+ };
+
+ List childElements = new ArrayList();
+ childElements.add(es1);
+
+ helpTestSelect(elements, crit, childElements, null, data, new FakeRelationalNode(2, data), new SelectNode(3) {
+ int i = 0;
+
+ @Override
+ protected Evaluator getEvaluator(Map elementMap) {
+ if (i++ == 1) {
+ throw new QueryProcessor.ExpiredTimeSliceException();
+ }
+ return super.getEvaluator(elementMap);
+ }
+ });
+ }
+
+ @Test public void testNoRows() throws TeiidComponentException, TeiidProcessingException {
+ ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
+ es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);
+
ElementSymbol es2 = new ElementSymbol("e2"); //$NON-NLS-1$
es2.setType(DataTypeManager.DefaultDataClasses.STRING);
@@ -160,7 +190,7 @@
}
- public void testSimpleSelect() throws TeiidComponentException, TeiidProcessingException {
+ @Test public void testSimpleSelect() throws TeiidComponentException, TeiidProcessingException {
ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);
@@ -195,7 +225,7 @@
}
- public void testSelectWithLookup() throws TeiidComponentException, TeiidProcessingException {
+ @Test public void testSelectWithLookup() throws TeiidComponentException, TeiidProcessingException {
ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);
14 years, 5 months
teiid SVN: r2328 - in trunk: test-integration/common/src/test/resources/TestMMDatabaseMetaData and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-07-06 14:36:27 -0400 (Tue, 06 Jul 2010)
New Revision: 2328
Modified:
trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetCatalogs.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testCatalogs.expected
Log:
TEIID-1141 adding support for getCatalogs
Modified: trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
+++ trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java 2010-07-06 18:36:27 UTC (rev 2328)
@@ -433,7 +433,8 @@
public ResultSet getCatalogs() throws SQLException {
// list containing records/rows in the ResultSet
- List records = new ArrayList (0);
+ List<List<String>> records = new ArrayList<List<String>> (1);
+ records.add(Arrays.asList(this.driverConnection.getCatalog()));
/***********************************************************************
* Hardcoding JDBC column names for the columns returned in results object
Modified: trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetCatalogs.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetCatalogs.expected 2010-07-01 14:26:20 UTC (rev 2327)
+++ trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetCatalogs.expected 2010-07-06 18:36:27 UTC (rev 2328)
@@ -1,5 +1,6 @@
string
TABLE_CAT
-Row Count : 0
+QT_Ora9DS
+Row Count : 1
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
TABLE_CAT 12 QT_Ora9DS java.lang.String <null> string <null> <null> 4000 4000 0 false false false false 1 true false false false
Modified: trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testCatalogs.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testCatalogs.expected 2010-07-01 14:26:20 UTC (rev 2327)
+++ trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testCatalogs.expected 2010-07-06 18:36:27 UTC (rev 2328)
@@ -1,5 +1,6 @@
string
TABLE_CAT
-Row Count : 0
+PartsSupplier
+Row Count : 1
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
TABLE_CAT 12 PartsSupplier java.lang.String <null> string <null> <null> 4000 4000 0 false false false false 1 true false false false
14 years, 5 months
teiid SVN: r2327 - in trunk: client/src/main/java/org/teiid/client/util and 11 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-07-01 10:26:20 -0400 (Thu, 01 Jul 2010)
New Revision: 2327
Modified:
trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java
trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java
trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java
trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.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/WarningUtil.java
trunk/client/src/main/java/org/teiid/jdbc/WrapperImpl.java
trunk/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java
trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java
trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java
trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java
trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java
trunk/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java
trunk/client/src/test/java/org/teiid/jdbc/TestXAConnection.java
trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java
trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java
trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java
trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java
trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java
trunk/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java
trunk/common-core/src/main/java/org/teiid/core/util/SqlUtil.java
trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java
trunk/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java
trunk/common-core/src/test/java/org/teiid/core/types/basic/TestStringToXmlTransform.java
trunk/common-core/src/test/java/org/teiid/core/util/UnitTestUtil.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
Log:
TEIID-177 removing comment based approach to backwards compatibility and changing the isvalid check to use a ping
Modified: trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/adminapi/AdminFactory.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -90,9 +90,7 @@
return target;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
if (method.getName().equals("close")) { //$NON-NLS-1$
Modified: trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java
===================================================================
--- trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/client/util/ExceptionHolder.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -59,9 +59,7 @@
this.nested = nested;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
List<String> classNames = ExternalizeUtil.readList(in, String.class);
String message = (String)in.readObject();
@@ -93,9 +91,7 @@
}
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void writeExternal(ObjectOutput out) throws IOException {
List<String> classNames = new ArrayList<String>();
Class<?> clazz = exception.getClass();
Modified: trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/CallableStatementImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -33,16 +33,10 @@
import java.sql.Date;
import java.sql.Ref;
import java.sql.SQLException;
-//## JDBC4.0-begin ##
import java.sql.SQLXML;
import java.sql.NClob;
import java.sql.RowId;
-//## JDBC4.0-end ##
-/*## JDBC3.0-JDK1.5-begin ##
-import com.metamatrix.core.jdbc.SQLXML;
-## JDBC3.0-JDK1.5-end ##*/
-
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
@@ -468,17 +462,13 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public NClob getNClob(int parameterIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
- //## JDBC4.0-begin ##
public NClob getNClob(String parameterName) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public String getNString(int parameterIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -508,17 +498,13 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public RowId getRowId(int parameterIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
- //## JDBC4.0-begin ##
public RowId getRowId(String parameterName) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public SQLXML getSQLXML(String parameterName) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -687,11 +673,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void setNClob(String parameterName, NClob value) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void setNClob(String parameterName, Reader reader)
throws SQLException {
@@ -731,11 +715,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void setRowId(String parameterName, RowId x) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void setSQLXML(String parameterName, SQLXML xmlObject)
throws SQLException {
Modified: trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/ConnectionImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -32,15 +32,10 @@
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLWarning;
-//## JDBC4.0-begin ##
import java.sql.SQLClientInfoException;
import java.sql.NClob;
import java.sql.SQLXML;
-//## JDBC4.0-end ##
-/*## JDBC3.0-JDK1.5-begin ##
-import com.metamatrix.core.jdbc.SQLXML;
-## JDBC3.0-JDK1.5-end ##*/
import java.sql.Savepoint;
import java.sql.Statement;
import java.sql.Struct;
@@ -52,6 +47,9 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -840,22 +838,20 @@
return transactionXid;
}
- public boolean isValid(int timeout) throws SQLException {
- Statement statement = null;
- try {
- statement = createStatement();
- statement.setQueryTimeout(timeout);
- statement.execute("select 1"); //$NON-NLS-1$
- return true;
- } catch (SQLException e) {
- return false;
- } finally {
- if (statement != null) {
- try {
- statement.close();
- } catch (SQLException e) {
- }
- }
+ public boolean isValid(int timeout) throws SQLException {
+ ResultsFuture<?> future = this.getServerConnection().isOpen();
+ if (future == null) {
+ return false;
+ }
+ try {
+ future.get(timeout, TimeUnit.SECONDS);
+ return true;
+ } catch (InterruptedException e) {
+ return false;
+ } catch (ExecutionException e) {
+ return false;
+ } catch (TimeoutException e) {
+ return false;
}
}
@@ -891,7 +887,6 @@
return this.serverConn.isSameInstance(conn.serverConn);
}
- //## JDBC4.0-begin ##
public void setClientInfo(Properties properties)
throws SQLClientInfoException {
}
@@ -899,7 +894,6 @@
public void setClientInfo(String name, String value)
throws SQLClientInfoException {
}
- //## JDBC4.0-end ##
public Properties getClientInfo() throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -922,11 +916,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public NClob createNClob() throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public SQLXML createSQLXML() throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
Modified: trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/DataTypeTransformer.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -29,12 +29,7 @@
import java.sql.Clob;
import java.sql.Date;
import java.sql.SQLException;
-//## JDBC4.0-begin ##
import java.sql.SQLXML;
-//## JDBC4.0-end ##
-/*## JDBC3.0-JDK1.5-begin ##
-import com.metamatrix.core.jdbc.SQLXML;
-## JDBC3.0-JDK1.5-end ##*/
import java.sql.Time;
import java.sql.Timestamp;
Modified: trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/DatabaseMetaDataImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -2382,11 +2382,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public RowIdLifetime getRowIdLifetime() throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public ResultSet getSchemas(String catalog, String schemaPattern)
throws SQLException {
Modified: trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -190,9 +190,7 @@
throw new TeiidSQLException(msg);
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public boolean execute() throws SQLException {
executeSql(new String[] {this.prepareSql}, false, ResultsMode.EITHER);
return hasResultSet();
@@ -211,17 +209,13 @@
return this.updateCounts;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ResultSet executeQuery() throws SQLException {
executeSql(new String[] {this.prepareSql}, false, ResultsMode.RESULTSET);
return resultSet;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public int executeUpdate() throws SQLException {
executeSql(new String[] {this.prepareSql}, false, ResultsMode.UPDATECOUNT);
return this.updateCounts[0];
@@ -750,11 +744,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void setNClob(int parameterIndex, NClob value) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void setNClob(int parameterIndex, Reader reader) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -774,11 +766,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void setRowId(int parameterIndex, RowId x) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void setUnicodeStream(int parameterIndex, InputStream x, int length)
throws SQLException {
Modified: trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/ResultSetImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -406,9 +406,7 @@
checkClosed(); // check to see if the ResultSet is closed
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void clearWarnings() throws SQLException {
// do nothing
checkClosed(); // check to see if the ResultSet is closed
@@ -1263,7 +1261,6 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public NClob getNClob(int columnIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
@@ -1271,7 +1268,6 @@
public NClob getNClob(String columnLabel) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public String getNString(int columnIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -1299,17 +1295,13 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public RowId getRowId(int columnIndex) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
- //## JDBC4.0-begin ##
public RowId getRowId(String columnLabel) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public SQLXML getSQLXML(String columnLabel) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
@@ -1625,11 +1617,9 @@
}
- //## JDBC4.0-begin ##
public void updateNClob(int columnIndex, NClob clob) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void updateNClob(int columnIndex, Reader reader, long length)
throws SQLException {
@@ -1640,11 +1630,9 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void updateNClob(String columnLabel, NClob clob) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void updateNClob(String columnLabel, Reader reader, long length)
throws SQLException {
@@ -1704,17 +1692,13 @@
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-begin ##
public void updateRowId(int columnIndex, RowId x) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
- //## JDBC4.0-begin ##
public void updateRowId(String columnLabel, RowId x) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
}
- //## JDBC4.0-end ##
public void updateShort(int columnIndex, short x) throws SQLException {
throw SqlUtil.createFeatureNotSupportedException();
Modified: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -22,8 +22,6 @@
package org.teiid.jdbc;
-import java.io.IOException;
-import java.io.Reader;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.ResultSet;
@@ -56,9 +54,8 @@
import org.teiid.client.plan.Annotation;
import org.teiid.client.plan.PlanNode;
import org.teiid.core.TeiidComponentException;
-import org.teiid.core.TeiidProcessingException;
import org.teiid.core.TeiidException;
-import org.teiid.core.util.ObjectConverterUtil;
+import org.teiid.core.TeiidProcessingException;
import org.teiid.core.util.SqlUtil;
@@ -299,17 +296,13 @@
}
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public boolean execute(String sql) throws SQLException {
executeSql(new String[] {sql}, false, ResultsMode.EITHER);
return hasResultSet();
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public int[] executeBatch() throws SQLException {
if (batchedUpdates == null || batchedUpdates.isEmpty()) {
return new int[0];
@@ -319,17 +312,13 @@
return updateCounts;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ResultSet executeQuery(String sql) throws SQLException {
executeSql(new String[] {sql}, false, ResultsMode.RESULTSET);
return resultSet;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public int executeUpdate(String sql) throws SQLException {
String[] commands = new String[] {sql};
executeSql(commands, false, ResultsMode.UPDATECOUNT);
Modified: trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/WarningUtil.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -52,13 +52,7 @@
return warning;
}
}
- //## JDBC4.0-begin ##
return new SQLWarning(ex);
- //## JDBC4.0-end ##
- /*## JDBC3.0-JDK1.5-begin ##
- return new SQLWarning(ex.getMessage());
- ## JDBC3.0-JDK1.5-end ##*/
-
}
/**
Modified: trunk/client/src/main/java/org/teiid/jdbc/WrapperImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/WrapperImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/WrapperImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -23,17 +23,12 @@
package org.teiid.jdbc;
import java.sql.SQLException;
-//## JDBC4.0-begin ##
import java.sql.Wrapper;
import org.teiid.core.util.ArgCheck;
-public class WrapperImpl
- //## JDBC4.0-begin ##
- implements Wrapper
- //## JDBC4.0-end ##
- {
+public class WrapperImpl implements Wrapper {
public boolean isWrapperFor(Class<?> iface) throws SQLException {
ArgCheck.isNotNull(iface);
Modified: trunk/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/jdbc/XAConnectionImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -33,9 +33,7 @@
import javax.sql.ConnectionEvent;
import javax.sql.ConnectionEventListener;
-//## JDBC4.0-begin ##
import javax.sql.StatementEventListener;
-//## JDBC4.0-end ##
import javax.sql.XAConnection;
import javax.transaction.xa.XAResource;
@@ -190,11 +188,9 @@
}
}
- //## JDBC4.0-begin ##
public void addStatementEventListener(StatementEventListener arg0) {
}
public void removeStatementEventListener(StatementEventListener arg0) {
}
- //## JDBC4.0-end ##
}
Modified: trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/net/socket/OioOjbectChannelFactory.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -71,9 +71,7 @@
inputStream = new ObjectDecoderInputStream(new DataInputStream(bis), cl, MAX_OBJECT_SIZE);
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void close() {
log.finer("closing socket"); //$NON-NLS-1$
try {
@@ -98,23 +96,17 @@
}
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public SocketAddress getRemoteAddress() {
return socket.getRemoteSocketAddress();
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public boolean isOpen() {
return !socket.isClosed();
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Object read() throws IOException, ClassNotFoundException {
log.finer("reading message from socket"); //$NON-NLS-1$
synchronized (readLock) {
@@ -129,9 +121,7 @@
}
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public synchronized Future<?> write(Object msg) {
log.finer("writing message to socket"); //$NON-NLS-1$
ResultsFuture<Void> result = new ResultsFuture<Void>();
@@ -160,9 +150,7 @@
PropertiesUtils.setBeanProperties(this, props, "org.teiid.sockets"); //$NON-NLS-1$
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ObjectChannel createObjectChannel(SocketAddress address, boolean ssl) throws IOException,
CommunicationException {
final Socket socket;
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -33,6 +33,7 @@
import java.net.SocketAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Properties;
import java.util.Timer;
@@ -181,7 +182,8 @@
// Log on to server
try {
this.logonResult = logon.logon(connProps);
- if (this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance).size() > 1) {
+ List<HostInfo> knownHosts = this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance);
+ if (knownHosts.size() > 1 && !new HashSet<HostInfo>(knownHosts).equals(new HashSet<HostInfo>(this.serverDiscovery.getKnownHosts(logonResult, null)))) {
//if there are multiple instances, allow for load-balancing
closeServerInstance();
}
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerConnectionFactory.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -74,9 +74,7 @@
this.key = key;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Object invoke(Object arg0, Method arg1, Object[] arg2)
throws Throwable {
if (arg1.getName().equals("shutdown")) { //$NON-NLS-1$
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketServerInstanceImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -105,16 +105,12 @@
}
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public HostInfo getHostInfo() {
return this.hostInfo;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public SocketAddress getRemoteAddress() {
return this.socketChannel.getRemoteAddress();
}
@@ -286,9 +282,7 @@
}
@SuppressWarnings("unchecked")
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public <T> T getService(Class<T> iface) {
return (T)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new RemoteInvocationHandler(iface));
}
@@ -303,9 +297,7 @@
this.secure = ILogon.class.isAssignableFrom(targetClass);
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
Throwable t = null;
Modified: trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/net/socket/SocketUtil.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -116,12 +116,7 @@
// One way SSL with custom properties defined
result = getClientSSLContext(null, null, truststore, truststorePassword, keystoreAlgorithm, keystoreType, keystoreProtocol);
} else {
- //## JDBC4.0-begin ##
result = SSLContext.getDefault();
- //## JDBC4.0-end ##
- /*## JDBC3.0-JDK1.5-begin ##
- result = SSLContext.getInstance("Default");
- ## JDBC3.0-JDK1.5-end ##*/
}
return new SSLSocketFactory(result, anon);
}
Modified: trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/main/java/org/teiid/net/socket/UrlServerDiscovery.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -44,38 +44,28 @@
this.url = url;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public List<HostInfo> getKnownHosts(LogonResult result,
SocketServerInstance instance) {
return url.getHostInfo();
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void init(TeiidURL url, Properties p) {
this.url = url;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void connectionSuccessful(HostInfo info) {
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void markInstanceAsBad(HostInfo info) {
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void shutdown() {
}
Modified: trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java
===================================================================
--- trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/test/java/org/teiid/client/util/TestExceptionHolder.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -21,7 +21,6 @@
public class TestExceptionHolder {
- //## JDBC4.0-begin ##
@SuppressWarnings("all")
public static class BadException extends TeiidProcessingException {
private Object obj;
@@ -116,11 +115,4 @@
Throwable e = holder.getException();
assertTrue(e instanceof TeiidException);
}
- //## JDBC4.0-end ##
-
- /*## JDBC3.0-JDK1.5-begin ##
- public void testPass(){
- // since the jar files required are built with 1.6, it will always fail, so just comment the test for 1.5
- }
- ## JDBC3.0-JDK1.5-end ##*/
}
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestWrapperImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -27,16 +27,14 @@
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.sql.SQLException;
-//## JDBC4.0-begin ##
import java.sql.Wrapper;
import org.teiid.jdbc.WrapperImpl;
-//## JDBC4.0-end ##
import junit.framework.TestCase;
public class TestWrapperImpl extends TestCase {
- //## JDBC4.0-begin ##
+
interface Foo extends Wrapper {
void callMe();
}
@@ -50,9 +48,9 @@
}
}
- //## JDBC4.0-end ##
+
public void testProxy() throws SQLException {
- //## JDBC4.0-begin ##
+
final FooImpl fooImpl = new FooImpl();
Foo proxy = (Foo)Proxy.newProxyInstance(TestWrapperImpl.class.getClassLoader(), new Class[] {Foo.class}, new InvocationHandler() {
@@ -85,7 +83,6 @@
} catch (SQLException e) {
assertEquals("Wrapped object is not an instance of class java.lang.String", e.getMessage());
}
- //## JDBC4.0-end ##
}
}
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestXAConnection.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestXAConnection.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestXAConnection.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -43,9 +43,7 @@
final ConnectionImpl mmConn = TestConnection.getMMConnection();
XAConnectionImpl xaConn = new XAConnectionImpl(new XAConnectionImpl.ConnectionSource() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ConnectionImpl createConnection() throws SQLException {
return mmConn;
}
@@ -71,9 +69,7 @@
@Test public void testNotification() throws Exception {
XAConnectionImpl xaConn = new XAConnectionImpl(new XAConnectionImpl.ConnectionSource() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ConnectionImpl createConnection() throws SQLException {
ConnectionImpl c = Mockito.mock(ConnectionImpl.class);
Mockito.doThrow(new SQLException(new InvalidSessionException())).when(c).commit();
Modified: trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java
===================================================================
--- trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerConnection.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -61,25 +61,19 @@
Throwable t;
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void assertIdentity(SessionToken sessionId)
throws InvalidSessionException, TeiidComponentException {
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ResultsFuture<?> logoff()
throws InvalidSessionException {
return null;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public LogonResult logon(
Properties connectionProperties)
throws LogonException,
@@ -87,9 +81,7 @@
return new LogonResult(new SessionToken(1, "fooUser"), "foo", 1, "fake"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ResultsFuture<?> ping()
throws InvalidSessionException,
TeiidComponentException {
@@ -129,9 +121,7 @@
public void testLogonFailsWithMultipleHosts() throws Exception {
Properties p = new Properties();
SocketServerInstanceFactory instanceFactory = new SocketServerInstanceFactory() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public SocketServerInstance getServerInstance(HostInfo info,
boolean ssl) throws CommunicationException, IOException {
throw new SingleInstanceCommunicationException();
@@ -193,9 +183,7 @@
Properties p = new Properties();
ServerDiscovery discovery = new UrlServerDiscovery(new TeiidURL(hostInfo.getHostName(), hostInfo.getPortNumber(), false));
SocketServerInstanceFactory instanceFactory = new SocketServerInstanceFactory() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public SocketServerInstance getServerInstance(final HostInfo info,
boolean ssl) throws CommunicationException, IOException {
SocketServerInstance instance = Mockito.mock(SocketServerInstance.class);
Modified: trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java
===================================================================
--- trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/client/src/test/java/org/teiid/net/socket/TestSocketServerInstanceImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -56,23 +56,17 @@
this.readMsgs = readMsgs;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public void close() {
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public boolean isOpen() {
return true;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Future<?> write(Object msg) {
msgs.add(msg);
ResultsFuture<?> result = new ResultsFuture<Void>();
@@ -80,9 +74,7 @@
return result;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Object read() throws IOException,
ClassNotFoundException {
if (readCount >= readMsgs.size()) {
@@ -102,24 +94,18 @@
return msg;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public SocketAddress getRemoteAddress() {
return null;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ObjectChannel createObjectChannel(SocketAddress address,
boolean ssl) throws IOException, CommunicationException {
return this;
}
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public int getSoTimeout() {
return 1;
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/main/java/org/teiid/core/types/BlobType.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -121,7 +121,6 @@
this.reference.truncate(len);
}
- //## JDBC4.0-begin ##
public void free() throws SQLException {
this.reference.free();
}
@@ -130,7 +129,6 @@
throws SQLException {
return this.reference.getBinaryStream(pos, length);
}
- //## JDBC4.0-end ##
public static SerialBlob createBlob(byte[] bytes) {
if (bytes == null) {
Modified: trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/main/java/org/teiid/core/types/ClobType.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -200,15 +200,14 @@
};
}
- //## JDBC4.0-begin ##
- public void free() throws SQLException {
+
+ public void free() throws SQLException {
this.reference.free();
}
public Reader getCharacterStream(long pos, long length) throws SQLException {
return this.reference.getCharacterStream(pos, length);
}
- //## JDBC4.0-end ##
public static SerialClob createClob(char[] chars) {
try {
Modified: trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -704,50 +704,38 @@
static void loadSourceConversions() {
sourceConverters.put(Clob.class, new SourceTransform<Clob, ClobType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ClobType transform(Clob value) {
return new ClobType(value);
}
});
sourceConverters.put(char[].class, new SourceTransform<char[], ClobType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public ClobType transform(char[] value) {
return new ClobType(ClobType.createClob(value));
}
});
sourceConverters.put(Blob.class, new SourceTransform<Blob, BlobType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public BlobType transform(Blob value) {
return new BlobType(value);
}
});
addSourceTransform(byte[].class, new SourceTransform<byte[], BlobType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public BlobType transform(byte[] value) {
return new BlobType(BlobType.createBlob(value));
}
});
addSourceTransform(SQLXML.class, new SourceTransform<SQLXML, XMLType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public XMLType transform(SQLXML value) {
return new XMLType(value);
}
});
//Note: the default transform from non-InputStreamFactory source is a fully materialized string
addSourceTransform(Source.class, new SourceTransform<Source, XMLType>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public XMLType transform(Source value) {
if (value instanceof InputStreamFactory) {
return new XMLType(new SQLXMLImpl((InputStreamFactory)value));
@@ -761,9 +749,7 @@
}
});
addSourceTransform(Date.class, new SourceTransform<Date, Timestamp>() {
- //## JDBC4.0-begin ##
@Override
- //## JDBC4.0-end ##
public Timestamp transform(Date value) {
return new Timestamp(value.getTime());
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/main/java/org/teiid/core/types/InputStreamFactory.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -27,6 +27,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
import java.io.Reader;
import java.nio.charset.Charset;
import java.sql.Blob;
@@ -34,6 +35,7 @@
import java.sql.SQLException;
import java.sql.SQLXML;
+import javax.activation.DataSource;
import javax.xml.transform.Source;
import org.teiid.core.util.ReaderInputStream;
@@ -102,7 +104,7 @@
}
- public static class ClobInputStreamFactory extends InputStreamFactory {
+ public static class ClobInputStreamFactory extends InputStreamFactory implements DataSource {
private Clob clob;
private Charset charset = Charset.forName(Streamable.ENCODING);
@@ -136,10 +138,25 @@
throw new IOException(e);
}
}
+
+ @Override
+ public String getContentType() {
+ return "text/plain"; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getName() {
+ return "clob"; //$NON-NLS-1$
+ }
+
+ @Override
+ public OutputStream getOutputStream() throws IOException {
+ throw new UnsupportedOperationException();
+ }
}
- public static class BlobInputStreamFactory extends InputStreamFactory {
+ public static class BlobInputStreamFactory extends InputStreamFactory implements DataSource {
private Blob blob;
@@ -165,9 +182,24 @@
}
}
+ @Override
+ public String getContentType() {
+ return "application/octet-stream"; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getName() {
+ return "blob"; //$NON-NLS-1$
+ }
+
+ @Override
+ public OutputStream getOutputStream() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
}
- public static class SQLXMLInputStreamFactory extends InputStreamFactory {
+ public static class SQLXMLInputStreamFactory extends InputStreamFactory implements DataSource {
private SQLXML sqlxml;
@@ -193,6 +225,21 @@
}
}
+ @Override
+ public String getContentType() {
+ return "application/xml"; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getName() {
+ return "sqlxml"; //$NON-NLS-1$
+ }
+
+ @Override
+ public OutputStream getOutputStream() throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
}
}
Modified: trunk/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/main/java/org/teiid/core/types/JDBCSQLTypeInfo.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -24,13 +24,8 @@
import java.sql.Blob;
import java.sql.Clob;
-//## JDBC4.0-begin ##
import java.sql.SQLXML;
-//## JDBC4.0-end ##
-/*## JDBC3.0-JDK1.5-begin ##
-import com.metamatrix.core.jdbc.SQLXML;
-## JDBC3.0-JDK1.5-end ##*/
import java.sql.Types;
import java.util.HashMap;
import java.util.Map;
@@ -86,12 +81,7 @@
public static final String OBJECT_CLASS = DataTypeManager.DefaultDataClasses.OBJECT.getName();
public static final String CLOB_CLASS = Clob.class.getName();
public static final String BLOB_CLASS = Blob.class.getName();
- //## JDBC4.0-begin ##
public static final String XML_CLASS = SQLXML.class.getName();
- //## JDBC4.0-end ##
- /*## JDBC3.0-JDK1.5-begin ##
- public static final String XML_CLASS = DataTypeManager.DefaultDataClasses.OBJECT.getName();
- ## JDBC3.0-JDK1.5-end ##*/
private static Map<String, Integer> NAME_TO_TYPE_MAP = new HashMap<String, Integer>();
private static Map<Integer, String> TYPE_TO_NAME_MAP = new HashMap<Integer, String>();
@@ -119,17 +109,11 @@
addTypeMapping(NULL, null, Types.NULL);
- //## JDBC4.0-begin ##
addTypeMapping(XML, XML_CLASS, Types.SQLXML);
TYPE_TO_NAME_MAP.put(Types.NVARCHAR, STRING);
TYPE_TO_NAME_MAP.put(Types.LONGNVARCHAR, STRING);
TYPE_TO_NAME_MAP.put(Types.NCHAR, CHAR);
TYPE_TO_NAME_MAP.put(Types.NCLOB, CLOB);
- //## JDBC4.0-end ##
-
- /*## JDBC3.0-JDK1.5-begin ##
- NAME_TO_CLASSNAME.put(XML, OBJECT_CLASS);
- ## JDBC3.0-JDK1.5-end ##*/
}
private static void addTypeMapping(String typeName, String javaClass, int sqlType, int ... secondaryTypes) {
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 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/main/java/org/teiid/core/util/SqlUtil.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -24,14 +24,10 @@
import java.sql.SQLException;
-//## JDBC4.0-begin ##
import java.sql.SQLFeatureNotSupportedException;
-//## JDBC4.0-end ##
import java.util.regex.Pattern;
-
-
/**
* Utilities for dealing with SQL strings.
*/
@@ -111,13 +107,6 @@
}
public static SQLException createFeatureNotSupportedException() {
- //## JDBC4.0-begin ##
return new SQLFeatureNotSupportedException();
- //## JDBC4.0-end ##
-
- /*## JDBC3.0-JDK1.5-begin ##
- return new SQLException("unsupported feature");
- ## JDBC3.0-JDK1.5-end ##*/
-
}
}
Modified: trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/test/java/org/teiid/core/types/TestDataTypeManager.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -172,9 +172,7 @@
}
assertEquals(Types.TIMESTAMP, JDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.TIMESTAMP));
- //## JDBC4.0-begin ##
assertEquals(Types.SQLXML, JDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.XML));
- //## JDBC4.0-end ##
assertEquals(DataTypeManager.DefaultDataTypes.STRING, JDBCSQLTypeInfo.getTypeName(Types.CHAR));
assertEquals(Types.CHAR, JDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.CHAR));
}
Modified: trunk/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/test/java/org/teiid/core/types/TestSQLXMLImpl.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -38,7 +38,6 @@
String testStr = "<foo>test</foo>"; //$NON-NLS-1$
- //## JDBC4.0-begin ##
@Test public void testGetSource() throws Exception {
SQLXMLImpl xml = new SQLXMLImpl(testStr);
assertTrue(xml.getSource(null) instanceof StreamSource);
@@ -46,7 +45,6 @@
StreamSource ss = (StreamSource)xml.getSource(null);
assertEquals(testStr, new String(ObjectConverterUtil.convertToByteArray(ss.getInputStream()), Streamable.ENCODING));
}
- //## JDBC4.0-end ##
@Test public void testGetCharacterStream() throws Exception {
SQLXMLImpl xml = new SQLXMLImpl(testStr);
Modified: trunk/common-core/src/test/java/org/teiid/core/types/basic/TestStringToXmlTransform.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/types/basic/TestStringToXmlTransform.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/test/java/org/teiid/core/types/basic/TestStringToXmlTransform.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -22,7 +22,6 @@
package org.teiid.core.types.basic;
-//## JDBC4.0-begin ##
import static org.junit.Assert.*;
import java.sql.SQLXML;
Modified: trunk/common-core/src/test/java/org/teiid/core/util/UnitTestUtil.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/util/UnitTestUtil.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/common-core/src/test/java/org/teiid/core/util/UnitTestUtil.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -43,13 +43,7 @@
public static final String PATH_SEPARATOR = "/"; //$NON-NLS-1$
- //## JDBC4.0-begin ##
private static final String DEFAULT_TESTDATA_PATH = "src/test/resources"; //$NON-NLS-1$
- //## JDBC4.0-end ##
-
- /*## JDBC3.0-JDK1.5-begin ##
- private static final String DEFAULT_TESTDATA_PATH = "target/generated-sources/test/resources"; //$NON-NLS-1$
- ## JDBC3.0-JDK1.5-end ##*/
private static final String DEFAULT_TEMP_DIR = "target/scratch"; //$NON-NLS-1$
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-07-01 14:23:31 UTC (rev 2326)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-07-01 14:26:20 UTC (rev 2327)
@@ -88,7 +88,6 @@
import org.teiid.query.sql.lang.SubqueryContainer;
import org.teiid.query.sql.lang.SubqueryFromClause;
import org.teiid.query.sql.lang.TableFunctionReference;
-import org.teiid.query.sql.lang.TextTable;
import org.teiid.query.sql.lang.UnaryFromClause;
import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
import org.teiid.query.sql.symbol.GroupSymbol;
14 years, 6 months
teiid SVN: r2326 - in trunk/runtime/src/main: resources/org/teiid/runtime and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-07-01 10:23:31 -0400 (Thu, 01 Jul 2010)
New Revision: 2326
Modified:
trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
Log:
TEIID-1079 reusing message for translator not found.
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-07-01 12:11:44 UTC (rev 2325)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-07-01 14:23:31 UTC (rev 2326)
@@ -180,7 +180,7 @@
String name = model.getSourceTranslatorName(source);
Translator translator = VDBDeployer.this.translatorRepository.getTranslatorMetaData(new VDBKey(deployment.getName(), deployment.getVersion()), name);
if (translator == null) {
- throw new DeploymentException(RuntimePlugin.Util.getString("translator_not_found", name)); //$NON-NLS-1$
+ throw new DeploymentException(RuntimePlugin.Util.getString("translator_not_found", deployment.getName(), deployment.getVersion(), name)); //$NON-NLS-1$
}
ExecutionFactory<Object, Object> ef = map.get(translator);
Modified: trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-07-01 12:11:44 UTC (rev 2325)
+++ trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-07-01 14:23:31 UTC (rev 2326)
@@ -306,4 +306,3 @@
required_property_not_exists=Required property "{0}" has no value. Deployment is incomplete.
name_not_found=Translator property "name" not defined for the deployment "{0}"
translator_type_not_found=The parent translator defined not found in configuration "{0}"
-translator_not_found=Unknown translator "{0}"
14 years, 6 months
teiid SVN: r2325 - in trunk: build/assembly/jboss-container and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-07-01 08:11:44 -0400 (Thu, 01 Jul 2010)
New Revision: 2325
Modified:
trunk/build/assembly/adminshell/adminshell-dist.xml
trunk/build/assembly/jboss-container/dist.xml
trunk/documentation/client-developers-guide/pom.xml
Log:
correcting file permissions and the client guide name
Modified: trunk/build/assembly/adminshell/adminshell-dist.xml
===================================================================
--- trunk/build/assembly/adminshell/adminshell-dist.xml 2010-06-30 17:09:46 UTC (rev 2324)
+++ trunk/build/assembly/adminshell/adminshell-dist.xml 2010-07-01 12:11:44 UTC (rev 2325)
@@ -31,6 +31,7 @@
</dependencySet>
</dependencySets>
<outputDirectory>lib</outputDirectory>
+ <fileMode>0644</fileMode>
</binaries>
</moduleSet>
@@ -52,7 +53,8 @@
<outputDirectory>/</outputDirectory>
<excludes>
<exclude>**/*.sh</exclude>
- </excludes>
+ </excludes>
+ <fileMode>0644</fileMode>
</fileSet>
<fileSet>
@@ -60,7 +62,8 @@
<includes>
<include>teiid-${version}-client.jar</include>
</includes>
- <outputDirectory>lib</outputDirectory>
+ <outputDirectory>lib</outputDirectory>
+ <fileMode>0644</fileMode>
</fileSet>
</fileSets>
@@ -68,6 +71,7 @@
<files>
<file>
<source>target/distribution/teiid-${version}-docs/admin-guide/en-US/pdf/teiid_admin_guide.pdf</source>
+ <fileMode>0644</fileMode>
</file>
</files>
Modified: trunk/build/assembly/jboss-container/dist.xml
===================================================================
--- trunk/build/assembly/jboss-container/dist.xml 2010-06-30 17:09:46 UTC (rev 2324)
+++ trunk/build/assembly/jboss-container/dist.xml 2010-07-01 12:11:44 UTC (rev 2325)
@@ -127,6 +127,7 @@
</dependencySet>
</dependencySets>
<outputDirectory>deployers/teiid.deployer</outputDirectory>
+ <fileMode>0644</fileMode>
</binaries>
</moduleSet>
@@ -159,6 +160,7 @@
</dependencySet>
</dependencySets>
<outputDirectory>deploy/teiid/connectors</outputDirectory>
+ <fileMode>0644</fileMode>
</binaries>
</moduleSet>
@@ -175,6 +177,7 @@
<includeDependencies>false</includeDependencies>
<unpack>false</unpack>
<outputDirectory>deploy/admin-console.war/plugins</outputDirectory>
+ <fileMode>0644</fileMode>
</binaries>
</moduleSet>
Modified: trunk/documentation/client-developers-guide/pom.xml
===================================================================
--- trunk/documentation/client-developers-guide/pom.xml 2010-06-30 17:09:46 UTC (rev 2324)
+++ trunk/documentation/client-developers-guide/pom.xml 2010-07-01 12:11:44 UTC (rev 2325)
@@ -51,7 +51,7 @@
<format>
<formatName>pdf</formatName>
<stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>client_developers_guide.pdf</finalName>
+ <finalName>teiid_client_developers_guide.pdf</finalName>
</format>
<format>
<formatName>html_single</formatName>
14 years, 6 months