Author: shawkins
Date: 2010-02-16 18:14:59 -0500 (Tue, 16 Feb 2010)
New Revision: 1835
Modified:
trunk/engine/src/main/java/com/metamatrix/query/tempdata/TempTableStoreImpl.java
Log:
TEIID-913 changes related to buffering and performance. removing exceptions from
tuplesource close, tweaking to more reasonable defaults, updated buffering to also
consider column width, refined the performance of value caching, and allowed partitioning
to work over larger sets
Modified:
trunk/engine/src/main/java/com/metamatrix/query/tempdata/TempTableStoreImpl.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/query/tempdata/TempTableStoreImpl.java 2010-02-16
21:19:19 UTC (rev 1834)
+++
trunk/engine/src/main/java/com/metamatrix/query/tempdata/TempTableStoreImpl.java 2010-02-16
23:14:59 UTC (rev 1835)
@@ -77,6 +77,7 @@
private final Criteria crit;
protected int updateCount = 0;
private boolean done;
+ private List<?> currentTuple;
private UpdateTupleSource(String groupKey, TupleBuffer tsId, Criteria crit) throws
MetaMatrixComponentException {
this.groupKey = groupKey;
@@ -96,14 +97,14 @@
return null;
}
- List<?> tuple = null;
//still have to worry about blocked exceptions...
- while ((tuple = ts.nextTuple()) != null) {
- if (eval.evaluate(crit, tuple)) {
- tuplePassed(tuple);
+ while (currentTuple != null || (currentTuple = ts.nextTuple()) != null) {
+ if (eval.evaluate(crit, currentTuple)) {
+ tuplePassed(currentTuple);
} else {
- tupleFailed(tuple);
+ tupleFailed(currentTuple);
}
+ currentTuple = null;
}
newBuffer.close();
groupToTupleSourceID.put(groupKey, newBuffer);
@@ -126,7 +127,7 @@
}
@Override
- public void closeSource() throws MetaMatrixComponentException {
+ public void closeSource() {
}
@@ -270,20 +271,12 @@
}
//allow implicit temp group definition
List columns = null;
- switch (command.getType()) {
- case Command.TYPE_QUERY:
- Query query = (Query)command;
- if(query.getInto() != null &&
query.getInto().getGroup().isImplicitTempGroupSymbol()) {
- columns = query.getSelect().getSymbols();
- }
- break;
- case Command.TYPE_INSERT:
+ if (command instanceof Insert) {
Insert insert = (Insert)command;
GroupSymbol group = insert.getGroup();
if(group.isImplicitTempGroupSymbol()) {
columns = insert.getVariables();
}
- break;
}
if (columns == null) {
throw new
QueryProcessingException(QueryExecPlugin.Util.getString("TempTableStore.table_doesnt_exist_error",
tempTableID)); //$NON-NLS-1$