teiid SVN: r4222 - in trunk/engine/src: main/java/org/teiid/query/sql/lang and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-07-05 11:43:21 -0400 (Thu, 05 Jul 2012)
New Revision: 4222
Modified:
trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/ArrayTableNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentAccessNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentProcedureAccessNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/InsertPlanExecutionNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/PlanExecutionNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectIntoNode.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/RelationalPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/SelectNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareRelationalNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java
trunk/engine/src/main/java/org/teiid/query/sql/lang/SubqueryContainer.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestSubqueryPushdown.java
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestSelectNode.java
Log:
TEIID-2091 improving txn detection for txnautowrap detect
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -25,6 +25,7 @@
import static org.teiid.query.analysis.AnalysisRecord.*;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -45,13 +46,18 @@
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.processor.RegisterRequestParameter;
import org.teiid.query.rewriter.QueryRewriter;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.lang.ExistsCriteria;
import org.teiid.query.sql.lang.OrderByItem;
import org.teiid.query.sql.lang.Query;
import org.teiid.query.sql.lang.Select;
+import org.teiid.query.sql.lang.SubqueryContainer;
import org.teiid.query.sql.symbol.Constant;
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.visitor.ValueIteratorProviderCollectorVisitor;
import org.teiid.query.util.CommandContext;
@@ -440,5 +446,38 @@
public void setConnectorBindingId(String connectorBindingId) {
this.connectorBindingId = connectorBindingId;
}
-
+
+ @Override
+ protected Collection<? extends LanguageObject> getObjects() {
+ ArrayList<LanguageObject> list = new ArrayList<LanguageObject>();
+ if (projection != null) {
+ for (Object obj : projection) {
+ if (obj instanceof LanguageObject) {
+ list.add((LanguageObject)obj);
+ }
+ }
+ }
+ if (shouldEvaluate) {
+ //collect any evaluatable subqueries
+ for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(this.command)) {
+ if (container instanceof ExistsCriteria && ((ExistsCriteria)container).shouldEvaluate()) {
+ list.add(container);
+ }
+ if (container instanceof ScalarSubquery && ((ScalarSubquery)container).shouldEvaluate()) {
+ list.add(container);
+ }
+ }
+ }
+ return list;
+ }
+
+ @Override
+ public Boolean requiresTransaction(boolean transactionalReads) {
+ Boolean required = super.requiresTransaction(transactionalReads);
+ if (Boolean.TRUE.equals(required)) {
+ return true;
+ }
+ return null;
+ }
+
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/ArrayTableNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/ArrayTableNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/ArrayTableNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -24,6 +24,8 @@
import java.sql.SQLException;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.Map;
@@ -37,6 +39,7 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.FunctionMethods;
import org.teiid.query.processor.ProcessorDataManager;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.lang.ArrayTable;
import org.teiid.query.sql.lang.TableFunctionReference.ProjectedColumn;
import org.teiid.query.util.CommandContext;
@@ -107,5 +110,10 @@
terminateBatches();
return pullBatch();
}
+
+ @Override
+ protected Collection<? extends LanguageObject> getObjects() {
+ return Arrays.asList(this.table.getArrayValue());
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -37,6 +38,7 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.processor.RegisterRequestParameter;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.lang.BatchedUpdateCommand;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.util.VariableContext;
@@ -177,5 +179,15 @@
super.copy(this, clonedNode);
return clonedNode;
}
+
+ @Override
+ protected Collection<? extends LanguageObject> getObjects() {
+ return null;
+ }
+
+ @Override
+ public Boolean requiresTransaction(boolean transactionalReads) {
+ return true;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentAccessNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentAccessNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentAccessNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -33,6 +33,7 @@
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.lang.DependentSetCriteria;
import org.teiid.query.sql.lang.Query;
+import org.teiid.query.sql.lang.QueryCommand;
/**
@@ -208,5 +209,13 @@
public void setPushdown(boolean pushdown) {
this.pushdown = pushdown;
}
+
+ @Override
+ public Boolean requiresTransaction(boolean transactionalReads) {
+ if (transactionalReads || !(this.getCommand() instanceof QueryCommand)) {
+ return true;
+ }
+ return null;
+ }
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentProcedureAccessNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentProcedureAccessNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentProcedureAccessNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -120,5 +120,10 @@
public Criteria getInputCriteria() {
return this.inputCriteria;
}
+
+ @Override
+ public Boolean requiresTransaction(boolean transactionalReads) {
+ return true; //TODO: check the underlying
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/InsertPlanExecutionNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/InsertPlanExecutionNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/InsertPlanExecutionNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -113,5 +113,10 @@
this.batchRow = 1;
this.insertCount = 0;
}
+
+ @Override
+ public Boolean requiresTransaction(boolean transactionalReads) {
+ return true;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/JoinNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -25,6 +25,7 @@
import static org.teiid.query.analysis.AnalysisRecord.*;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -38,6 +39,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.processor.relational.SourceState.ImplicitBuffer;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.lang.JoinType;
import org.teiid.query.util.CommandContext;
@@ -329,5 +331,18 @@
public DependentValueSource getDependentValueSource() {
return dvs;
}
+
+ @Override
+ protected Collection<? extends LanguageObject> getObjects() {
+ List<LanguageObject> all = new ArrayList<LanguageObject>();
+ if (leftExpressions != null) {
+ all.addAll(leftExpressions);
+ all.addAll(rightExpressions);
+ }
+ if (joinCriteria != null) {
+ all.add(joinCriteria);
+ }
+ return all;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/PlanExecutionNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/PlanExecutionNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/PlanExecutionNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -180,4 +180,12 @@
return props;
}
+ @Override
+ public Boolean requiresTransaction(boolean transactionalReads) {
+ if (Boolean.TRUE.equals(getProcessorPlan().requiresTransaction(transactionalReads))) {
+ return true;
+ }
+ return null;
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectIntoNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectIntoNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectIntoNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -283,4 +283,12 @@
return modelName;
}
+ @Override
+ public Boolean requiresTransaction(boolean transactionalReads) {
+ if (getMode() != Mode.ITERATOR) {
+ return true;
+ }
+ return null;
+ }
+
}
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 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -39,6 +40,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.processor.ProcessorDataManager;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.symbol.AliasSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.util.SymbolMap;
@@ -221,4 +223,9 @@
return props;
}
+ @Override
+ protected Collection<? extends LanguageObject> getObjects() {
+ return this.selectSymbols;
+ }
+
}
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 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -637,4 +637,12 @@
throw e;
}
+ /**
+ * @param transactionalReads
+ * @return true if required, false if not required, and null if transactional reads and a single source command is issued.
+ */
+ public Boolean requiresTransaction(boolean transactionalReads) {
+ return false;
+ }
+
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -40,13 +40,12 @@
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.processor.QueryProcessor;
import org.teiid.query.processor.RegisterRequestParameter;
-import org.teiid.query.processor.relational.ProjectIntoNode.Mode;
import org.teiid.query.sql.LanguageObject;
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.sql.symbol.Expression;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.tempdata.TempTableStore.TransactionMode;
import org.teiid.query.util.CommandContext;
@@ -57,7 +56,7 @@
// Initialize state - don't reset
private RelationalNode root;
- private List outputCols;
+ private List<? extends Expression> outputCols;
private List<WithQueryCommand> with;
private List<WithQueryCommand> withToProcess;
@@ -131,7 +130,7 @@
* Get list of resolved elements describing output columns for this plan.
* @return List of SingleElementSymbol
*/
- public List getOutputElements() {
+ public List<? extends Expression> getOutputElements() {
return this.outputCols;
}
@@ -244,7 +243,7 @@
/**
* @param outputCols The outputCols to set.
*/
- public void setOutputElements(List outputCols) {
+ public void setOutputElements(List<? extends Expression> outputCols) {
this.outputCols = outputCols;
}
@@ -267,40 +266,32 @@
}
}
}
- return requiresTransaction(transactionalReads, root);
+ return Boolean.TRUE.equals(requiresTransaction(transactionalReads, root));
}
- /**
- * Currently does not detect procedures in non-inline view subqueries
- */
- boolean requiresTransaction(boolean transactionalReads, RelationalNode node) {
- if (node instanceof DependentAccessNode) {
- if (transactionalReads || !(((DependentAccessNode)node).getCommand() instanceof QueryCommand)) {
- return true;
- }
- return false;
- }
- if (node instanceof ProjectIntoNode) {
- if (((ProjectIntoNode)node).getMode() == Mode.ITERATOR) {
- return transactionalReads;
- }
+ static Boolean requiresTransaction(boolean transactionalReads, RelationalNode node) {
+ Boolean requiresTxn = node.requiresTransaction(transactionalReads);
+ if (Boolean.TRUE.equals(requiresTxn)) {
return true;
- } else if (node instanceof AccessNode) {
- return false;
- }
- if (transactionalReads) {
- return true;
- }
- if (node instanceof PlanExecutionNode) {
- ProcessorPlan plan = ((PlanExecutionNode)node).getProcessorPlan();
- return plan.requiresTransaction(transactionalReads);
- }
+ }
for (RelationalNode child : node.getChildren()) {
- if (child != null && requiresTransaction(transactionalReads, child)) {
+ if (child == null) {
+ continue;
+ }
+ Boolean childRequires = requiresTransaction(transactionalReads, child);
+ if (Boolean.TRUE.equals(childRequires)) {
return true;
}
+ if (transactionalReads) {
+ if (childRequires == null) {
+ if (requiresTxn == null) {
+ return true;
+ }
+ requiresTxn = null;
+ }
+ }
}
- return false;
+ return requiresTxn;
}
@Override
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 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/SelectNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -25,6 +25,7 @@
import static org.teiid.query.analysis.AnalysisRecord.*;
import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -36,6 +37,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.processor.ProcessorDataManager;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.util.CommandContext;
@@ -97,7 +99,7 @@
}
while (currentRow <= currentBatch.getEndRow() && !isBatchFull()) {
- List tuple = currentBatch.getTuple(currentRow);
+ List<?> tuple = currentBatch.getTuple(currentRow);
if(getEvaluator(this.elementMap).evaluate(this.criteria, tuple)) {
addBatchRow(projectTuple(this.projectionIndexes, tuple));
@@ -139,4 +141,9 @@
return props;
}
+ @Override
+ protected Collection<? extends LanguageObject> getObjects() {
+ return Arrays.asList(this.criteria);
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareRelationalNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareRelationalNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/SubqueryAwareRelationalNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -22,6 +22,7 @@
package org.teiid.query.processor.relational;
+import java.util.Collection;
import java.util.Collections;
import java.util.Map;
@@ -29,9 +30,11 @@
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.eval.Evaluator;
+import org.teiid.query.sql.LanguageObject;
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.visitor.ValueIteratorProviderCollectorVisitor;
public abstract class SubqueryAwareRelationalNode extends RelationalNode {
@@ -77,5 +80,15 @@
getContext().getVariableContext().setValue(entry.getKey(), getEvaluator(Collections.emptyMap()).evaluate(entry.getValue(), null));
}
}
+
+ abstract protected Collection<? extends LanguageObject> getObjects();
+
+ @Override
+ public Boolean requiresTransaction(boolean transactionalReads) {
+ if (!transactionalReads) {
+ return false;
+ }
+ return !ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(getObjects()).isEmpty();
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -27,6 +27,8 @@
import java.io.Reader;
import java.sql.SQLException;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -44,6 +46,7 @@
import org.teiid.core.types.TransformationException;
import org.teiid.query.QueryPlugin;
import org.teiid.query.processor.ProcessorDataManager;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.lang.TextTable;
import org.teiid.query.sql.lang.TextTable.TextColumn;
import org.teiid.query.sql.symbol.Expression;
@@ -483,4 +486,9 @@
return result;
}
+ @Override
+ protected Collection<? extends LanguageObject> getObjects() {
+ return Arrays.asList(this.table.getFile());
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -48,6 +49,7 @@
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.processor.relational.GroupingNode.ProjectingTupleSource;
import org.teiid.query.processor.relational.SortUtility.Mode;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.lang.OrderBy;
import org.teiid.query.sql.lang.OrderByItem;
import org.teiid.query.sql.symbol.ElementSymbol;
@@ -471,5 +473,10 @@
this.elementMap = createLookupMap(sourceElements);
}
}
+
+ @Override
+ protected Collection<? extends LanguageObject> getObjects() {
+ return getElements();
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/XMLTableNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -23,6 +23,7 @@
package org.teiid.query.processor.relational;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -54,6 +55,7 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.function.FunctionDescriptor;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.lang.XMLTable;
import org.teiid.query.sql.lang.XMLTable.XMLColumn;
import org.teiid.query.xquery.saxon.XQueryEvaluator;
@@ -339,5 +341,10 @@
private boolean hasNextBatch() {
return this.outputRow + this.buffer.getBatchSize() <= rowCount + 1;
}
+
+ @Override
+ protected Collection<? extends LanguageObject> getObjects() {
+ return this.table.getPassing();
+ }
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/query/sql/lang/SubqueryContainer.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/lang/SubqueryContainer.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/main/java/org/teiid/query/sql/lang/SubqueryContainer.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -22,11 +22,13 @@
package org.teiid.query.sql.lang;
+import org.teiid.query.sql.LanguageObject;
+
/**
- * This interface defines a common interface for all MetaMatrix SQL objects
+ * This interface defines a common interface for all SQL objects
* that contain subqueries.
*/
-public interface SubqueryContainer<T extends Command> {
+public interface SubqueryContainer<T extends Command> extends LanguageObject {
/**
* Returns the subquery Command object
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -1547,7 +1547,10 @@
0, // Select
0, // Sort
0 // UnionAll
- });
+ });
+
+ assertTrue(plan.requiresTransaction(true));
+ assertFalse(plan.requiresTransaction(false));
}
@Test public void testCantPushJoin2() {
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestSubqueryPushdown.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestSubqueryPushdown.java 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestSubqueryPushdown.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -22,6 +22,7 @@
package org.teiid.query.optimizer;
+import static org.junit.Assert.*;
import static org.teiid.query.optimizer.TestOptimizer.*;
import org.junit.After;
@@ -142,6 +143,9 @@
null, capFinder,
new String[] { "SELECT intkey FROM bqt1.smalla AS n WHERE intkey = (SELECT MAX(intkey) FROM bqt1.smallb AS s WHERE s.stringkey = n.stringkey)" }, SHOULD_SUCCEED); //$NON-NLS-1$
checkNodeTypes(plan, FULL_PUSHDOWN);
+
+ assertFalse(plan.requiresTransaction(true));
+ assertFalse(plan.requiresTransaction(false));
}
@Test public void testPushCorrelatedSubquery2() {
@@ -276,6 +280,9 @@
0, // Sort
0 // UnionAll
});
+
+ assertTrue(plan.requiresTransaction(true));
+ assertFalse(plan.requiresTransaction(false));
}
@Test public void testCorrelatedSubquery2() {
@@ -749,6 +756,9 @@
ProcessorPlan plan = helpPlan("Select e1 from pm1.g1 where e1 > (select e1 FROM pm2.g1 where e2 = 13)", RealMetadataFactory.example1Cached(), //$NON-NLS-1$
new String[] { "SELECT g_0.e1 FROM pm1.g1 AS g_0 WHERE g_0.e1 > (SELECT g_0.e1 FROM pm2.g1 AS g_0 WHERE g_0.e2 = 13)" }, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
checkNodeTypes(plan, FULL_PUSHDOWN);
+
+ assertTrue(plan.requiresTransaction(true));
+ assertFalse(plan.requiresTransaction(false));
}
@Test public void testScalarSubquery1() throws TeiidComponentException, TeiidProcessingException {
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 2012-07-03 20:05:54 UTC (rev 4221)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestSelectNode.java 2012-07-05 15:43:21 UTC (rev 4222)
@@ -22,8 +22,7 @@
package org.teiid.query.processor.relational;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.Arrays;
@@ -54,6 +53,7 @@
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.query.util.CommandContext;
+@SuppressWarnings("unchecked")
public class TestSelectNode {
public void helpTestSelect(List elements, Criteria criteria, List[] data, List childElements, ProcessorDataManager dataMgr, List[] expected) throws TeiidComponentException, TeiidProcessingException {
12 years, 6 months
teiid SVN: r4221 - in trunk/engine/src: test/java/org/teiid/query/processor and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-07-03 16:05:54 -0400 (Tue, 03 Jul 2012)
New Revision: 4221
Modified:
trunk/engine/src/main/java/org/teiid/query/processor/relational/ArrayTableNode.java
trunk/engine/src/test/java/org/teiid/query/processor/TestArrayTable.java
Log:
TEIID-2090 fixing npe
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/ArrayTableNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/ArrayTableNode.java 2012-07-03 15:29:48 UTC (rev 4220)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/ArrayTableNode.java 2012-07-03 20:05:54 UTC (rev 4221)
@@ -87,22 +87,23 @@
@Override
protected TupleBatch nextBatchDirect() throws BlockedException,
TeiidComponentException, TeiidProcessingException {
- ArrayList<Object> tuple = new ArrayList<Object>(projectionIndexes.length);
-
Object array = getEvaluator(Collections.emptyMap()).evaluate(table.getArrayValue(), null);
-
- for (int output : projectionIndexes) {
- ProjectedColumn col = table.getColumns().get(output);
- try {
- Object val = FunctionMethods.array_get(array, output + 1);
- tuple.add(DataTypeManager.transformValue(val, table.getColumns().get(output).getSymbol().getType()));
- } catch (TransformationException e) {
- throw new TeiidProcessingException(QueryPlugin.Event.TEIID30190, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30190, col.getName()));
- } catch (SQLException e) {
- throw new TeiidProcessingException(QueryPlugin.Event.TEIID30188, e);
+
+ if (array != null) {
+ ArrayList<Object> tuple = new ArrayList<Object>(projectionIndexes.length);
+ for (int output : projectionIndexes) {
+ ProjectedColumn col = table.getColumns().get(output);
+ try {
+ Object val = FunctionMethods.array_get(array, output + 1);
+ tuple.add(DataTypeManager.transformValue(val, table.getColumns().get(output).getSymbol().getType()));
+ } catch (TransformationException e) {
+ throw new TeiidProcessingException(QueryPlugin.Event.TEIID30190, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30190, col.getName()));
+ } catch (SQLException e) {
+ throw new TeiidProcessingException(QueryPlugin.Event.TEIID30188, e);
+ }
}
+ addBatchRow(tuple);
}
- addBatchRow(tuple);
terminateBatches();
return pullBatch();
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestArrayTable.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestArrayTable.java 2012-07-03 15:29:48 UTC (rev 4220)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestArrayTable.java 2012-07-03 20:05:54 UTC (rev 4221)
@@ -75,7 +75,7 @@
public static void process(String sql, List[] expectedResults) throws Exception {
HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData("SELECT bqt1.smalla.objectvalue FROM bqt1.smalla", new List[] {Collections.singletonList(new Object[] {"a", 1, 2}), Collections.singletonList(new Object[] {"b", 3, 6})} );
+ dataManager.addData("SELECT bqt1.smalla.objectvalue FROM bqt1.smalla", new List[] {Collections.singletonList(new Object[] {"a", 1, 2}), Collections.singletonList(new Object[] {"b", 3, 6}), Collections.singletonList(null)} );
ProcessorPlan plan = helpGetPlan(helpParse(sql), RealMetadataFactory.exampleBQTCached());
helpProcess(plan, createCommandContext(), dataManager, expectedResults);
}
12 years, 6 months
teiid SVN: r4220 - in branches/7.7.x: engine/src/main/java/org/teiid/query/processor/relational and 1 other directories.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2012-07-03 11:29:48 -0400 (Tue, 03 Jul 2012)
New Revision: 4220
Modified:
branches/7.7.x/client/src/main/java/org/teiid/net/socket/Message.java
branches/7.7.x/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/SortUtility.java
branches/7.7.x/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
Log:
TEIID-2089 additional logging enhancements
Modified: branches/7.7.x/client/src/main/java/org/teiid/net/socket/Message.java
===================================================================
--- branches/7.7.x/client/src/main/java/org/teiid/net/socket/Message.java 2012-07-03 15:29:32 UTC (rev 4219)
+++ branches/7.7.x/client/src/main/java/org/teiid/net/socket/Message.java 2012-07-03 15:29:48 UTC (rev 4220)
@@ -35,7 +35,7 @@
private Serializable messageKey;
public String toString() {
- return "MessageHolder: contents=" + contents; //$NON-NLS-1$
+ return "MessageHolder: key=" + messageKey + " contents=" + contents; //$NON-NLS-1$ //$NON-NLS-2$
}
public void setContents(Object contents) {
Modified: branches/7.7.x/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java
===================================================================
--- branches/7.7.x/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java 2012-07-03 15:29:32 UTC (rev 4219)
+++ branches/7.7.x/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java 2012-07-03 15:29:48 UTC (rev 4220)
@@ -65,4 +65,9 @@
out.writeObject(methodName);
ExternalizeUtil.writeArray(out, args);
}
+
+ @Override
+ public String toString() {
+ return "Invoke " + targetClass + "." + methodName; //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
\ No newline at end of file
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/SortUtility.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/SortUtility.java 2012-07-03 15:29:32 UTC (rev 4219)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/SortUtility.java 2012-07-03 15:29:48 UTC (rev 4220)
@@ -40,6 +40,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.util.Assertion;
import org.teiid.language.SortSpecification.NullOrdering;
+import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
import org.teiid.query.sql.lang.OrderBy;
@@ -177,10 +178,6 @@
this(ts, new OrderBy(expressions, types).getOrderByItems(), mode, bufferManager, connectionID, schema);
}
- public boolean isDone() {
- return this.doneReading && this.phase == DONE;
- }
-
public TupleBuffer sort()
throws TeiidComponentException, TeiidProcessingException {
@@ -204,11 +201,18 @@
initialSort();
}
+ for (TupleBuffer tb : activeTupleBuffers) {
+ tb.close();
+ }
+
return activeTupleBuffers;
}
private TupleBuffer createTupleBuffer() throws TeiidComponentException {
TupleBuffer tb = bufferManager.createTupleBuffer(this.schema, this.groupName, TupleSourceType.PROCESSOR);
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_DQP, "Created intermediate sort buffer ", tb.getId()); //$NON-NLS-1$
+ }
tb.setForwardOnly(true);
return tb;
}
Modified: branches/7.7.x/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
===================================================================
--- branches/7.7.x/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2012-07-03 15:29:32 UTC (rev 4219)
+++ branches/7.7.x/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2012-07-03 15:29:48 UTC (rev 4220)
@@ -75,10 +75,10 @@
}
public void send(Message message, Serializable messageKey) {
+ message.setMessageKey(messageKey);
if (LogManager.isMessageToBeRecorded(LogConstants.CTX_TRANSPORT, MessageLevel.DETAIL)) {
- LogManager.logDetail(LogConstants.CTX_TRANSPORT, " message: " + message + " for message:" + messageKey); //$NON-NLS-1$ //$NON-NLS-2$
+ LogManager.logDetail(LogConstants.CTX_TRANSPORT, "send message: " + message); //$NON-NLS-1$
}
- message.setMessageKey(messageKey);
objectSocket.write(message);
}
12 years, 6 months
teiid SVN: r4219 - in branches/7.7.x: engine/src/main/java/org/teiid/dqp/internal/process and 4 other directories.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2012-07-03 11:29:32 -0400 (Tue, 03 Jul 2012)
New Revision: 4219
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/BlockedException.java
branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/EnhancedSortMergeJoinStrategy.java
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/UnionAllNode.java
branches/7.7.x/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java
branches/7.7.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java
branches/7.7.x/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java
Log:
TEIID-2089 fix for query hanging with enhanced merge join
Modified: branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/BlockedException.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/BlockedException.java 2012-07-02 17:08:10 UTC (rev 4218)
+++ branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/BlockedException.java 2012-07-03 15:29:32 UTC (rev 4219)
@@ -22,6 +22,8 @@
package org.teiid.common.buffer;
+import java.util.Arrays;
+
import org.teiid.core.TeiidComponentException;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
@@ -45,9 +47,20 @@
public static BlockedException block(Object... msg) {
if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) {
- LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, msg);
+ LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, msg);
}
return INSTANCE;
}
+
+ public static BlockedException blockWithTrace(Object... msg) {
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_BUFFER_MGR, MessageLevel.DETAIL)) {
+ BlockedException be = new BlockedException();
+ if (be.getStackTrace().length > 0) {
+ be.setStackTrace(Arrays.copyOfRange(be.getStackTrace(), 1, Math.max(0, Math.min(8, be.getStackTrace().length))));
+ }
+ LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, be, msg);
+ }
+ return INSTANCE;
+ }
}
Modified: branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2012-07-02 17:08:10 UTC (rev 4218)
+++ branches/7.7.x/engine/src/main/java/org/teiid/common/buffer/TupleBuffer.java 2012-07-03 15:29:32 UTC (rev 4219)
@@ -318,7 +318,7 @@
if(isFinal) {
return null;
}
- throw BlockedException.block("Blocking on non-final TupleBuffer", tupleSourceID); //$NON-NLS-1$
+ throw BlockedException.blockWithTrace("Blocking on non-final TupleBuffer", tupleSourceID, "size", getRowCount()); //$NON-NLS-1$ //$NON-NLS-2$
}
@Override
Modified: branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2012-07-02 17:08:10 UTC (rev 4218)
+++ branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2012-07-03 15:29:32 UTC (rev 4219)
@@ -260,7 +260,7 @@
} else if (this.cwi.isDataAvailable()) {
continue;
}
- throw BlockedException.block(aqr.getAtomicRequestID(), "Blocking on DataNotAvailableException"); //$NON-NLS-1$
+ throw BlockedException.block(aqr.getAtomicRequestID(), "Blocking on DataNotAvailableException", aqr.getAtomicRequestID()); //$NON-NLS-1$
}
receiveResults(results, partial);
}
@@ -311,7 +311,7 @@
addWork();
}
if (!futureResult.isDone()) {
- throw BlockedException.block(aqr.getAtomicRequestID(), "Blocking on source query"); //$NON-NLS-1$
+ throw BlockedException.block(aqr.getAtomicRequestID(), "Blocking on source query", aqr.getAtomicRequestID()); //$NON-NLS-1$
}
FutureWork<AtomicResultsMessage> currentResults = futureResult;
futureResult = null;
Modified: branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2012-07-02 17:08:10 UTC (rev 4218)
+++ branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2012-07-03 15:29:32 UTC (rev 4219)
@@ -556,7 +556,8 @@
&& this.getTupleBuffer().getManagedRowCount() >= OUTPUT_BUFFER_MAX_BATCHES * this.getTupleBuffer().getBatchSize()) {
if (!dqpCore.hasWaitingPlans(RequestWorkItem.this)) {
//requestMore will trigger more processing
- throw BlockedException.block(requestID, "Blocking due to full results buffer."); //$NON-NLS-1$
+ throw BlockedException.block(requestID, "Blocking due to full results TupleBuffer", //$NON-NLS-1$
+ this.getTupleBuffer().getId(), "rows", this.getTupleBuffer().getManagedRowCount(), "batch size", this.getTupleBuffer().getBatchSize()); //$NON-NLS-1$ //$NON-NLS-2$
}
if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
LogManager.logDetail(LogConstants.CTX_DQP, requestID, "Exceeding buffer limit since there are pending active plans."); //$NON-NLS-1$
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/EnhancedSortMergeJoinStrategy.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/EnhancedSortMergeJoinStrategy.java 2012-07-02 17:08:10 UTC (rev 4218)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/EnhancedSortMergeJoinStrategy.java 2012-07-03 15:29:32 UTC (rev 4219)
@@ -37,6 +37,9 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.logging.MessageLevel;
import org.teiid.query.optimizer.relational.rules.NewCalculateCostUtil;
import org.teiid.query.sql.lang.OrderBy;
import org.teiid.query.sql.symbol.ElementSymbol;
@@ -56,7 +59,7 @@
*/
public class EnhancedSortMergeJoinStrategy extends MergeJoinStrategy {
- private final class SingleTupleSource extends AbstractList<Object> implements TupleSource {
+ private static final class SingleTupleSource extends AbstractList<Object> implements TupleSource {
boolean returned;
private int[] indexes;
private List<?> keyTuple;
@@ -256,6 +259,9 @@
if (this.processingSortLeft != SortOption.NOT_SORTED && this.processingSortRight != SortOption.NOT_SORTED) {
super.loadRight();
super.loadLeft();
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_DQP, "degrading to merged join", this.joinNode.getID()); //$NON-NLS-1$
+ }
return; //degrade to merge join
}
if (this.processingSortLeft == SortOption.NOT_SORTED) {
@@ -267,6 +273,9 @@
} else {
super.loadRight(); //sort if needed
this.notSortedSource.sort(SortOption.NOT_SORTED); //do a single sort pass
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_DQP, "performing single pass sort right", this.joinNode.getID()); //$NON-NLS-1$
+ }
}
} else if (this.processingSortRight == SortOption.NOT_SORTED) {
this.sortedSource = this.leftSource;
@@ -288,6 +297,9 @@
} else {
super.loadLeft(); //sort if needed
this.notSortedSource.sort(SortOption.NOT_SORTED); //do a single sort pass
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_DQP, "performing single pass sort left", this.joinNode.nodeToString()); //$NON-NLS-1$
+ }
}
}
}
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/UnionAllNode.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/UnionAllNode.java 2012-07-02 17:08:10 UTC (rev 4218)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/processor/relational/UnionAllNode.java 2012-07-03 15:29:32 UTC (rev 4219)
@@ -129,7 +129,7 @@
} else if(activeSources > 0) {
// Didn't get a batch but there are active sources so we are blocked
- throw BlockedException.block(getContext().getRequestId(), "Blocking on union source."); //$NON-NLS-1$
+ throw BlockedException.block(getContext().getRequestId(), "Blocking on union source.", getID()); //$NON-NLS-1$
} else {
// No batch and no active sources - return empty termination batch (should never happen but just in case)
outputBatch = new TupleBatch(outputRow, Collections.EMPTY_LIST);
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java 2012-07-02 17:08:10 UTC (rev 4218)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java 2012-07-03 15:29:32 UTC (rev 4219)
@@ -131,7 +131,7 @@
insert.setTupleSource(new TempLoadTupleSource());
this.dataManager.registerRequest(this.internalProcessor.getContext(), insert, TempMetadataAdapter.TEMP_MODEL.getName(), null, 0, -1);
if (!doneLoading) {
- throw BlockedException.block("Blocking on result set load"); //$NON-NLS-1$
+ throw BlockedException.block(resultInfo.getResultSetName(), "Blocking on result set load"); //$NON-NLS-1$
}
internalProcessor.closeProcessing();
AlterTempTable att = new AlterTempTable(tempTable);
Modified: branches/7.7.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java
===================================================================
--- branches/7.7.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java 2012-07-02 17:08:10 UTC (rev 4218)
+++ branches/7.7.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java 2012-07-03 15:29:32 UTC (rev 4219)
@@ -743,25 +743,25 @@
this.rightTuples = data;
this.leftTuples = new List[17];
for (int i = 0; i < this.leftTuples.length; i++) {
- this.leftTuples[i] = Arrays.asList(i);
+ this.leftTuples[i] = Arrays.asList(i*4);
}
if (!indexDistinct) {
- this.leftTuples[1] = Arrays.asList(0);
+ this.leftTuples[3] = Arrays.asList(0);
}
this.leftTuples[11] = Arrays.asList((Integer)null);
expected = new List[] {
- Arrays.asList(13, 13),
- Arrays.asList(2, 2),
+ Arrays.asList(64, 64),
+ Arrays.asList(36, 36),
Arrays.asList(8, 8),
- Arrays.asList(14, 14),
- Arrays.asList(3, 3),
- Arrays.asList(9, 9),
- Arrays.asList(15, 15),
+ Arrays.asList(48, 48),
+ Arrays.asList(20, 20),
+ Arrays.asList(60, 60),
+ Arrays.asList(32, 32),
Arrays.asList(4, 4),
- Arrays.asList(10, 10),
Arrays.asList(16, 16),
- Arrays.asList(5, 5),
+ Arrays.asList(56, 56),
+ Arrays.asList(28, 28),
Arrays.asList(0, 0),
Arrays.asList(0, 0),
};
Modified: branches/7.7.x/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java
===================================================================
--- branches/7.7.x/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java 2012-07-02 17:08:10 UTC (rev 4218)
+++ branches/7.7.x/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestXMLTypeTranslations.java 2012-07-03 15:29:32 UTC (rev 4219)
@@ -85,7 +85,7 @@
})});
- List[] expected = new List[] { Arrays.asList(new Object[] {"<?xml version=\"1.0\" encoding=\"UTF-8\"?><XSDTypesNS:test xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:XSDTypesNS=\"http://www.metamatrix.com/XMLSchema/DataSets/XSDTypes\"><book><datetime>1903-04-04T11:06:10.006Z</datetime><double>-INF</double><float>INF</float><gday>---100</gday><gmonth>--100</gmonth><gmonthday>--04-04</gmonthday><gyear>0100</gyear><gyearmonth>1903-04Z</gyearmonth><string>1</string></book></XSDTypesNS:test>" })}; //$NON-NLS-1$
+ List<?>[] expected = new List[] { Arrays.asList(new Object[] {"<?xml version=\"1.0\" encoding=\"UTF-8\"?><XSDTypesNS:test xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:XSDTypesNS=\"http://www.metamatrix.com/XMLSchema/DataSets/XSDTypes\"><book><datetime>1903-04-04T11:06:10.006Z</datetime><double>-INF</double><float>INF</float><gday>---100</gday><gmonth>--100</gmonth><gmonthday>--04-04</gmonthday><gyear>0100</gyear><gyearmonth>1903-04Z</gyearmonth><string>1</string></book></XSDTypesNS:test>" })}; //$NON-NLS-1$
doProcess(metadata,
sql,
finder, dataMgr , expected, DEBUG);
12 years, 6 months
teiid SVN: r4218 - in trunk: build and 26 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-07-02 13:08:10 -0400 (Mon, 02 Jul 2012)
New Revision: 4218
Added:
trunk/build/assembly/embedded-dist.xml
trunk/build/kits/embedded/
trunk/build/kits/embedded/COPYRIGHT.txt
trunk/build/kits/embedded/LICENSE-lgpl-2.1.txt
trunk/build/kits/embedded/examples/
trunk/build/kits/embedded/examples/embedded-portfolio/
trunk/build/kits/embedded/examples/embedded-portfolio/data/
trunk/build/kits/embedded/examples/embedded-portfolio/data/customer-schema.sql
trunk/build/kits/embedded/examples/embedded-portfolio/data/marketdata-price.txt
trunk/build/kits/embedded/examples/embedded-portfolio/h2-1.3.161.jar
trunk/build/kits/embedded/examples/embedded-portfolio/run.bat
trunk/build/kits/embedded/examples/embedded-portfolio/run.sh
trunk/build/kits/embedded/examples/embedded-portfolio/src/
trunk/build/kits/embedded/examples/embedded-portfolio/src/org/
trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/
trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/
trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstarctDataSource.java
trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstractConnection.java
trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstractConnectionFactory.java
trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/TeiidEmbeddedPortfolio.java
trunk/build/kits/embedded/examples/readme.txt
trunk/build/kits/embedded/lib/
trunk/build/kits/embedded/lib/dependencies.txt
trunk/build/kits/embedded/readme.txt
trunk/engine/src/main/java/org/teiid/datatypes/
trunk/engine/src/main/java/org/teiid/datatypes/SystemDataTypes.java
trunk/engine/src/main/resources/org/teiid/datatypes/
trunk/engine/src/main/resources/org/teiid/datatypes/types.dat
trunk/jboss-integration/src/main/java/org/teiid/jboss/FileUDFMetaData.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/SystemVDBDeployer.java
Removed:
trunk/metadata/src/main/resources/org/teiid/metadata/types.dat
trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java
Modified:
trunk/build/assembly/jboss-as7/dist.xml
trunk/build/pom.xml
trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java
trunk/jboss-integration/pom.xml
trunk/jboss-integration/src/main/java/org/teiid/jboss/SystemVDBService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBParserDeployer.java
trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java
trunk/pom.xml
trunk/runtime/pom.xml
trunk/runtime/src/main/java/org/teiid/deployers/UDFMetaData.java
trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedConfiguration.java
trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedServer.java
trunk/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java
trunk/runtime/src/main/java/org/teiid/transport/ClientServiceRegistryImpl.java
trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java
trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
trunk/runtime/src/test/java/org/teiid/transport/TestFailover.java
trunk/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java
Log:
TEIID-2062: Adding depolyment kit for the "embedded" mode. Also added "Quick Start" as example.
Added: trunk/build/assembly/embedded-dist.xml
===================================================================
--- trunk/build/assembly/embedded-dist.xml (rev 0)
+++ trunk/build/assembly/embedded-dist.xml 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,111 @@
+<!--This script builds a zip for Teiid Server Installation -->
+<assembly>
+
+ <id>embedded-dist</id>
+
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <baseDirectory>teiid-${project.version}</baseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>target/kits/embedded</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>**/*.sh</include>
+ </includes>
+ <fileMode>755</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+
+ <fileSet>
+ <directory>target/kits/embedded</directory>
+ <outputDirectory>/</outputDirectory>
+ <excludes>
+ <exclude>**/*.sh</exclude>
+ </excludes>
+ <fileMode>0644</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+ </fileSets>
+
+ <moduleSets>
+
+ <moduleSet>
+ <useAllReactorProjects>true</useAllReactorProjects>
+ <includes>
+ <include>org.jboss.teiid:teiid-admin</include>
+ </includes>
+ <binaries>
+ <includeDependencies>false</includeDependencies>
+ <unpack>false</unpack>
+ <outputDirectory>lib</outputDirectory>
+ </binaries>
+ </moduleSet>
+
+ <!-- These are Teiid internal dependencies; to make JCA work -->
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid:teiid-runtime</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>true</includeDependencies>
+ <unpack>false</unpack>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <unpack>false</unpack>
+ <useTransitiveDependencies>true</useTransitiveDependencies>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ </dependencySet>
+ </dependencySets>
+ <outputDirectory>lib</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+ </moduleSet>
+
+ <!-- **************************************************************************
+ These are built in translators
+ **************************************************************************-->
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid.connectors:translator-jdbc</include>
+ <include>org.jboss.teiid.connectors:translator-loopback</include>
+ <include>org.jboss.teiid.connectors:translator-file</include>
+ <include>org.jboss.teiid.connectors:translator-ldap</include>
+ <include>org.jboss.teiid.connectors:translator-salesforce</include>
+ <include>org.jboss.teiid.connectors:salesforce-api</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>
+ <include>org.jboss.teiid.connectors:translator-jpa</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>optional</outputDirectory>
+ <fileMode>0644</fileMode>
+ </binaries>
+ </moduleSet>
+
+ </moduleSets>
+</assembly>
Property changes on: trunk/build/assembly/embedded-dist.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/build/assembly/jboss-as7/dist.xml
===================================================================
--- trunk/build/assembly/jboss-as7/dist.xml 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/build/assembly/jboss-as7/dist.xml 2012-07-02 17:08:10 UTC (rev 4218)
@@ -119,6 +119,13 @@
<unpack>false</unpack>
<dependencySets>
<dependencySet>
+ <excludes>
+ <exclude>javax.resource:connector-api</exclude>
+ <exclude>javax.transaction:jta</exclude>
+ <exclude>org.jboss.teiid:teiid-common-core</exclude>
+ <exclude>org.jboss.teiid:teiid-api</exclude>
+ <exclude>org.jboss.teiid:teiid-client</exclude>
+ </excludes>
<useProjectArtifact>true</useProjectArtifact>
<unpack>false</unpack>
<useTransitiveDependencies>true</useTransitiveDependencies>
Added: trunk/build/kits/embedded/COPYRIGHT.txt
===================================================================
--- trunk/build/kits/embedded/COPYRIGHT.txt (rev 0)
+++ trunk/build/kits/embedded/COPYRIGHT.txt 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,4 @@
+Portions Copyright (C) 2008-2009 Red Hat, Inc.
+Portions Copyright (C) 2000-2007 MetaMatrix, Inc.
+Portions Copyright (c) 2000, 2003, 2008 IBM Corporation and others.
+Portions Copyright (c) 1997-2000 Sun Microsystems, Inc.
\ No newline at end of file
Property changes on: trunk/build/kits/embedded/COPYRIGHT.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/embedded/LICENSE-lgpl-2.1.txt
===================================================================
--- trunk/build/kits/embedded/LICENSE-lgpl-2.1.txt (rev 0)
+++ trunk/build/kits/embedded/LICENSE-lgpl-2.1.txt 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
Property changes on: trunk/build/kits/embedded/LICENSE-lgpl-2.1.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/embedded/examples/embedded-portfolio/data/customer-schema.sql
===================================================================
--- trunk/build/kits/embedded/examples/embedded-portfolio/data/customer-schema.sql (rev 0)
+++ trunk/build/kits/embedded/examples/embedded-portfolio/data/customer-schema.sql 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,156 @@
+DROP TABLE IF EXISTS CUSTOMER;
+CREATE TABLE CUSTOMER
+(
+ SSN char(10),
+ FIRSTNAME varchar(64),
+ LASTNAME varchar(64),
+ ST_ADDRESS varchar(256),
+ APT_NUMBER varchar(32),
+ CITY varchar(64),
+ STATE varchar(32),
+ ZIPCODE varchar(10),
+ PHONE varchar(15),
+ CONSTRAINT CUSTOMER_PK PRIMARY KEY(SSN)
+);
+
+DROP TABLE IF EXISTS ACCOUNT;
+CREATE TABLE ACCOUNT
+(
+ ACCOUNT_ID integer,
+ SSN char(10),
+ STATUS char(10),
+ TYPE char(10),
+ DATEOPENED timestamp,
+ DATECLOSED timestamp,
+ CONSTRAINT ACCOUNT_PK PRIMARY KEY(ACCOUNT_ID),
+ CONSTRAINT CUSTOMER_FK FOREIGN KEY (SSN) REFERENCES CUSTOMER (SSN)
+);
+
+DROP TABLE IF EXISTS PRODUCT;
+CREATE TABLE PRODUCT (
+ ID integer,
+ SYMBOL varchar(16),
+ COMPANY_NAME varchar(256),
+ CONSTRAINT PRODUCT_PK PRIMARY KEY(ID)
+);
+
+DROP TABLE IF EXISTS HOLDINGS;
+CREATE TABLE HOLDINGS
+(
+ TRANSACTION_ID integer IDENTITY,
+ ACCOUNT_ID integer,
+ PRODUCT_ID integer,
+ PURCHASE_DATE timestamp,
+ SHARES_COUNT integer,
+ CONSTRAINT HOLDINGS_PK PRIMARY KEY (TRANSACTION_ID),
+ CONSTRAINT ACCOUNT_FK FOREIGN KEY (ACCOUNT_ID) REFERENCES ACCOUNT (ACCOUNT_ID),
+ CONSTRAINT PRODUCT_FK FOREIGN KEY (PRODUCT_ID) REFERENCES PRODUCT (ID)
+);
+
+
+
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01002','Joseph','Smith','1234 Main Street','Apartment 56','New York','New York','10174','(646)555-1776');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01003','Nicholas','Ferguson','202 Palomino Drive',null,'Pittsburgh','Pennsylvania','15071','(412)555-4327');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01004','Jane','Aire','15 State Street',null,'Philadelphia','Pennsylvania','19154','(814)555-6789');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01005','Charles','Jones','1819 Maple Street','Apartment 17F','Stratford','Connecticut','06614','(203)555-3947');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01006','Virginia','Jefferson','1710 South 51st Street','Apartment 3245','New York','New York','10175','(718)555-2693');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01007','Ralph','Bacon','57 Barn Swallow Avenue',null,'Charlotte','North Carolina','28205','(704)555-4576');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01008','Bonnie','Dragon','88 Cinderella Lane',null,'Jacksonville','Florida','32225','(904)555-6514');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01009','Herbert','Smith','12225 Waterfall Way','Building 100, Suite 9','Portland','Oregon','97220','(971)555-7803');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01015','Jack','Corby','1 Lone Star Way',null,'Dallas','Texas','75231','(469)555-8023');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01019','Robin','Evers','1814 Falcon Avenue',null,'Atlanta','Georgia','30355','(470)555-4390');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01020','Lloyd','Abercrombie','1954 Hughes Parkway',null,'Los Angeles','California','90099','(213)555-2312');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01021','Scott','Watters','24 Mariner Way',null,'Seattle','Washington','98124','(206)555-6790');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01022','Sandra','King','96 Lakefront Parkway',null,'Minneapolis','Minnesota','55426','(651)555-9017');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01027','Maryanne','Peters','35 Grand View Circle','Apartment 5F','Cincinnati','Ohio','45232','(513)555-9067');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01034','Corey','Snyder','1760 Boston Commons Avenue','Suite 543','Boston','Massachusetts','02136 ','(617)555-3546');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01035','Henry','Thomas','345 Hilltop Parkway',null,'San Francisco','California','94129','(415)555-2093');
+INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01036','James','Drew','876 Lakefront Lane',null,'Cleveland','Ohio','44107','(216)555-6523');
+
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (19980002,'CST01002','Personal ','Active ', '1998-02-01 00:00:00.000', NULL);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (19980003,'CST01003','Personal ','Active ','1998-03-06 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (19980004,'CST01004','Personal ','Active ','1998-03-07 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (19980005,'CST01005','Personal ','Active ','1998-06-15 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (19980006,'CST01006','Personal ','Active ','1998-09-15 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (19990007,'CST01007','Personal ','Active ','1999-01-20 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (19990008,'CST01008','Personal ','Active ','1999-04-16 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (19990009,'CST01009','Business ','Active ','1999-06-25 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (20000015,'CST01015','Personal ','Closed ','2000-04-20 00:00:00.000','2001-06-22 00:00:00.000');
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (20000019,'CST01019','Personal ','Active ','2000-10-08 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (20000020,'CST01020','Personal ','Active ','2000-10-20 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (20000021,'CST01021','Personal ','Active ','2000-12-05 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (20010022,'CST01022','Personal ','Active ','2001-01-05 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (20010027,'CST01027','Personal ','Active ','2001-08-22 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (20020034,'CST01034','Business ','Active ','2002-01-22 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (20020035,'CST01035','Personal ','Active ','2002-02-12 00:00:00.000',null);
+INSERT INTO ACCOUNT (ACCOUNT_ID,SSN,STATUS,TYPE,DATEOPENED,DATECLOSED) VALUES (20020036,'CST01036','Personal ','Active ','2002-03-22 00:00:00.000',null);
+
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1002,'BA','The Boeing Company');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1003,'MON','Monsanto Company');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1004,'PNRA','Panera Bread Company');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1005,'SY','Sybase Incorporated');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1006,'BTU','Peabody Energy');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1007,'IBM','International Business Machines Corporation');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1008,'DELL','Dell Computer Corporation');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1010,'HPQ','Hewlett-Packard Company');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1011,'GTW','Gateway, Incorporated');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1012,'GE','General Electric Company');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1013,'MRK','Merck and Company Incorporated');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1014,'DIS','Walt Disney Company');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1015,'MCD','McDonalds Corporation');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1016,'DOW','Dow Chemical Company');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1018,'GM','General Motors Corporation');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1024,'SBGI','Sinclair Broadcast Group Incorporated');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1025,'COLM','Columbia Sportsware Company');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1026,'COLB','Columbia Banking System Incorporated');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1028,'BSY','British Sky Broadcasting Group PLC');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1029,'CSVFX','Columbia Strategic Value Fund');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1030,'CMTFX','Columbia Technology Fund');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1031,'F','Ford Motor Company');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1033,'FCZ','Ford Motor Credit Company');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1034,'SAP','SAP AG');
+INSERT INTO PRODUCT (ID,SYMBOL,COMPANY_NAME) VALUES(1036,'TM','Toyota Motor Corporation');
+
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980002,1008,'1998-02-01 00:00:00.000',50);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980002,1036,'1998-02-01 00:00:00.000',25);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980003,1002,'1998-03-06 00:00:00.000',100);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980003,1029,'1998-03-06 00:00:00.000',25);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980003,1016,'1998-03-06 00:00:00.000',51);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980004,1011,'1998-03-07 00:00:00.000',30);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980005,1024,'1998-06-15 00:00:00.000',18);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980006,1033,'1998-09-15 00:00:00.000',200);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990007,1031,'1999-01-20 00:00:00.000',65);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990008,1012,'1999-04-16 00:00:00.000',102);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990007,1008,'1999-05-11 00:00:00.000',85);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990008,1005,'1999-05-21 00:00:00.000',105);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990009,1004,'1999-06-25 00:00:00.000',120);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980003,1024,'1999-07-22 00:00:00.000',150);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000015,1018,'2000-04-20 00:00:00.000',135);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980006,1030,'2000-06-12 00:00:00.000',91);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000019,1029,'2000-10-08 00:00:00.000',351);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000020,1030,'2000-10-20 00:00:00.000',127);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000020,1018,'2000-11-14 00:00:00.000',100);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000019,1031,'2000-11-15 00:00:00.000',125);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000021,1028,'2000-12-05 00:00:00.000',400);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010022,1006,'2001-01-05 00:00:00.000',237);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990008,1015,'2001-01-23 00:00:00.000',180);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980005,1025,'2001-03-23 00:00:00.000',125);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010027,1024,'2001-08-22 00:00:00.000',70);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000020,1006,'2001-11-14 00:00:00.000',125);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980003,1029,'2001-11-15 00:00:00.000',100);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000021,1011,'2001-12-18 00:00:00.000',44);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010027,1028,'2001-12-19 00:00:00.000',115);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020034,1024,'2002-01-22 00:00:00.000',189);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990009,1029,'2002-01-24 00:00:00.000',30);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020035,1013,'2002-02-12 00:00:00.000',110);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020035,1034,'2002-02-13 00:00:00.000',70);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020034,1003,'2002-02-22 00:00:00.000',25);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000019,1013,'2002-02-26 00:00:00.000',195);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980004,1007,'2002-03-05 00:00:00.000',250);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000021,1014,'2002-03-12 00:00:00.000',300);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010027,1024,'2002-03-14 00:00:00.000',136);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020036,1012,'2002-03-22 00:00:00.000',54);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020036,1010,'2002-03-26 00:00:00.000',189);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980005,1010,'2002-04-01 00:00:00.000',26);
+
+
Added: trunk/build/kits/embedded/examples/embedded-portfolio/data/marketdata-price.txt
===================================================================
--- trunk/build/kits/embedded/examples/embedded-portfolio/data/marketdata-price.txt (rev 0)
+++ trunk/build/kits/embedded/examples/embedded-portfolio/data/marketdata-price.txt 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,11 @@
+SYMBOL,PRICE
+RHT,30.00
+BA,42.75
+MON,78.75
+PNRA,84.97
+SY,24.30
+BTU,41.25
+IBM,80.89
+DELL,10.75
+HPQ,31.52
+GE,16.45
Property changes on: trunk/build/kits/embedded/examples/embedded-portfolio/data/marketdata-price.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/embedded/examples/embedded-portfolio/h2-1.3.161.jar
===================================================================
(Binary files differ)
Property changes on: trunk/build/kits/embedded/examples/embedded-portfolio/h2-1.3.161.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/build/kits/embedded/examples/embedded-portfolio/run.bat
===================================================================
--- trunk/build/kits/embedded/examples/embedded-portfolio/run.bat (rev 0)
+++ trunk/build/kits/embedded/examples/embedded-portfolio/run.bat 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,6 @@
+TEIID_PATH=..\..\lib\*;..\..\optional\translator-file-8.1.0.Alpha3-SNAPSHOT.jar;..\..\optional\translator-jdbc-8.1.0.Alpha3-SNAPSHOT.jar;h2-1.3.161.jar
+
+javac -cp %TEIID_PATH% src\org\teiid\example\*.java
+
+java -cp .\src;%TEIID_PATH% org.teiid.example.TeiidEmbeddedPortfolio %*
+
Added: trunk/build/kits/embedded/examples/embedded-portfolio/run.sh
===================================================================
--- trunk/build/kits/embedded/examples/embedded-portfolio/run.sh (rev 0)
+++ trunk/build/kits/embedded/examples/embedded-portfolio/run.sh 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+TEIID_PATH=../../lib/*:../../optional/translator-file-8.1.0.Alpha3-SNAPSHOT.jar:../../optional/translator-jdbc-8.1.0.Alpha3-SNAPSHOT.jar:h2-1.3.161.jar
+
+javac -cp ${TEIID_PATH} src/org/teiid/example/*.java
+
+java -cp ./src:${TEIID_PATH} org.teiid.example.TeiidEmbeddedPortfolio "$@"
Added: trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstarctDataSource.java
===================================================================
--- trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstarctDataSource.java (rev 0)
+++ trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstarctDataSource.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,67 @@
+/*
+ * 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.example;
+
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+public abstract class AbstarctDataSource implements DataSource {
+
+ @Override
+ public PrintWriter getLogWriter() throws SQLException {
+ return null;
+ }
+
+ @Override
+ public void setLogWriter(PrintWriter out) throws SQLException {
+ }
+
+ @Override
+ public void setLoginTimeout(int seconds) throws SQLException {
+ }
+
+ @Override
+ public int getLoginTimeout() throws SQLException {
+ return 0;
+ }
+
+ @Override
+ public <T> T unwrap(Class<T> iface) throws SQLException {
+ return null;
+ }
+
+ @Override
+ public boolean isWrapperFor(Class<?> iface) throws SQLException {
+ return false;
+ }
+
+ @Override
+ public abstract Connection getConnection() throws SQLException;
+
+ @Override
+ public Connection getConnection(String username, String password) throws SQLException {
+ return null;
+ }
+}
Property changes on: trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstarctDataSource.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstractConnection.java
===================================================================
--- trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstractConnection.java (rev 0)
+++ trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstractConnection.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,27 @@
+package org.teiid.example;
+
+import javax.resource.ResourceException;
+import javax.resource.cci.*;
+
+public abstract class AbstractConnection implements Connection {
+
+ @Override
+ public Interaction createInteraction() throws ResourceException {
+ return null;
+ }
+
+ @Override
+ public LocalTransaction getLocalTransaction() throws ResourceException {
+ return null;
+ }
+
+ @Override
+ public ConnectionMetaData getMetaData() throws ResourceException {
+ return null;
+ }
+
+ @Override
+ public ResultSetInfo getResultSetInfo() throws ResourceException {
+ return null;
+ }
+}
Property changes on: trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstractConnection.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstractConnectionFactory.java
===================================================================
--- trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstractConnectionFactory.java (rev 0)
+++ trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstractConnectionFactory.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,59 @@
+/*
+ * 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.example;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.resource.ResourceException;
+import javax.resource.cci.*;
+
+public abstract class AbstractConnectionFactory<C extends javax.resource.cci.Connection> implements ConnectionFactory {
+ private static final long serialVersionUID = 4906165501503764939L;
+
+ @Override
+ public void setReference(Reference reference) {
+ }
+
+ @Override
+ public Reference getReference() throws NamingException {
+ return null;
+ }
+
+ @Override
+ public abstract C getConnection() throws ResourceException;
+
+ @Override
+ public C getConnection(ConnectionSpec properties)
+ throws ResourceException {
+ return null;
+ }
+
+ @Override
+ public RecordFactory getRecordFactory() throws ResourceException {
+ return null;
+ }
+
+ @Override
+ public ResourceAdapterMetaData getMetaData() throws ResourceException {
+ return null;
+ }
+}
Property changes on: trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/AbstractConnectionFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/TeiidEmbeddedPortfolio.java
===================================================================
--- trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/TeiidEmbeddedPortfolio.java (rev 0)
+++ trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/TeiidEmbeddedPortfolio.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,217 @@
+/*
+ * 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.example;
+
+import java.io.File;
+import java.sql.*;
+import java.util.StringTokenizer;
+
+import javax.resource.ResourceException;
+import javax.resource.cci.ConnectionFactory;
+import javax.sql.DataSource;
+
+import org.teiid.adminapi.Model.Type;
+import org.teiid.adminapi.impl.ModelMetaData;
+import org.teiid.core.util.ObjectConverterUtil;
+import org.teiid.jdbc.TeiidDriver;
+import org.teiid.runtime.EmbeddedConfiguration;
+import org.teiid.runtime.EmbeddedServer;
+import org.teiid.runtime.EmbeddedServer.ConnectionFactoryProvider;
+import org.teiid.translator.FileConnection;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.file.FileExecutionFactory;
+import org.teiid.translator.jdbc.h2.H2ExecutionFactory;
+
+/**
+ * This example is same as "Teiid Quick Start Example", you can find at http://jboss.org/teiid/quickstart
+ * whereas the example shows how to use Dynamic VDB using a server based deployment, this below code shows to use same
+ * example using Embedded Teiid. This uses a memory based H2 database and File source as sources and provides a
+ * view layer using DDL.
+ *
+ * Note that this example shows how to integrate the traditional sources like jdbc, file, web-service etc, however you are
+ * not limited to only those sources. As long as you can extended and provide implementaions for
+ * - ConnectionfactoryProvider
+ * - Translator
+ * - Metadata Repository
+ *
+ * you can integrate any kind of sources together, or provide a JDBC interface on a source or expose with with known schema.
+ */
+@SuppressWarnings("nls")
+public class TeiidEmbeddedPortfolio {
+
+ /**
+ * If you are trying to use per-built translators in Teiid framework, then the connection semantics for that
+ * source already defined in a interface. The below examples show how you can define connection interfaces that translator
+ * can understands. If you are writing a custom translator and then you define the connection interface and
+ * connection provider based on that.
+ */
+ private static EmbeddedServer.ConnectionFactoryProvider<ConnectionFactory> getFileConnectionProvider(){
+ return new ConnectionFactoryProvider<ConnectionFactory>() {
+ @Override
+ public ConnectionFactory getConnectionFactory() throws TranslatorException {
+ return new AbstractConnectionFactory<FileConnection>() {
+ @Override
+ public FileConnection getConnection() throws ResourceException {
+ return new FileConnectionImpl();
+ }
+ };
+ }
+ };
+ }
+
+ private static EmbeddedServer.ConnectionFactoryProvider<DataSource> getJDBCProvider(){
+ return new ConnectionFactoryProvider<DataSource>() {
+ @Override
+ public DataSource getConnectionFactory() throws TranslatorException {
+ return new AbstarctDataSource() {
+
+ @Override
+ public Connection getConnection() throws SQLException {
+ try {
+ String url = "jdbc:h2:accounts";
+ Class.forName("org.h2.Driver");
+ return DriverManager.getConnection(url);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+ };
+ }
+ };
+ }
+
+ static class FileConnectionImpl extends AbstractConnection implements FileConnection {
+ @Override
+ public File getFile(String path) throws ResourceException {
+ return new File(path);
+ }
+ @Override
+ public void close() throws ResourceException {
+ }
+ }
+
+ /**
+ * VDB = Virtual Database, in Teiid a VDB contains one or more models which define the source characteristics, like
+ * connection to source, what translator need to be used, how to read/fetch metadata about the source. The
+ */
+ private static void buildDeployVDB(EmbeddedServer teiidServer) throws Exception {
+ // model for the file source
+ ModelMetaData fileModel = new ModelMetaData();
+ fileModel.setName("MarketData");
+ // ddl, native are two pre-built metadata repos types, you can build your own,
+ // then register it using "addMetadataRepository"
+ fileModel.setSchemaSourceType("native");
+ fileModel.addSourceMapping("text-connector", "file", "source-file");
+
+ // model for the h2 database
+ ModelMetaData jdbcModel = new ModelMetaData();
+ jdbcModel.setName("Accounts");
+ jdbcModel.setSchemaSourceType("native");
+ jdbcModel.addSourceMapping("h2-connector", "h2", "source-jdbc");
+
+ // creating a virtual (logical) view model
+ ModelMetaData portfolioModel = new ModelMetaData();
+ portfolioModel.setName("MyView");
+ portfolioModel.setModelType(Type.VIRTUAL);
+ portfolioModel.setSchemaSourceType("ddl");
+ // For defining the view in DDL take a look at https://docs.jboss.org/author/display/TEIID/DDL+Metadata
+ portfolioModel.setSchemaText("create view \"portfolio\" OPTIONS (UPDATABLE 'true') as select product.symbol as symbol, stock.price as price, company_name from product, (call MarketData.getTextFiles('data/marketdata-price.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) stock where product.symbol=stock.symbol");
+
+ // deploy the VDB to the embedded server
+ teiidServer.deployVDB("example", fileModel, jdbcModel, portfolioModel);
+ }
+
+ private static void execute(Connection connection, String sql, boolean closeConn) throws Exception {
+ try {
+ Statement statement = connection.createStatement();
+
+ boolean hasResults = statement.execute(sql);
+ if (hasResults) {
+ ResultSet results = statement.getResultSet();
+ ResultSetMetaData metadata = results.getMetaData();
+ int columns = metadata.getColumnCount();
+ System.out.println("Results");
+ for (int row = 1; results.next(); row++) {
+ System.out.print(row + ": ");
+ for (int i = 0; i < columns; i++) {
+ if (i > 0) {
+ System.out.print(",");
+ }
+ System.out.print(results.getString(i+1));
+ }
+ System.out.println();
+ }
+ results.close();
+ }
+ statement.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ if (connection != null && closeConn) {
+ connection.close();
+ }
+ }
+ }
+
+ public static void main(String[] args) throws Exception {
+ // setup accounts database (if you already have external database this is not needed)
+ // for schema take look at "data/customer-schema.sql" file.
+ EmbeddedServer.ConnectionFactoryProvider<DataSource> jdbcProvider = getJDBCProvider();
+ Connection conn = jdbcProvider.getConnectionFactory().getConnection();
+ String schema = ObjectConverterUtil.convertFileToString(new File("data/customer-schema.sql"));
+ StringTokenizer st = new StringTokenizer(schema, ";");
+ while (st.hasMoreTokens()) {
+ String sql = st.nextToken();
+ execute(conn, sql.trim(), false);
+ }
+ conn.close();
+
+
+ // now start Teiid in embedded mode
+ EmbeddedConfiguration ec = new EmbeddedConfiguration();
+ ec.setUseDisk(true);
+
+ EmbeddedServer teiidServer = new EmbeddedServer();
+ teiidServer.start(ec);
+
+ // configure the connection provider and translator for file based source.
+ // NOTE: every source that is being integrated, needs its connection provider and its translator
+ // check out https://docs.jboss.org/author/display/TEIID/Built-in+Translators prebuit translators
+ teiidServer.addConnectionFactoryProvider("source-file", getFileConnectionProvider());
+ teiidServer.addTranslator(new FileExecutionFactory());
+
+ // configure the connection provider and translator for jdbc based source
+ teiidServer.addConnectionFactoryProvider("source-jdbc", jdbcProvider);
+ teiidServer.addTranslator(new H2ExecutionFactory());
+
+ buildDeployVDB(teiidServer);
+
+ // Now query the VDB
+ TeiidDriver td = teiidServer.getDriver();
+ Connection c = td.connect("jdbc:teiid:example", null);
+ execute(c, "select * from Product", false);
+ execute(c, "select * from MyView.portfolio", true);
+ }
+
+}
Property changes on: trunk/build/kits/embedded/examples/embedded-portfolio/src/org/teiid/example/TeiidEmbeddedPortfolio.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/embedded/examples/readme.txt
===================================================================
--- trunk/build/kits/embedded/examples/readme.txt (rev 0)
+++ trunk/build/kits/embedded/examples/readme.txt 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,4 @@
+This example tries to replicate the functionality of the "teiid's quick start example" from http://www.jboss.org/teiid/quickstart
+
+Take look at the above link and see the usecase, try to set up your data sources. Note that the directions from above may be very
+specific to using a JBoss AS, however with this example the details about the JBoss AS will be omitted.
\ No newline at end of file
Property changes on: trunk/build/kits/embedded/examples/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/embedded/lib/dependencies.txt
===================================================================
--- trunk/build/kits/embedded/lib/dependencies.txt (rev 0)
+++ trunk/build/kits/embedded/lib/dependencies.txt 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,3 @@
+If you are not using XQuery, there is no need to include "saxonhe-9.2.1.5.jar" jar file in the class path. All other files need
+to be included in your applications's classpath. Depending upon which sources you use with the Teiid embedded, you also need
+to add translators jar files from optional directory.
\ No newline at end of file
Property changes on: trunk/build/kits/embedded/lib/dependencies.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/embedded/readme.txt
===================================================================
--- trunk/build/kits/embedded/readme.txt (rev 0)
+++ trunk/build/kits/embedded/readme.txt 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,17 @@
+This distribution is to collect all the necessary jar files needed to deploy the Teiid in the embedded mode. Note that, Teiid
+embedded does not require JBoss AS to run. This also brings in many issues to be resolved in the host environment, like
+
+- Connections to your sources
+- Providing the metadata
+- Transaction manager
+
+The user is responsible for providing alternative provisions for features to execute properly.
+
+Also there will be not be any functionality provided in these areas
+
+- Access through Admin API
+- Authentication
+- Connection pools
+-
+
+
\ No newline at end of file
Property changes on: trunk/build/kits/embedded/readme.txt
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/build/pom.xml 2012-07-02 17:08:10 UTC (rev 4218)
@@ -68,6 +68,7 @@
<descriptor>assembly/client-jar.xml</descriptor>
<descriptor>assembly/jboss-as7/dist.xml</descriptor>
<descriptor>assembly/adminshell/adminshell-dist.xml</descriptor>
+ <descriptor>assembly/embedded-dist.xml</descriptor>
</descriptors>
</configuration>
@@ -127,6 +128,7 @@
<descriptor>assembly/console-jar.xml</descriptor>
<descriptor>assembly/jboss-as7/dist.xml</descriptor>
<descriptor>assembly/adminshell/adminshell-dist.xml</descriptor>
+ <descriptor>assembly/embedded-dist.xml</descriptor>
</descriptors>
</configuration>
</plugin>
Added: trunk/engine/src/main/java/org/teiid/datatypes/SystemDataTypes.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/datatypes/SystemDataTypes.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/datatypes/SystemDataTypes.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,59 @@
+/*
+ * 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.datatypes;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.Charset;
+import java.util.Properties;
+
+import org.teiid.core.util.PropertiesUtils;
+import org.teiid.metadata.Datatype;
+import org.teiid.metadata.MetadataStore;
+
+public class SystemDataTypes {
+ public static void loadSystemDatatypes(MetadataStore ms) throws IOException {
+ InputStream is = SystemDataTypes.class.getClassLoader().getResourceAsStream("org/teiid/datatypes/types.dat"); //$NON-NLS-1$
+ try {
+ InputStreamReader isr = new InputStreamReader(is, Charset.forName("UTF-8")); //$NON-NLS-1$
+ BufferedReader br = new BufferedReader(isr);
+ String s = br.readLine();
+ String[] props = s.split("\\|"); //$NON-NLS-1$
+ while ((s = br.readLine()) != null) {
+ Datatype dt = new Datatype();
+ String[] vals = s.split("\\|"); //$NON-NLS-1$
+ Properties p = new Properties();
+ for (int i = 0; i < props.length; i++) {
+ if (vals[i].length() != 0) {
+ p.setProperty(props[i], new String(vals[i]));
+ }
+ }
+ PropertiesUtils.setBeanProperties(dt, p, null);
+ ms.addDatatype(dt);
+ }
+ } finally {
+ is.close();
+ }
+ }
+}
Property changes on: trunk/engine/src/main/java/org/teiid/datatypes/SystemDataTypes.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -384,7 +384,9 @@
}
v = props.remove("FIXED_LENGTH"); //$NON-NLS-1$
- c.setFixedLength(isTrue(v));
+ if (v != null) {
+ c.setFixedLength(isTrue(v));
+ }
v = props.remove("SEARCHABLE"); //$NON-NLS-1$
if (v != null) {
Copied: trunk/engine/src/main/resources/org/teiid/datatypes/types.dat (from rev 4200, trunk/metadata/src/main/resources/org/teiid/metadata/types.dat)
===================================================================
--- trunk/engine/src/main/resources/org/teiid/datatypes/types.dat (rev 0)
+++ trunk/engine/src/main/resources/org/teiid/datatypes/types.dat 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,54 @@
+UUID|annotation|autoIncrement|basetypeName|caseSensitive|javaClassName|length|name|nameInSource|nullType|precisionLength|radix|runtimeTypeName|scale|searchType|signed|type|varietyType
+mmuuid:43f5274e-55e1-1f87-ba1c-eea49143eb32||false|string|false|org.teiid.core.types.XMLType|0|XMLLiteral|XMLLiteral|No_Nulls|0|0|xml|0|Searchable|false|UserDefined|Atomic
+mmuuid:f2249740-a078-1e26-9b08-d6079ebe1f0d||false|decimal|false|java.math.BigDecimal|0|bigdecimal|bigdecimal|No_Nulls|0|0|bigdecimal|0|Searchable|false|UserDefined|Atomic
+mmuuid:822b9a40-a066-1e26-9b08-d6079ebe1f0d||false|decimal|false|java.math.BigInteger|0|biginteger|biginteger|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
+mmuuid:5a793100-1836-1ed0-ba0f-f2334f5fbf95||false|base64Binary|false|org.teiid.core.types.BlobType|0|blob|blob|No_Nulls|0|0|blob|0|Searchable|false|UserDefined|Atomic
+mmuuid:62472700-a064-1e26-9b08-d6079ebe1f0d||false|string|false|java.lang.Character|0|char|char|No_Nulls|0|0|char|0|Searchable|false|UserDefined|Atomic
+mmuuid:559646c0-4941-1ece-b22b-f49159d22ad3||false|string|false|org.teiid.core.types.ClobType|0|clob|clob|No_Nulls|0|0|clob|0|Searchable|false|UserDefined|Atomic
+mmuuid:051a0640-b4e8-1e26-9f33-b76fd9d5fa79||false|base64Binary|false|java.lang.Object|0|object|object|No_Nulls|0|0|object|0|Searchable|false|UserDefined|Atomic
+mmuuid:6d9809c0-a07e-1e26-9b08-d6079ebe1f0d||false|string|false|java.sql.Timestamp|0|timestamp|timestamp|No_Nulls|0|0|timestamp|0|Searchable|false|UserDefined|Atomic
+mmuuid:20360100-e742-1e20-8c26-a038c6ed7576||false|ENTITY|false|java.lang.String|0|ENTITIES|ENTITIES|No_Nulls|0|0|string|0|Searchable|false|UserDefined|List
+mmuuid:9fece300-e71a-1e20-8c26-a038c6ed7576||false|NCName|false|java.lang.String|0|ENTITY|ENTITY|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:3c99f780-e72d-1e20-8c26-a038c6ed7576||false|IDREF|false|java.lang.String|0|IDREFS|IDREFS|No_Nulls|0|0|string|0|Searchable|false|UserDefined|List
+mmuuid:dd33ff40-e6df-1e20-8c26-a038c6ed7576||false|NCName|false|java.lang.String|0|IDREF|IDREF|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:88b13dc0-e702-1e20-8c26-a038c6ed7576||false|NCName|false|java.lang.String|0|ID|ID|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:ac00e000-e676-1e20-8c26-a038c6ed7576||false|Name|false|java.lang.String|0|NCName|NCName|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:4b0f8500-e6a6-1e20-8c26-a038c6ed7576||false|NMTOKEN|false|java.lang.String|0|NMTOKENS|NMTOKENS|No_Nulls|0|0|string|0|Searchable|false|UserDefined|List
+mmuuid:4ca2ae00-3a95-1e20-921b-eeee28353879||false|token|false|java.lang.String|0|NMTOKEN|NMTOKEN|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:3dcaf900-e8dc-1e2a-b433-fb67ea35c07e||false|anySimpleType|false|java.lang.String|0|NOTATION|NOTATION|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:e66c4600-e65b-1e20-8c26-a038c6ed7576||false|token|false|java.lang.String|0|Name|Name|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:eeb5d780-e8c3-1e2a-b433-fb67ea35c07e||false|anySimpleType|false|java.lang.String|0|QName|QName|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:6247ec80-e8a4-1e2a-b433-fb67ea35c07e||false|anySimpleType|false|java.lang.String|0|anyURI|anyURI|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:b4c99380-ebc6-1e2a-9319-8eaa9b2276c7||false|anySimpleType|false|java.lang.String|0|base64Binary|base64Binary|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:dc476100-c483-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.lang.Boolean|0|boolean|boolean|No_Nulls|0|0|boolean|0|Searchable|false|UserDefined|Atomic
+mmuuid:26dc1cc0-b9c8-1e21-b812-969c8fc8b016||false|short|false|java.lang.Byte|0|byte|byte|No_Nulls|0|0|byte|0|Searchable|false|UserDefined|Atomic
+mmuuid:5c69dec0-b3ea-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.sql.Timestamp|0|dateTime|dateTime|No_Nulls|0|0|timestamp|0|Searchable|false|UserDefined|Atomic
+mmuuid:65dcde00-c4ab-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.sql.Date|0|date|date|No_Nulls|0|0|date|0|Searchable|false|UserDefined|Atomic
+mmuuid:569dfa00-c456-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.math.BigDecimal|0|decimal|decimal|No_Nulls|0|0|bigdecimal|0|Searchable|false|UserDefined|Atomic
+mmuuid:1f18b140-c4a3-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.lang.Double|0|double|double|No_Nulls|0|0|double|0|Searchable|false|UserDefined|Atomic
+mmuuid:28d98540-b3e7-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.lang.String|0|duration|duration|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:d86b0d00-c48a-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.lang.Float|0|float|float|No_Nulls|0|0|float|0|Searchable|false|UserDefined|Atomic
+mmuuid:860b7dc0-b3f8-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.math.BigInteger|0|gDay|gDay|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
+mmuuid:6e604140-b3f5-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.sql.Timestamp|0|gMonthDay|gMonthDay|No_Nulls|0|0|timestamp|0|Searchable|false|UserDefined|Atomic
+mmuuid:187f5580-b3fb-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.math.BigInteger|0|gMonth|gMonth|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
+mmuuid:17d08040-b3ed-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.sql.Timestamp|0|gYearMonth|gYearMonth|No_Nulls|0|0|timestamp|0|Searchable|false|UserDefined|Atomic
+mmuuid:b02c7600-b3f2-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.math.BigInteger|0|gYear|gYear|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
+mmuuid:d9998500-ebba-1e2a-9319-8eaa9b2276c7||false|anySimpleType|false|java.lang.String|0|hexBinary|hexBinary|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:45da3500-e78f-1e20-8c26-a038c6ed7576||false|decimal|false|java.math.BigInteger|0|integer|integer|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
+mmuuid:33add3c0-b98d-1e21-b812-969c8fc8b016||false|long|false|java.lang.Integer|0|int|int|No_Nulls|0|0|integer|0|Searchable|false|UserDefined|Atomic
+mmuuid:d4d980c0-e623-1e20-8c26-a038c6ed7576||false|token|false|java.lang.String|0|language|language|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:8cdee840-b900-1e21-b812-969c8fc8b016||false|integer|false|java.lang.Long|0|long|long|No_Nulls|0|0|long|0|Searchable|false|UserDefined|Atomic
+mmuuid:86d29280-b8d3-1e21-b812-969c8fc8b016||false|nonPositiveInteger|false|java.math.BigInteger|0|negativeInteger|negativeInteger|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
+mmuuid:0e081200-b8a4-1e21-b812-969c8fc8b016||false|integer|false|java.math.BigInteger|0|nonNegativeInteger|nonNegativeInteger|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
+mmuuid:cbdd6e40-b9d2-1e21-8c26-a038c6ed7576||false|integer|false|java.math.BigInteger|0|nonPositiveInteger|nonPositiveInteger|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
+mmuuid:4df43700-3b13-1e20-921b-eeee28353879||false|string|false|java.lang.String|0|normalizedString|normalizedString|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:1cbbd380-b9ea-1e21-b812-969c8fc8b016||false|nonNegativeInteger|false|java.math.BigInteger|0|positiveInteger|positiveInteger|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
+mmuuid:5bbcf140-b9ae-1e21-b812-969c8fc8b016||false|int|false|java.lang.Short|0|short|short|No_Nulls|0|0|short|0|Searchable|false|UserDefined|Atomic
+mmuuid:bf6c34c0-c442-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.lang.String|0|string|string|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:3b892180-c4a7-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.sql.Time|0|time|time|No_Nulls|0|0|time|0|Searchable|false|UserDefined|Atomic
+mmuuid:3425cb80-d844-1e20-9027-be6d2c3b8b3a||false|normalizedString|false|java.lang.String|0|token|token|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
+mmuuid:cff745c0-baa2-1e21-b812-969c8fc8b016||false|unsignedShort|false|java.lang.Short|0|unsignedByte|unsignedByte|No_Nulls|0|0|short|0|Searchable|false|UserDefined|Atomic
+mmuuid:badcbd80-ba63-1e21-b812-969c8fc8b016||false|unsignedLong|false|java.lang.Long|0|unsignedInt|unsignedInt|No_Nulls|0|0|long|0|Searchable|false|UserDefined|Atomic
+mmuuid:54b98780-ba14-1e21-b812-969c8fc8b016||false|nonNegativeInteger|false|java.math.BigInteger|0|unsignedLong|unsignedLong|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
+mmuuid:327093c0-ba88-1e21-b812-969c8fc8b016||false|unsignedInt|false|java.lang.Integer|0|unsignedShort|unsignedShort|No_Nulls|0|0|integer|0|Searchable|false|UserDefined|Atomic
+mmuuid:182fd511-1a3e-447a-a6ea-72569d6a22ec||false|base64Binary|false|org.teiid.core.types.BinaryType|0|varbinary|varbinary|No_Nulls|0|0|varbinary|0|Searchable|false|UserDefined|Atomic
\ No newline at end of file
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/jboss-integration/pom.xml 2012-07-02 17:08:10 UTC (rev 4218)
@@ -35,11 +35,10 @@
</dependency>
<dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>provided</scope>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-metadata</artifactId>
</dependency>
-
+
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-dmr</artifactId>
@@ -47,6 +46,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.msc</groupId>
<artifactId>jboss-msc</artifactId>
<scope>provided</scope>
Added: trunk/jboss-integration/src/main/java/org/teiid/jboss/FileUDFMetaData.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/FileUDFMetaData.java (rev 0)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/FileUDFMetaData.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -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.jboss;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.xml.stream.XMLStreamException;
+
+import org.jboss.vfs.VirtualFile;
+import org.teiid.deployers.UDFMetaData;
+import org.teiid.metadata.FunctionMethod;
+import org.teiid.query.QueryPlugin;
+import org.teiid.query.function.metadata.FunctionMetadataReader;
+import org.teiid.query.function.metadata.FunctionMetadataValidator;
+import org.teiid.query.report.ActivityReport;
+import org.teiid.query.report.ReportItem;
+import org.teiid.runtime.RuntimePlugin;
+
+public class FileUDFMetaData extends UDFMetaData {
+
+ private HashMap<String, VirtualFile> files = new HashMap<String, VirtualFile>();
+
+ public void addModelFile(VirtualFile file) {
+ this.files.put(file.getPathName(), file);
+ }
+
+
+ public void buildFunctionModelFile(String name, String path) throws IOException, XMLStreamException {
+ for (String f:files.keySet()) {
+ if (f.endsWith(path)) {
+ path = f;
+ break;
+ }
+ }
+ VirtualFile file =this.files.get(path);
+ if (file == null) {
+ throw new IOException(RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40075, name));
+ }
+ List<FunctionMethod> udfMethods = FunctionMetadataReader.loadFunctionMethods(file.openStream());
+ ActivityReport<ReportItem> report = new ActivityReport<ReportItem>("UDF load"); //$NON-NLS-1$
+ FunctionMetadataValidator.validateFunctionMethods(udfMethods,report);
+ if(report.hasItems()) {
+ throw new IOException(QueryPlugin.Util.getString("ERR.015.001.0005", report)); //$NON-NLS-1$
+ }
+ this.methods.put(name, udfMethods);
+ }
+
+
+}
Property changes on: trunk/jboss-integration/src/main/java/org/teiid/jboss/FileUDFMetaData.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/jboss-integration/src/main/java/org/teiid/jboss/SystemVDBDeployer.java (from rev 4200, trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java)
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/SystemVDBDeployer.java (rev 0)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/SystemVDBDeployer.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -0,0 +1,91 @@
+/*
+ * 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.jboss;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.util.concurrent.Executors;
+
+import org.jboss.vfs.TempFileProvider;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+import org.teiid.core.CoreConstants;
+import org.teiid.core.TeiidRuntimeException;
+import org.teiid.deployers.VDBRepository;
+import org.teiid.metadata.index.IndexMetadataStore;
+import org.teiid.metadata.index.RuntimeMetadataPlugin;
+import org.teiid.runtime.RuntimePlugin;
+
+
+public class SystemVDBDeployer {
+ private VDBRepository vdbRepository;
+ private Closeable file;
+
+ private static final TempFileProvider PROVIDER;
+ static {
+ try {
+ PROVIDER = TempFileProvider.create("teiid-deployment", Executors.newScheduledThreadPool(2)); //$NON-NLS-1$
+ }
+ catch (final IOException ioe) {
+ throw new RuntimeException("Failed to create temp file provider");//$NON-NLS-1$
+ }
+ }
+
+ public void start() {
+ try {
+ VirtualFile mountPoint = VFS.getChild("content/" + CoreConstants.SYSTEM_VDB); //$NON-NLS-1$
+ if (!mountPoint.exists()) {
+ InputStream contents = Thread.currentThread().getContextClassLoader().getResourceAsStream(CoreConstants.SYSTEM_VDB);
+ if (contents == null) {
+ throw new TeiidRuntimeException(RuntimePlugin.Event.TEIID40021, RuntimeMetadataPlugin.Util.gs(RuntimePlugin.Event.TEIID40021));
+ }
+ this.file = VFS.mountZip(contents, CoreConstants.SYSTEM_VDB, mountPoint, PROVIDER);
+ }
+
+ IndexMetadataStore idxStore = new IndexMetadataStore(mountPoint);
+ idxStore.load(null, null);
+
+ // uri conversion is only to remove the spaces in URL, note this only with above kind situation
+ this.vdbRepository.setSystemStore(idxStore);
+ } catch (URISyntaxException e) {
+ throw new TeiidRuntimeException(RuntimePlugin.Event.TEIID40022, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40022));
+ } catch (IOException e) {
+ throw new TeiidRuntimeException(RuntimePlugin.Event.TEIID40022, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40022));
+ }
+ }
+
+ public void setVDBRepository(VDBRepository repo) {
+ this.vdbRepository = repo;
+ }
+
+ public void stop() {
+ try {
+ if (file != null) {
+ file.close();
+ }
+ } catch (IOException e) {
+ //ignore
+ }
+ }
+}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/SystemVDBService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/SystemVDBService.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/SystemVDBService.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -25,7 +25,6 @@
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
-import org.teiid.deployers.SystemVDBDeployer;
class SystemVDBService implements Service<SystemVDBDeployer> {
private SystemVDBDeployer deployer;
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -71,7 +71,6 @@
import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.common.buffer.BufferManager;
import org.teiid.common.buffer.TupleBufferCache;
-import org.teiid.deployers.SystemVDBDeployer;
import org.teiid.deployers.VDBRepository;
import org.teiid.deployers.VDBStatusChecker;
import org.teiid.dqp.internal.datamgr.TranslatorRepository;
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -34,6 +34,7 @@
import org.jboss.as.network.SocketBinding;
import org.jboss.as.security.plugins.SecurityDomainContext;
+import org.jboss.modules.Module;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
@@ -59,17 +60,11 @@
import org.teiid.net.socket.AuthenticationType;
import org.teiid.security.SecurityHelper;
import org.teiid.services.SessionServiceImpl;
-import org.teiid.transport.ClientServiceRegistry;
-import org.teiid.transport.ClientServiceRegistryImpl;
-import org.teiid.transport.LocalServerConnection;
-import org.teiid.transport.LogonImpl;
-import org.teiid.transport.ODBCSocketListener;
-import org.teiid.transport.SocketConfiguration;
-import org.teiid.transport.SocketListener;
+import org.teiid.transport.*;
public class TransportService implements Service<ClientServiceRegistry>, ClientServiceRegistry {
private enum Protocol {teiid, pg};
- private ClientServiceRegistryImpl csr = new ClientServiceRegistryImpl();
+ private ClientServiceRegistryImpl csr;
private transient ILogon logon;
private SocketConfiguration socketConfig;
final ConcurrentMap<String, SecurityDomainContext> securityDomains = new ConcurrentHashMap<String, SecurityDomainContext>();
@@ -110,9 +105,20 @@
VDBRepository repo = this.vdbRepositoryInjector.getValue();
repo.waitForFinished(vdbName, vdbVersion, timeOutMillis);
}
+
+ @Override
+ public ClassLoader getCallerClassloader() {
+ return csr.getCallerClassloader();
+ }
@Override
public void start(StartContext context) throws StartException {
+ this.csr = new ClientServiceRegistryImpl() {
+ @Override
+ public ClassLoader getCallerClassloader() {
+ return Module.getCallerModule().getClassLoader();
+ }
+ };
this.csr.setSecurityHelper(new JBossSecurityHelper());
this.sessionService = new JBossSessionService(this.securityDomains);
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBParserDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBParserDeployer.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBParserDeployer.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -99,10 +99,10 @@
else if (file.getName().toLowerCase().endsWith(VdbConstants.MODEL_EXT)) {
UDFMetaData udf = deploymentUnit.getAttachment(TeiidAttachments.UDF_METADATA);
if (udf == null) {
- udf = new UDFMetaData();
+ udf = new FileUDFMetaData();
deploymentUnit.putAttachment(TeiidAttachments.UDF_METADATA, udf);
}
- udf.addModelFile(file);
+ ((FileUDFMetaData)udf).addModelFile(file);
}
}
}
@@ -160,7 +160,7 @@
if (path == null) {
throw new DeploymentUnitProcessingException(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50075, model.getName()));
}
- udf.buildFunctionModelFile(model.getName(), path);
+ ((FileUDFMetaData)udf).buildFunctionModelFile(model.getName(), path);
}
}
}
Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataStore.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -22,21 +22,9 @@
package org.teiid.metadata.index;
-import java.io.BufferedReader;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.net.URISyntaxException;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
+import java.util.*;
import org.jboss.vfs.VirtualFile;
import org.jboss.vfs.VirtualFileFilter;
@@ -45,8 +33,8 @@
import org.teiid.core.TeiidException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.index.IEntryResult;
-import org.teiid.core.util.PropertiesUtils;
import org.teiid.core.util.StringUtil;
+import org.teiid.datatypes.SystemDataTypes;
import org.teiid.internal.core.index.Index;
import org.teiid.metadata.*;
import org.teiid.metadata.FunctionMethod.Determinism;
@@ -226,7 +214,7 @@
synchronized (this) {
if (!this.loaded) {
if (systemDatatypes == null) {
- loadSystemDatatypes(this);
+ SystemDataTypes.loadSystemDatatypes(this);
}
ArrayList<Index> tmp = new ArrayList<Index>();
for (VirtualFile f : indexFiles) {
@@ -272,30 +260,6 @@
}
}
- public static void loadSystemDatatypes(MetadataStore ms) throws IOException {
- InputStream is = IndexMetadataStore.class.getClassLoader().getResourceAsStream("org/teiid/metadata/types.dat"); //$NON-NLS-1$
- try {
- InputStreamReader isr = new InputStreamReader(is, Charset.forName("UTF-8")); //$NON-NLS-1$
- BufferedReader br = new BufferedReader(isr);
- String s = br.readLine();
- String[] props = s.split("\\|"); //$NON-NLS-1$
- while ((s = br.readLine()) != null) {
- Datatype dt = new Datatype();
- String[] vals = s.split("\\|"); //$NON-NLS-1$
- Properties p = new Properties();
- for (int i = 0; i < props.length; i++) {
- if (vals[i].length() != 0) {
- p.setProperty(props[i], new String(vals[i]));
- }
- }
- PropertiesUtils.setBeanProperties(dt, p, null);
- ms.addDatatype(dt);
- }
- } finally {
- is.close();
- }
- }
-
public void addIndexFile(VirtualFile f) {
this.indexFiles.add(f);
}
Deleted: trunk/metadata/src/main/resources/org/teiid/metadata/types.dat
===================================================================
--- trunk/metadata/src/main/resources/org/teiid/metadata/types.dat 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/metadata/src/main/resources/org/teiid/metadata/types.dat 2012-07-02 17:08:10 UTC (rev 4218)
@@ -1,54 +0,0 @@
-UUID|annotation|autoIncrement|basetypeName|caseSensitive|javaClassName|length|name|nameInSource|nullType|precisionLength|radix|runtimeTypeName|scale|searchType|signed|type|varietyType
-mmuuid:43f5274e-55e1-1f87-ba1c-eea49143eb32||false|string|false|org.teiid.core.types.XMLType|0|XMLLiteral|XMLLiteral|No_Nulls|0|0|xml|0|Searchable|false|UserDefined|Atomic
-mmuuid:f2249740-a078-1e26-9b08-d6079ebe1f0d||false|decimal|false|java.math.BigDecimal|0|bigdecimal|bigdecimal|No_Nulls|0|0|bigdecimal|0|Searchable|false|UserDefined|Atomic
-mmuuid:822b9a40-a066-1e26-9b08-d6079ebe1f0d||false|decimal|false|java.math.BigInteger|0|biginteger|biginteger|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
-mmuuid:5a793100-1836-1ed0-ba0f-f2334f5fbf95||false|base64Binary|false|org.teiid.core.types.BlobType|0|blob|blob|No_Nulls|0|0|blob|0|Searchable|false|UserDefined|Atomic
-mmuuid:62472700-a064-1e26-9b08-d6079ebe1f0d||false|string|false|java.lang.Character|0|char|char|No_Nulls|0|0|char|0|Searchable|false|UserDefined|Atomic
-mmuuid:559646c0-4941-1ece-b22b-f49159d22ad3||false|string|false|org.teiid.core.types.ClobType|0|clob|clob|No_Nulls|0|0|clob|0|Searchable|false|UserDefined|Atomic
-mmuuid:051a0640-b4e8-1e26-9f33-b76fd9d5fa79||false|base64Binary|false|java.lang.Object|0|object|object|No_Nulls|0|0|object|0|Searchable|false|UserDefined|Atomic
-mmuuid:6d9809c0-a07e-1e26-9b08-d6079ebe1f0d||false|string|false|java.sql.Timestamp|0|timestamp|timestamp|No_Nulls|0|0|timestamp|0|Searchable|false|UserDefined|Atomic
-mmuuid:20360100-e742-1e20-8c26-a038c6ed7576||false|ENTITY|false|java.lang.String|0|ENTITIES|ENTITIES|No_Nulls|0|0|string|0|Searchable|false|UserDefined|List
-mmuuid:9fece300-e71a-1e20-8c26-a038c6ed7576||false|NCName|false|java.lang.String|0|ENTITY|ENTITY|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:3c99f780-e72d-1e20-8c26-a038c6ed7576||false|IDREF|false|java.lang.String|0|IDREFS|IDREFS|No_Nulls|0|0|string|0|Searchable|false|UserDefined|List
-mmuuid:dd33ff40-e6df-1e20-8c26-a038c6ed7576||false|NCName|false|java.lang.String|0|IDREF|IDREF|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:88b13dc0-e702-1e20-8c26-a038c6ed7576||false|NCName|false|java.lang.String|0|ID|ID|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:ac00e000-e676-1e20-8c26-a038c6ed7576||false|Name|false|java.lang.String|0|NCName|NCName|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:4b0f8500-e6a6-1e20-8c26-a038c6ed7576||false|NMTOKEN|false|java.lang.String|0|NMTOKENS|NMTOKENS|No_Nulls|0|0|string|0|Searchable|false|UserDefined|List
-mmuuid:4ca2ae00-3a95-1e20-921b-eeee28353879||false|token|false|java.lang.String|0|NMTOKEN|NMTOKEN|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:3dcaf900-e8dc-1e2a-b433-fb67ea35c07e||false|anySimpleType|false|java.lang.String|0|NOTATION|NOTATION|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:e66c4600-e65b-1e20-8c26-a038c6ed7576||false|token|false|java.lang.String|0|Name|Name|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:eeb5d780-e8c3-1e2a-b433-fb67ea35c07e||false|anySimpleType|false|java.lang.String|0|QName|QName|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:6247ec80-e8a4-1e2a-b433-fb67ea35c07e||false|anySimpleType|false|java.lang.String|0|anyURI|anyURI|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:b4c99380-ebc6-1e2a-9319-8eaa9b2276c7||false|anySimpleType|false|java.lang.String|0|base64Binary|base64Binary|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:dc476100-c483-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.lang.Boolean|0|boolean|boolean|No_Nulls|0|0|boolean|0|Searchable|false|UserDefined|Atomic
-mmuuid:26dc1cc0-b9c8-1e21-b812-969c8fc8b016||false|short|false|java.lang.Byte|0|byte|byte|No_Nulls|0|0|byte|0|Searchable|false|UserDefined|Atomic
-mmuuid:5c69dec0-b3ea-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.sql.Timestamp|0|dateTime|dateTime|No_Nulls|0|0|timestamp|0|Searchable|false|UserDefined|Atomic
-mmuuid:65dcde00-c4ab-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.sql.Date|0|date|date|No_Nulls|0|0|date|0|Searchable|false|UserDefined|Atomic
-mmuuid:569dfa00-c456-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.math.BigDecimal|0|decimal|decimal|No_Nulls|0|0|bigdecimal|0|Searchable|false|UserDefined|Atomic
-mmuuid:1f18b140-c4a3-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.lang.Double|0|double|double|No_Nulls|0|0|double|0|Searchable|false|UserDefined|Atomic
-mmuuid:28d98540-b3e7-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.lang.String|0|duration|duration|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:d86b0d00-c48a-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.lang.Float|0|float|float|No_Nulls|0|0|float|0|Searchable|false|UserDefined|Atomic
-mmuuid:860b7dc0-b3f8-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.math.BigInteger|0|gDay|gDay|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
-mmuuid:6e604140-b3f5-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.sql.Timestamp|0|gMonthDay|gMonthDay|No_Nulls|0|0|timestamp|0|Searchable|false|UserDefined|Atomic
-mmuuid:187f5580-b3fb-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.math.BigInteger|0|gMonth|gMonth|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
-mmuuid:17d08040-b3ed-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.sql.Timestamp|0|gYearMonth|gYearMonth|No_Nulls|0|0|timestamp|0|Searchable|false|UserDefined|Atomic
-mmuuid:b02c7600-b3f2-1e2a-9a03-beb8638ffd21||false|anySimpleType|false|java.math.BigInteger|0|gYear|gYear|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
-mmuuid:d9998500-ebba-1e2a-9319-8eaa9b2276c7||false|anySimpleType|false|java.lang.String|0|hexBinary|hexBinary|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:45da3500-e78f-1e20-8c26-a038c6ed7576||false|decimal|false|java.math.BigInteger|0|integer|integer|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
-mmuuid:33add3c0-b98d-1e21-b812-969c8fc8b016||false|long|false|java.lang.Integer|0|int|int|No_Nulls|0|0|integer|0|Searchable|false|UserDefined|Atomic
-mmuuid:d4d980c0-e623-1e20-8c26-a038c6ed7576||false|token|false|java.lang.String|0|language|language|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:8cdee840-b900-1e21-b812-969c8fc8b016||false|integer|false|java.lang.Long|0|long|long|No_Nulls|0|0|long|0|Searchable|false|UserDefined|Atomic
-mmuuid:86d29280-b8d3-1e21-b812-969c8fc8b016||false|nonPositiveInteger|false|java.math.BigInteger|0|negativeInteger|negativeInteger|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
-mmuuid:0e081200-b8a4-1e21-b812-969c8fc8b016||false|integer|false|java.math.BigInteger|0|nonNegativeInteger|nonNegativeInteger|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
-mmuuid:cbdd6e40-b9d2-1e21-8c26-a038c6ed7576||false|integer|false|java.math.BigInteger|0|nonPositiveInteger|nonPositiveInteger|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
-mmuuid:4df43700-3b13-1e20-921b-eeee28353879||false|string|false|java.lang.String|0|normalizedString|normalizedString|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:1cbbd380-b9ea-1e21-b812-969c8fc8b016||false|nonNegativeInteger|false|java.math.BigInteger|0|positiveInteger|positiveInteger|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
-mmuuid:5bbcf140-b9ae-1e21-b812-969c8fc8b016||false|int|false|java.lang.Short|0|short|short|No_Nulls|0|0|short|0|Searchable|false|UserDefined|Atomic
-mmuuid:bf6c34c0-c442-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.lang.String|0|string|string|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:3b892180-c4a7-1e24-9b01-c8207cd53eb7||false|anySimpleType|false|java.sql.Time|0|time|time|No_Nulls|0|0|time|0|Searchable|false|UserDefined|Atomic
-mmuuid:3425cb80-d844-1e20-9027-be6d2c3b8b3a||false|normalizedString|false|java.lang.String|0|token|token|No_Nulls|0|0|string|0|Searchable|false|UserDefined|Atomic
-mmuuid:cff745c0-baa2-1e21-b812-969c8fc8b016||false|unsignedShort|false|java.lang.Short|0|unsignedByte|unsignedByte|No_Nulls|0|0|short|0|Searchable|false|UserDefined|Atomic
-mmuuid:badcbd80-ba63-1e21-b812-969c8fc8b016||false|unsignedLong|false|java.lang.Long|0|unsignedInt|unsignedInt|No_Nulls|0|0|long|0|Searchable|false|UserDefined|Atomic
-mmuuid:54b98780-ba14-1e21-b812-969c8fc8b016||false|nonNegativeInteger|false|java.math.BigInteger|0|unsignedLong|unsignedLong|No_Nulls|0|0|biginteger|0|Searchable|false|UserDefined|Atomic
-mmuuid:327093c0-ba88-1e21-b812-969c8fc8b016||false|unsignedInt|false|java.lang.Integer|0|unsignedShort|unsignedShort|No_Nulls|0|0|integer|0|Searchable|false|UserDefined|Atomic
-mmuuid:182fd511-1a3e-447a-a6ea-72569d6a22ec||false|base64Binary|false|org.teiid.core.types.BinaryType|0|varbinary|varbinary|No_Nulls|0|0|varbinary|0|Searchable|false|UserDefined|Atomic
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/pom.xml 2012-07-02 17:08:10 UTC (rev 4218)
@@ -358,13 +358,11 @@
<groupId>javax.resource</groupId>
<artifactId>connector-api</artifactId>
<version>${version.connector-api}</version>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>${version.jta}</version>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/runtime/pom.xml 2012-07-02 17:08:10 UTC (rev 4218)
@@ -13,7 +13,6 @@
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-common-core</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.teiid</groupId>
@@ -23,12 +22,10 @@
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-api</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-client</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.teiid</groupId>
@@ -45,38 +42,17 @@
<type>test-jar</type>
</dependency>
<dependency>
- <groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-metadata</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.modules</groupId>
- <artifactId>jboss-modules</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.resource</groupId>
- <artifactId>connector-api</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.resource</groupId>
<artifactId>connector-api</artifactId>
- <scope>provided</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Deleted: trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/runtime/src/main/java/org/teiid/deployers/SystemVDBDeployer.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -1,90 +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.deployers;
-
-import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URISyntaxException;
-import java.util.concurrent.Executors;
-
-import org.jboss.vfs.TempFileProvider;
-import org.jboss.vfs.VFS;
-import org.jboss.vfs.VirtualFile;
-import org.teiid.core.CoreConstants;
-import org.teiid.core.TeiidRuntimeException;
-import org.teiid.metadata.index.IndexMetadataStore;
-import org.teiid.metadata.index.RuntimeMetadataPlugin;
-import org.teiid.runtime.RuntimePlugin;
-
-
-public class SystemVDBDeployer {
- private VDBRepository vdbRepository;
- private Closeable file;
-
- private static final TempFileProvider PROVIDER;
- static {
- try {
- PROVIDER = TempFileProvider.create("teiid-deployment", Executors.newScheduledThreadPool(2)); //$NON-NLS-1$
- }
- catch (final IOException ioe) {
- throw new RuntimeException("Failed to create temp file provider");//$NON-NLS-1$
- }
- }
-
- public void start() {
- try {
- VirtualFile mountPoint = VFS.getChild("content/" + CoreConstants.SYSTEM_VDB); //$NON-NLS-1$
- if (!mountPoint.exists()) {
- InputStream contents = Thread.currentThread().getContextClassLoader().getResourceAsStream(CoreConstants.SYSTEM_VDB);
- if (contents == null) {
- throw new TeiidRuntimeException(RuntimePlugin.Event.TEIID40021, RuntimeMetadataPlugin.Util.gs(RuntimePlugin.Event.TEIID40021));
- }
- this.file = VFS.mountZip(contents, CoreConstants.SYSTEM_VDB, mountPoint, PROVIDER);
- }
-
- IndexMetadataStore idxStore = new IndexMetadataStore(mountPoint);
- idxStore.load(null, null);
-
- // uri conversion is only to remove the spaces in URL, note this only with above kind situation
- this.vdbRepository.setSystemStore(idxStore);
- } catch (URISyntaxException e) {
- throw new TeiidRuntimeException(RuntimePlugin.Event.TEIID40022, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40022));
- } catch (IOException e) {
- throw new TeiidRuntimeException(RuntimePlugin.Event.TEIID40022, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40022));
- }
- }
-
- public void setVDBRepository(VDBRepository repo) {
- this.vdbRepository = repo;
- }
-
- public void stop() {
- try {
- if (file != null) {
- file.close();
- }
- } catch (IOException e) {
- //ignore
- }
- }
-}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/UDFMetaData.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/UDFMetaData.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/runtime/src/main/java/org/teiid/deployers/UDFMetaData.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -21,55 +21,18 @@
*/
package org.teiid.deployers;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
-import javax.xml.stream.XMLStreamException;
-
-import org.jboss.vfs.VirtualFile;
import org.teiid.metadata.FunctionMethod;
-import org.teiid.query.QueryPlugin;
-import org.teiid.query.function.metadata.FunctionMetadataReader;
-import org.teiid.query.function.metadata.FunctionMetadataValidator;
-import org.teiid.query.report.ActivityReport;
-import org.teiid.query.report.ReportItem;
-import org.teiid.runtime.RuntimePlugin;
public class UDFMetaData {
- private HashMap<String, Collection <FunctionMethod>> methods = new HashMap<String, Collection<FunctionMethod>>();
- private HashMap<String, VirtualFile> files = new HashMap<String, VirtualFile>();
+ protected HashMap<String, Collection <FunctionMethod>> methods = new HashMap<String, Collection<FunctionMethod>>();
private ClassLoader classLoader;
-
- public void addModelFile(VirtualFile file) {
- this.files.put(file.getPathName(), file);
- }
-
-
- public void buildFunctionModelFile(String name, String path) throws IOException, XMLStreamException {
- for (String f:files.keySet()) {
- if (f.endsWith(path)) {
- path = f;
- break;
- }
- }
- VirtualFile file =this.files.get(path);
- if (file == null) {
- throw new IOException(RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40075, name));
- }
- List<FunctionMethod> udfMethods = FunctionMetadataReader.loadFunctionMethods(file.openStream());
- ActivityReport<ReportItem> report = new ActivityReport<ReportItem>("UDF load"); //$NON-NLS-1$
- FunctionMetadataValidator.validateFunctionMethods(udfMethods,report);
- if(report.hasItems()) {
- throw new IOException(QueryPlugin.Util.getString("ERR.015.001.0005", report)); //$NON-NLS-1$
- }
- this.methods.put(name, udfMethods);
- }
-
+
public Map<String, Collection <FunctionMethod>> getFunctions(){
return this.methods;
}
Modified: trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedConfiguration.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedConfiguration.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedConfiguration.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -43,6 +43,7 @@
private ObjectReplicator objectReplicator;
private WorkManager workManager;
private boolean useDisk = true;
+ private String bufferDirectory;
public SecurityHelper getSecurityHelper() {
return securityHelper;
@@ -112,4 +113,12 @@
public void setUseDisk(boolean useDisk) {
this.useDisk = useDisk;
}
+
+ public void setBufferDirectory(String dir) {
+ this.bufferDirectory = dir;
+ }
+
+ public String getBufferDirectory() {
+ return this.bufferDirectory;
+ }
}
Modified: trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedServer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedServer.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedServer.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -26,20 +26,11 @@
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
+import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
-import javax.transaction.RollbackException;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
+import javax.transaction.*;
import org.teiid.Replicated;
import org.teiid.Replicated.ReplicationMode;
@@ -47,28 +38,21 @@
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.cache.Cache;
import org.teiid.cache.CacheConfiguration;
-import org.teiid.cache.DefaultCacheFactory;
import org.teiid.cache.CacheConfiguration.Policy;
+import org.teiid.cache.DefaultCacheFactory;
import org.teiid.client.DQP;
import org.teiid.client.security.ILogon;
import org.teiid.common.buffer.BufferManager;
import org.teiid.common.buffer.TupleBufferCache;
-import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.BundleUtil.Event;
-import org.teiid.deployers.CompositeVDB;
-import org.teiid.deployers.UDFMetaData;
-import org.teiid.deployers.VDBLifeCycleListener;
-import org.teiid.deployers.VDBRepository;
-import org.teiid.deployers.VirtualDatabaseException;
+import org.teiid.core.TeiidRuntimeException;
+import org.teiid.datatypes.SystemDataTypes;
+import org.teiid.deployers.*;
import org.teiid.dqp.internal.datamgr.ConnectorManager;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository.ConnectorManagerException;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository.ExecutionFactoryProvider;
-import org.teiid.dqp.internal.process.CachedResults;
-import org.teiid.dqp.internal.process.DQPCore;
-import org.teiid.dqp.internal.process.PreparedPlan;
-import org.teiid.dqp.internal.process.SessionAwareCache;
-import org.teiid.dqp.internal.process.TransactionServerImpl;
+import org.teiid.dqp.internal.process.*;
import org.teiid.dqp.service.BufferService;
import org.teiid.dqp.service.TransactionContext;
import org.teiid.dqp.service.TransactionContext.Scope;
@@ -84,7 +68,6 @@
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.MetadataRepository;
import org.teiid.metadata.MetadataStore;
-import org.teiid.metadata.index.IndexMetadataStore;
import org.teiid.net.CommunicationException;
import org.teiid.net.ConnectionException;
import org.teiid.query.ObjectReplicator;
@@ -227,6 +210,10 @@
if (waitForLoad) {
repo.waitForFinished(vdbName, vdbVersion, timeOutMillis);
}
+ }
+ @Override
+ public ClassLoader getCallerClassloader() {
+ return this.getClass().getClassLoader();
};
};
protected LogonImpl logon;
@@ -305,7 +292,7 @@
if (dqpConfiguration.getSystemStore() == null) {
MetadataStore ms = new MetadataStore();
try {
- IndexMetadataStore.loadSystemDatatypes(ms);
+ SystemDataTypes.loadSystemDatatypes(ms);
} catch (IOException e) {
throw new TeiidRuntimeException(e);
}
@@ -340,6 +327,12 @@
this.sessionService.setVDBRepository(repo);
this.bufferService.setUseDisk(dqpConfiguration.isUseDisk());
+ if (dqpConfiguration.isUseDisk()) {
+ if (dqpConfiguration.getBufferDirectory() == null) {
+ dqpConfiguration.setBufferDirectory(System.getProperty("java.io.tmpdir")); //$NON-NLS-1$
+ }
+ this.bufferService.setDiskDirectory(dqpConfiguration.getBufferDirectory());
+ }
BufferService bs = getBufferService();
this.dqp.setBufferManager(bs.getBufferManager());
Modified: trunk/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/runtime/src/main/java/org/teiid/transport/ClientServiceRegistry.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -41,5 +41,7 @@
AuthenticationType getAuthenticationType();
void waitForFinished(String vdbName, int vdbVersion, int timeOutMillis) throws ConnectionException;
+
+ ClassLoader getCallerClassloader();
}
Modified: trunk/runtime/src/main/java/org/teiid/transport/ClientServiceRegistryImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/ClientServiceRegistryImpl.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/runtime/src/main/java/org/teiid/transport/ClientServiceRegistryImpl.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -32,7 +32,7 @@
import org.teiid.security.SecurityHelper;
-public class ClientServiceRegistryImpl implements ClientServiceRegistry {
+public abstract class ClientServiceRegistryImpl implements ClientServiceRegistry {
public static class ClientService {
private Object instance;
Modified: trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -32,7 +32,6 @@
import javax.crypto.SealedObject;
-import org.jboss.modules.Module;
import org.teiid.adminapi.AdminProcessingException;
import org.teiid.client.util.ExceptionHolder;
import org.teiid.client.util.ResultsFuture;
@@ -71,7 +70,7 @@
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
try {
try {
- Thread.currentThread().setContextClassLoader(Module.getCallerModule().getClassLoader());
+ Thread.currentThread().setContextClassLoader(this.csr.getCallerClassloader());
} catch(Throwable t) {
// ignore
}
Modified: trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -159,7 +159,12 @@
private SocketServerConnection helpEstablishConnection(boolean clientSecure, SSLConfiguration config, Properties socketConfig) throws CommunicationException,
ConnectionException {
if (listener == null) {
- ClientServiceRegistryImpl server = new ClientServiceRegistryImpl();
+ ClientServiceRegistryImpl server = new ClientServiceRegistryImpl() {
+ @Override
+ public ClassLoader getCallerClassloader() {
+ return getClass().getClassLoader();
+ }
+ };
server.registerClientService(ILogon.class, new LogonImpl(mock(SessionService.class), "fakeCluster") { //$NON-NLS-1$
@Override
public LogonResult logon(Properties connProps)
Modified: trunk/runtime/src/test/java/org/teiid/transport/TestFailover.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/transport/TestFailover.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/runtime/src/test/java/org/teiid/transport/TestFailover.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -89,7 +89,12 @@
}
private SocketListener createListener(InetSocketAddress address, SSLConfiguration config) {
- ClientServiceRegistryImpl server = new ClientServiceRegistryImpl();
+ ClientServiceRegistryImpl server = new ClientServiceRegistryImpl() {
+ @Override
+ public ClassLoader getCallerClassloader() {
+ return getClass().getClassLoader();
+ }
+ };
server.registerClientService(ILogon.class, new LogonImpl(mock(SessionService.class), "fakeCluster") { //$NON-NLS-1$
@Override
public LogonResult logon(Properties connProps)
Modified: trunk/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java 2012-07-02 14:12:21 UTC (rev 4217)
+++ trunk/runtime/src/test/java/org/teiid/transport/TestSocketRemoting.java 2012-07-02 17:08:10 UTC (rev 4218)
@@ -160,7 +160,12 @@
@Test
public void testMethodInvocation() throws Exception {
- ClientServiceRegistryImpl csr = new ClientServiceRegistryImpl();
+ ClientServiceRegistryImpl csr = new ClientServiceRegistryImpl() {
+ @Override
+ public ClassLoader getCallerClassloader() {
+ return getClass().getClassLoader();
+ }
+ };
csr.registerClientService(ILogon.class, new ILogon() {
public ResultsFuture<?> logoff()
12 years, 6 months
teiid SVN: r4217 - in trunk: engine/src/main/java/org/teiid/query/processor/relational and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-07-02 10:12:21 -0400 (Mon, 02 Jul 2012)
New Revision: 4217
Modified:
trunk/client/src/main/java/org/teiid/net/socket/Message.java
trunk/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/SortUtility.java
trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
Log:
TEIID-2089 additional logging enhancements
Modified: trunk/client/src/main/java/org/teiid/net/socket/Message.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/Message.java 2012-07-02 13:57:57 UTC (rev 4216)
+++ trunk/client/src/main/java/org/teiid/net/socket/Message.java 2012-07-02 14:12:21 UTC (rev 4217)
@@ -35,7 +35,7 @@
private Serializable messageKey;
public String toString() {
- return "MessageHolder: contents=" + contents; //$NON-NLS-1$
+ return "MessageHolder: key=" + messageKey + " contents=" + contents; //$NON-NLS-1$ //$NON-NLS-2$
}
public void setContents(Object contents) {
Modified: trunk/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java 2012-07-02 13:57:57 UTC (rev 4216)
+++ trunk/client/src/main/java/org/teiid/net/socket/ServiceInvocationStruct.java 2012-07-02 14:12:21 UTC (rev 4217)
@@ -65,4 +65,9 @@
out.writeObject(methodName);
ExternalizeUtil.writeArray(out, args);
}
+
+ @Override
+ public String toString() {
+ return "Invoke " + targetClass + "." + methodName; //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/SortUtility.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/SortUtility.java 2012-07-02 13:57:57 UTC (rev 4216)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/SortUtility.java 2012-07-02 14:12:21 UTC (rev 4217)
@@ -40,6 +40,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.util.Assertion;
import org.teiid.language.SortSpecification.NullOrdering;
+import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
import org.teiid.query.sql.lang.OrderBy;
@@ -176,10 +177,6 @@
this(ts, new OrderBy(expressions, types).getOrderByItems(), mode, bufferManager, connectionID, schema);
}
- public boolean isDone() {
- return this.doneReading && this.phase == DONE;
- }
-
public TupleBuffer sort()
throws TeiidComponentException, TeiidProcessingException {
@@ -203,11 +200,18 @@
initialSort();
}
+ for (TupleBuffer tb : activeTupleBuffers) {
+ tb.close();
+ }
+
return activeTupleBuffers;
}
private TupleBuffer createTupleBuffer() throws TeiidComponentException {
TupleBuffer tb = bufferManager.createTupleBuffer(this.schema, this.groupName, TupleSourceType.PROCESSOR);
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_DQP, "Created intermediate sort buffer ", tb.getId()); //$NON-NLS-1$
+ }
tb.setForwardOnly(true);
return tb;
}
Modified: trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2012-07-02 13:57:57 UTC (rev 4216)
+++ trunk/runtime/src/main/java/org/teiid/transport/SocketClientInstance.java 2012-07-02 14:12:21 UTC (rev 4217)
@@ -75,10 +75,10 @@
}
public void send(Message message, Serializable messageKey) {
+ message.setMessageKey(messageKey);
if (LogManager.isMessageToBeRecorded(LogConstants.CTX_TRANSPORT, MessageLevel.DETAIL)) {
- LogManager.logDetail(LogConstants.CTX_TRANSPORT, " message: " + message + " for message:" + messageKey); //$NON-NLS-1$ //$NON-NLS-2$
+ LogManager.logDetail(LogConstants.CTX_TRANSPORT, "send message: " + message); //$NON-NLS-1$
}
- message.setMessageKey(messageKey);
objectSocket.write(message);
}
12 years, 6 months
teiid SVN: r4216 - in branches/7.4.x/engine/src: test/java/org/teiid/query/optimizer and 1 other directory.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2012-07-02 09:57:57 -0400 (Mon, 02 Jul 2012)
New Revision: 4216
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java
branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java
Log:
TEIID-2087: Order by clause causes org.teiid.core.TeiidException
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java 2012-06-29 20:04:55 UTC (rev 4215)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeVirtual.java 2012-07-02 13:57:57 UTC (rev 4216)
@@ -281,16 +281,11 @@
}
correctOrderBy(frame, selectSymbols, parentProject);
+
PlanNode parentSource = NodeEditor.findParent(frame, NodeConstants.Types.SOURCE);
- PlanNode parentSetOp = NodeEditor.findParent(parentProject, NodeConstants.Types.SET_OP, NodeConstants.Types.SOURCE);
- if (parentSetOp == null || NodeEditor.findNodePreOrder(parentSetOp, NodeConstants.Types.PROJECT) == parentProject) {
- if (parentSource != null) {
- FrameUtil.correctSymbolMap(((SymbolMap)frame.getProperty(NodeConstants.Info.SYMBOL_MAP)).asMap(), parentSource);
- }
- if (parentSetOp != null) {
- correctOrderBy(frame, selectSymbols, parentSetOp);
- }
+ if (parentSource != null && NodeEditor.findNodePreOrder(parentSource, NodeConstants.Types.PROJECT) == parentProject) {
+ FrameUtil.correctSymbolMap(((SymbolMap)frame.getProperty(NodeConstants.Info.SYMBOL_MAP)).asMap(), parentSource);
}
prepareFrame(frame);
@@ -306,18 +301,22 @@
return root;
}
+ /**
+ * special handling is needed since we are retaining the child aliases
+ */
private static void correctOrderBy(PlanNode frame,
- List<SingleElementSymbol> selectSymbols, PlanNode startNode) {
- PlanNode sort = NodeEditor.findParent(startNode, NodeConstants.Types.SORT, NodeConstants.Types.SOURCE | NodeConstants.Types.SET_OP);
- if (sort != null) { //special handling is needed since we are retaining the child aliases
- List<SingleElementSymbol> childProject = (List<SingleElementSymbol>)NodeEditor.findNodePreOrder(frame, NodeConstants.Types.PROJECT).getProperty(NodeConstants.Info.PROJECT_COLS);
- OrderBy elements = (OrderBy)sort.getProperty(NodeConstants.Info.SORT_ORDER);
- for (OrderByItem item : elements.getOrderByItems()) {
- item.setSymbol(childProject.get(selectSymbols.indexOf(item.getSymbol())));
- }
- sort.getGroups().clear();
- sort.addGroups(GroupsUsedByElementsVisitor.getGroups(elements));
+ List<SingleElementSymbol> selectSymbols, PlanNode parentProject) {
+ PlanNode sort = NodeEditor.findParent(parentProject, NodeConstants.Types.SORT, NodeConstants.Types.SOURCE);
+ if (sort == null || NodeEditor.findNodePreOrder(sort, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE) != parentProject) {
+ return;
}
+ List<SingleElementSymbol> childProject = (List<SingleElementSymbol>)NodeEditor.findNodePreOrder(frame, NodeConstants.Types.PROJECT).getProperty(NodeConstants.Info.PROJECT_COLS);
+ OrderBy elements = (OrderBy)sort.getProperty(NodeConstants.Info.SORT_ORDER);
+ for (OrderByItem item : elements.getOrderByItems()) {
+ item.setSymbol(childProject.get(selectSymbols.indexOf(item.getSymbol())));
+ }
+ sort.getGroups().clear();
+ sort.addGroups(GroupsUsedByElementsVisitor.getGroups(elements));
}
/**
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java 2012-06-29 20:04:55 UTC (rev 4215)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/optimizer/TestRuleMergeVirtual.java 2012-07-02 13:57:57 UTC (rev 4216)
@@ -390,5 +390,28 @@
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
+
+ @Test public void testSortOverUnion() throws Exception {
+ ProcessorPlan plan = TestOptimizer.helpPlan("select e1 from (select max(e1) as e1 from pm1.g1 having 1 = 0) as y union all select e2 from pm1.g1 union all select e1 from pm1.g1 order by e1", //$NON-NLS-1$
+ RealMetadataFactory.example1Cached(), null, new DefaultCapabilitiesFinder(),
+ new String[] {
+ "SELECT pm1.g1.e2 FROM pm1.g1", "SELECT pm1.g1.e1 FROM pm1.g1"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 2, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 0, // MergeJoinStrategy
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 1, // Sort
+ 1 // UnionAll
+ });
+ }
}
12 years, 6 months