teiid SVN: r4117 - in trunk/engine/src: main/java/org/teiid/query/processor/proc and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-05-16 17:19:08 -0400 (Wed, 16 May 2012)
New Revision: 4117
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanProcedures.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java
trunk/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java
Log:
TEIID-2048 fix for proc relational dep out parameter
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanProcedures.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanProcedures.java 2012-05-16 21:19:02 UTC (rev 4116)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanProcedures.java 2012-05-16 21:19:08 UTC (rev 4117)
@@ -82,29 +82,28 @@
continue;
}
- HashSet inputSymbols = new HashSet();
- List inputReferences = new LinkedList();
+ HashSet<ElementSymbol> inputSymbols = new HashSet<ElementSymbol>();
+ List<Reference> inputReferences = new LinkedList<Reference>();
PlanNode critNode = node.getParent();
- List conjuncts = new LinkedList();
- HashSet coveredParams = new HashSet();
+ List<Criteria> conjuncts = new LinkedList<Criteria>();
+ HashSet<ElementSymbol> coveredParams = new HashSet<ElementSymbol>();
//List preExecNodes = new LinkedList();
- for (Iterator params = proc.getInputParameters().iterator(); params.hasNext();) {
- SPParameter param = (SPParameter)params.next();
+ for (Iterator<SPParameter> params = proc.getInputParameters().iterator(); params.hasNext();) {
+ SPParameter param = params.next();
ElementSymbol symbol = param.getParameterSymbol();
Expression input = param.getExpression();
- inputReferences.add(input);
+ inputReferences.add((Reference)input);
inputSymbols.add(symbol);
}
findInputNodes(inputSymbols, critNode, conjuncts, coveredParams);
- List defaults = new LinkedList();
+ List<Expression> defaults = new LinkedList<Expression>();
- for (Iterator params = inputReferences.iterator(); params.hasNext();) {
- Reference ref = (Reference)params.next();
+ for (Reference ref : inputReferences) {
ElementSymbol symbol = ref.getExpression();
Expression defaultValue = null;
@@ -145,9 +144,9 @@
return plan;
}
- private void findInputNodes(final HashSet inputs,
+ private void findInputNodes(final HashSet<ElementSymbol> inputs,
PlanNode critNode,
- final List conjuncts, final Set params) {
+ final List<Criteria> conjuncts, final Set<ElementSymbol> params) {
while (critNode.getType() == NodeConstants.Types.SELECT) {
final PlanNode currentNode = critNode;
@@ -209,9 +208,9 @@
return false;
}
- boolean checkForAnyInput(Collection expressions) {
- for (Iterator exprs = expressions.iterator(); exprs.hasNext();) {
- if (checkForAnyInput((Expression)exprs.next())) {
+ boolean checkForAnyInput(Collection<Expression> expressions) {
+ for (Expression expr : expressions) {
+ if (checkForAnyInput(expr)) {
return true;
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2012-05-16 21:19:02 UTC (rev 4116)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2012-05-16 21:19:08 UTC (rev 4117)
@@ -618,6 +618,15 @@
}
FrameUtil.convertNode(copyNode, sourceGroup, null, symbolMap.asMap(), metadata, true);
+
+ //any proc relational criteria that is not input criteria should stay above the source
+ if (sourceGroup.isProcedure() && !copyNode.getGroups().isEmpty()) {
+ if (this.createdNodes != null) {
+ this.createdNodes.remove(this.createdNodes.size() - 1);
+ }
+ return false;
+ }
+
PlanNode intermediateParent = NodeEditor.findParent(projectNode, NodeConstants.Types.ACCESS, NodeConstants.Types.SOURCE | NodeConstants.Types.SET_OP);
if (intermediateParent != null) {
intermediateParent.addAsParent(copyNode);
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java 2012-05-16 21:19:02 UTC (rev 4116)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java 2012-05-16 21:19:08 UTC (rev 4117)
@@ -71,9 +71,9 @@
if (update) {
boolean hasNext = procEnv.iterateCursor(rsName);
if (hasNext) {
- procEnv.getContext().getVariableContext().setValue(ProcedurePlan.ROWCOUNT, procEnv.getCurrentRow(rsName).get(0));
+ procEnv.getCurrentVariableContext().setValue(ProcedurePlan.ROWCOUNT, procEnv.getCurrentRow(rsName).get(0));
} else {
- procEnv.getContext().getVariableContext().setValue(ProcedurePlan.ROWCOUNT, 0);
+ procEnv.getCurrentVariableContext().setValue(ProcedurePlan.ROWCOUNT, 0);
}
procEnv.removeResults(rsName);
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java 2012-05-16 21:19:02 UTC (rev 4116)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java 2012-05-16 21:19:08 UTC (rev 4117)
@@ -236,6 +236,28 @@
TestProcessor.helpProcess(plan, dataManager, expected);
}
+ @Test public void testProcAsTableInJoinWithOutJoinPredicate(){
+ String sql = "select param1, param2, pm1.vsp26.e2, pm1.g1.e2 from pm1.vsp26, pm1.g1 where pm1.vsp26.e2 = pm1.g1.e2 and param1 = pm1.g1.e2 and param2 = pm1.g1.e1 order by param1, param2, pm1.vsp26.e2"; //$NON-NLS-1$
+
+ // Create expected results
+ List<?>[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(0), 0}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(0), 0}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(0), 0}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(0), 0}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(1), "c", new Integer(1), 1}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(2), "b", new Integer(2), 2}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(3), "a", new Integer(3), 3}), //$NON-NLS-1$
+ };
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ TestProcessor.sampleData1(dataManager);
+ // Plan query
+ ProcessorPlan plan = TestProcessor.helpGetPlan(sql, RealMetadataFactory.example1Cached());
+ // Run query
+ TestProcessor.helpProcess(plan, dataManager, expected);
+ }
+
@Test public void testProcAsTableInSubquery(){
String sql = "select param1, param2, pm1.vsp26.e2, (select count(e1) from pm1.vsp26 where param1 = 1 and param2 = 'a') x from pm1.vsp26, pm1.g1 where param1 = pm1.g1.e2 and param2 = pm1.g1.e1 order by param1, param2, e2"; //$NON-NLS-1$
12 years, 8 months
teiid SVN: r4116 - in branches/7.7.x/engine/src: test/java/org/teiid/query/processor and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-05-16 17:19:02 -0400 (Wed, 16 May 2012)
New Revision: 4116
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java
Log:
TEIID-2048 fix for proc relational dep out parameter
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2012-05-16 21:16:25 UTC (rev 4115)
+++ branches/7.7.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2012-05-16 21:19:02 UTC (rev 4116)
@@ -615,6 +615,15 @@
}
FrameUtil.convertNode(copyNode, sourceGroup, null, symbolMap.asMap(), metadata, true);
+
+ //any proc relational criteria that is not input criteria should stay above the source
+ if (sourceGroup.isProcedure() && !copyNode.getGroups().isEmpty()) {
+ if (this.createdNodes != null) {
+ this.createdNodes.remove(this.createdNodes.size() - 1);
+ }
+ return false;
+ }
+
PlanNode intermediateParent = NodeEditor.findParent(projectNode, NodeConstants.Types.ACCESS, NodeConstants.Types.SOURCE | NodeConstants.Types.SET_OP);
if (intermediateParent != null) {
intermediateParent.addAsParent(copyNode);
Modified: branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java
===================================================================
--- branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java 2012-05-16 21:16:25 UTC (rev 4115)
+++ branches/7.7.x/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java 2012-05-16 21:19:02 UTC (rev 4116)
@@ -236,6 +236,28 @@
TestProcessor.helpProcess(plan, dataManager, expected);
}
+ @Test public void testProcAsTableInJoinWithOutJoinPredicate(){
+ String sql = "select param1, param2, pm1.vsp26.e2, pm1.g1.e2 from pm1.vsp26, pm1.g1 where pm1.vsp26.e2 = pm1.g1.e2 and param1 = pm1.g1.e2 and param2 = pm1.g1.e1 order by param1, param2, pm1.vsp26.e2"; //$NON-NLS-1$
+
+ // Create expected results
+ List<?>[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(0), 0}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(0), 0}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(0), 0}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(0), "a", new Integer(0), 0}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(1), "c", new Integer(1), 1}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(2), "b", new Integer(2), 2}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { new Integer(3), "a", new Integer(3), 3}), //$NON-NLS-1$
+ };
+ // Construct data manager with data
+ FakeDataManager dataManager = new FakeDataManager();
+ TestProcessor.sampleData1(dataManager);
+ // Plan query
+ ProcessorPlan plan = TestProcessor.helpGetPlan(sql, RealMetadataFactory.example1Cached());
+ // Run query
+ TestProcessor.helpProcess(plan, dataManager, expected);
+ }
+
@Test public void testProcAsTableInSubquery(){
String sql = "select param1, param2, pm1.vsp26.e2, (select count(e1) from pm1.vsp26 where param1 = 1 and param2 = 'a') x from pm1.vsp26, pm1.g1 where param1 = pm1.g1.e2 and param2 = pm1.g1.e1 order by param1, param2, e2"; //$NON-NLS-1$
12 years, 8 months
teiid SVN: r4115 - branches/7.7.x/documentation/javadocs.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-05-16 17:16:25 -0400 (Wed, 16 May 2012)
New Revision: 4115
Modified:
branches/7.7.x/documentation/javadocs/
Log:
updating ignores
Property changes on: branches/7.7.x/documentation/javadocs
___________________________________________________________________
Modified: svn:ignore
- bin
.project
+ bin
.project
target
12 years, 8 months
teiid SVN: r4114 - trunk/build/kits/jboss-as7/standalone/configuration.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-05-16 14:25:50 -0400 (Wed, 16 May 2012)
New Revision: 4114
Modified:
trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
Log:
TEIID-2050: moving the auth property files to more convenient location.
Modified: trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
===================================================================
--- trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-05-16 17:14:10 UTC (rev 4113)
+++ trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-05-16 18:25:50 UTC (rev 4114)
@@ -258,9 +258,9 @@
</security-domain>
<security-domain name="teiid-security" cache-type="default">
<authentication>
- <login-module code="UsersRoles" flag="required">
- <module-option name="usersProperties" value="${jboss.domain.config.dir}/teiid-security-users.properties"/>
- <module-option name="rolesProperties" value="${jboss.domain.config.dir}/teiid-security-roles.properties"/>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
+ <module-option name="usersProperties" value="${jboss.server.config.dir}/teiid-security-users.properties"/>
+ <module-option name="rolesProperties" value="${jboss.server.config.dir}/teiid-security-roles.properties"/>
</login-module>
</authentication>
</security-domain>
12 years, 8 months
teiid SVN: r4113 - in trunk: test-integration/common/src/test/java/org/teiid/arquillian and 1 other directory.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-05-16 13:14:10 -0400 (Wed, 16 May 2012)
New Revision: 4113
Modified:
trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java
trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java
Log:
TEIID-2035, TEIID-1981 : making necessary changes to remove the whole resource-adapter when delete data source is called. Also fixing the profile node additions on some admin methods that did not get addressed in earlier commit.
Modified: trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java 2012-05-16 17:05:31 UTC (rev 4112)
+++ trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java 2012-05-16 17:14:10 UTC (rev 4113)
@@ -155,6 +155,7 @@
private static final String JAVA_CONTEXT = "java:/";
private ModelControllerClient connection;
private boolean domainMode = false;
+ private String profileName;
public AdminImpl (ModelControllerClient connection) {
this.connection = connection;
@@ -194,14 +195,17 @@
private void createConnectionFactory(String deploymentName, String rarName, Properties properties) throws AdminException {
- ///subsystem=resource-adapters/resource-adapter=fileDS:add
- addResourceAdapter(deploymentName, rarName);
+ if (!getDeployedResourceAdapterNames().contains(deploymentName)) {
+ ///subsystem=resource-adapters/resource-adapter=fileDS:add
+ addResourceAdapter(deploymentName, rarName);
+ }
///subsystem=resource-adapters/resource-adapter=fileDS/connection-definitions=fileDS:add(jndi-name=java\:\/fooDS)
DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
final ModelNode request;
try {
+ addProfileNode(builder);
builder.addNode("subsystem", "resource-adapters"); //$NON-NLS-1$ //$NON-NLS-2$
builder.addNode("resource-adapter", deploymentName); //$NON-NLS-1$ //$NON-NLS-2$
builder.addNode("connection-definitions", deploymentName); //$NON-NLS-1$ //$NON-NLS-2$
@@ -236,6 +240,7 @@
DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
final ModelNode request;
try {
+ addProfileNode(builder);
builder.addNode("subsystem", "resource-adapters"); //$NON-NLS-1$ //$NON-NLS-2$
builder.addNode("resource-adapter", deploymentName); //$NON-NLS-1$ //$NON-NLS-2$
builder.addNode("connection-definitions", deploymentName); //$NON-NLS-1$ //$NON-NLS-2$
@@ -255,6 +260,7 @@
DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
final ModelNode request;
try {
+ addProfileNode(builder);
builder.addNode("subsystem", "resource-adapters"); //$NON-NLS-1$ //$NON-NLS-2$
builder.addNode("resource-adapter", deploymentName); //$NON-NLS-1$ //$NON-NLS-2$
builder.setOperationName("activate");
@@ -266,12 +272,22 @@
execute(request);
}
+ private void addProfileNode(DefaultOperationRequestBuilder builder) throws AdminProcessingException {
+ if (this.domainMode) {
+ String profile = getProfileName();
+ if (profile != null) {
+ builder.addNode("profile",profile);
+ }
+ }
+ }
+
// /subsystem=resource-adapters/resource-adapter=teiid-connector-ws.rar:add(archive=teiid-connector-ws.rar, transaction-support=NoTransaction)
private void addResourceAdapter(String deploymentName, String rarName) throws AdminProcessingException {
DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
final ModelNode request;
try {
+ addProfileNode(builder);
builder.addNode("subsystem", "resource-adapters"); //$NON-NLS-1$ //$NON-NLS-2$
builder.addNode("resource-adapter", deploymentName); //$NON-NLS-1$ //$NON-NLS-2$
builder.setOperationName("add");
@@ -341,7 +357,10 @@
if (!this.domainMode) {
return null;
}
- return getChildNodeNames(null, "profile").get(0);
+ if (this.profileName == null) {
+ this.profileName = getChildNodeNames(null, "profile").get(0);
+ }
+ return this.profileName;
}
@Override
@@ -368,12 +387,7 @@
ModelNode request;
try {
- if (this.domainMode) {
- String profile = getProfileName();
- if (profile != null) {
- builder.addNode("profile",profile);
- }
- }
+ addProfileNode(builder);
builder.addNode("subsystem", "datasources"); //$NON-NLS-1$ //$NON-NLS-2$
builder.addNode("data-source", deploymentName); //$NON-NLS-1$
@@ -446,21 +460,26 @@
throw new AdminProcessingException(AdminPlugin.Event.TEIID70008, AdminPlugin.Util.gs(AdminPlugin.Event.TEIID70008, deployedName));
}
- boolean deleted = deleteDS(deployedName, false, "datasources", "data-source");
+ boolean deleted = deleteDS(deployedName,"datasources", "data-source");
// check xa connections
if (!deleted) {
- deleted = deleteDS(deployedName, false, "datasources", "xa-data-source");
+ deleted = deleteDS(deployedName,"datasources", "xa-data-source");
}
// check connection factories
if (!deleted) {
Map<String, String> raDSMap = getResourceAdapterDataSources();
+ // deployed rar name, may be it is == deployedName or if server restarts it will be rar name or rar->[1..n] name
String rarName = raDSMap.get(deployedName);
if (rarName != null) {
- deleted = deleteDS(rarName, true, "resource-adapters", "resource-adapter", deployedName);
+ deleted = deleteDS(rarName,"resource-adapters", "resource-adapter", deployedName);
}
}
+
+ if (!deleted) {
+ throw new AdminProcessingException(AdminPlugin.Event.TEIID70008, AdminPlugin.Util.gs(AdminPlugin.Event.TEIID70008, deployedName));
+ }
}
private String removeJavaContext(String deployedName) {
@@ -477,23 +496,15 @@
return deployedName;
}
- private boolean deleteDS(String deployedName, boolean connFactory, String... subsystem) throws AdminProcessingException {
+ private boolean deleteDS(String deployedName, String... subsystem) throws AdminProcessingException {
DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
final ModelNode request;
-
+
try {
- if (this.domainMode) {
- String profile = getProfileName();
- if (profile != null) {
- builder.addNode("profile",profile);
- }
- }
+ addProfileNode(builder);
builder.addNode("subsystem", subsystem[0]); //$NON-NLS-1$ //$NON-NLS-2$
builder.addNode(subsystem[1], deployedName);
- if (connFactory) {
- builder.addNode("connection-definitions", subsystem[2]);
- }
builder.setOperationName("remove");
request = builder.buildRequest();
} catch (OperationFormatException e) {
@@ -505,10 +516,10 @@
if (!Util.isSuccess(outcome)) {
return false;
}
- return true;
} catch (IOException e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70009, e, e.getMessage());
}
+ return true;
}
@Override
@@ -688,51 +699,56 @@
HashMap<String, String> datasourceNames = new HashMap<String, String>();
Set<String> resourceAdapters = getDeployedResourceAdapterNames();
for (String resource:resourceAdapters) {
- DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
- try {
- builder.addNode("subsystem", "resource-adapters"); //$NON-NLS-1$ //$NON-NLS-2$
- builder.addNode("resource-adapter", resource); //$NON-NLS-1$ //$NON-NLS-2$
- builder.setOperationName("read-resource");
- ModelNode request = builder.buildRequest();
-
- ModelNode outcome = this.connection.execute(request);
- if (Util.isSuccess(outcome)) {
- if (outcome.hasDefined("result")) {
- ModelNode result = outcome.get("result");
- if (result.hasDefined("connection-definitions")) {
- List<ModelNode> connDefs = result.get("connection-definitions").asList();
- for (ModelNode conn:connDefs) {
- Iterator<String> it = conn.keys().iterator();
- if (it.hasNext()) {
- datasourceNames.put(it.next(), resource);
- }
- }
- }
- }
- }
- } catch (OperationFormatException e) {
- throw new AdminProcessingException(AdminPlugin.Event.TEIID70016, e, AdminPlugin.Util.gs(AdminPlugin.Event.TEIID70016));
- } catch (IOException e) {
- throw new AdminProcessingException(AdminPlugin.Event.TEIID70017, e, AdminPlugin.Util.gs(AdminPlugin.Event.TEIID70017));
- }
+ getResourceAdpaterConnections(datasourceNames, resource);
}
return datasourceNames;
}
+
+ private void getResourceAdpaterConnections(HashMap<String, String> datasourceNames, String rarName) throws AdminProcessingException {
+ DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
+ try {
+ addProfileNode(builder);
+ builder.addNode("subsystem", "resource-adapters"); //$NON-NLS-1$ //$NON-NLS-2$
+ builder.addNode("resource-adapter", rarName); //$NON-NLS-1$ //$NON-NLS-2$
+ builder.setOperationName("read-resource");
+ ModelNode request = builder.buildRequest();
+
+ ModelNode outcome = this.connection.execute(request);
+ if (Util.isSuccess(outcome)) {
+ if (outcome.hasDefined("result")) {
+ ModelNode result = outcome.get("result");
+ if (result.hasDefined("connection-definitions")) {
+ List<ModelNode> connDefs = result.get("connection-definitions").asList();
+ for (ModelNode conn:connDefs) {
+ Iterator<String> it = conn.keys().iterator();
+ if (it.hasNext()) {
+ datasourceNames.put(it.next(), rarName);
+ }
+ }
+ }
+ }
+ }
+ } catch (OperationFormatException e) {
+ throw new AdminProcessingException(AdminPlugin.Event.TEIID70016, e, AdminPlugin.Util.gs(AdminPlugin.Event.TEIID70016));
+ } catch (IOException e) {
+ throw new AdminProcessingException(AdminPlugin.Event.TEIID70017, e, AdminPlugin.Util.gs(AdminPlugin.Event.TEIID70017));
+ }
+ }
/**
- * This will get all deplyed RAR names
+ * This will get all deployed RAR names
* /subsystem=resource-adapters:read-children-names(child-type=resource-adapter)
* @return
* @throws AdminException
*/
- private Set<String> getDeployedResourceAdapterNames() throws AdminException {
+ private Set<String> getDeployedResourceAdapterNames() throws AdminProcessingException {
Set<String> templates = new HashSet<String>();
templates.addAll(getChildNodeNames("resource-adapters", "resource-adapter"));
return templates;
}
// :read-children-names(child-type=deployment)
- private Set<String> getAvailableResourceAdapterNames() throws AdminException {
+ private Set<String> getAvailableResourceAdapterNames() throws AdminProcessingException {
List<String> deployments = getChildNodeNames(null, "deployment");
Set<String> templates = new HashSet<String>();
for (String deployment:deployments) {
@@ -744,7 +760,7 @@
}
@Override
- public Set<String> getDataSourceTemplateNames() throws AdminException {
+ public Set<String> getDataSourceTemplateNames() throws AdminProcessingException {
Set<String> templates = new HashSet<String>();
templates.addAll(getInstalledJDBCDrivers());
templates.addAll(getAvailableResourceAdapterNames());
@@ -752,7 +768,7 @@
}
@Override
- public Collection<? extends WorkerPoolStatistics> getWorkerPoolStats() throws AdminException {
+ public Collection<? extends WorkerPoolStatistics> getWorkerPoolStats() throws AdminProcessingException {
final ModelNode request = buildRequest("teiid", "workerpool-statistics");//$NON-NLS-1$
if (request != null) {
try {
@@ -769,7 +785,7 @@
@Override
- public void cancelRequest(String sessionId, long executionId) throws AdminException {
+ public void cancelRequest(String sessionId, long executionId) throws AdminProcessingException {
final ModelNode request = buildRequest("teiid", "terminate-session", "session", sessionId, "execution-id", String.valueOf(executionId));//$NON-NLS-1$
if (request == null) {
return;
@@ -845,12 +861,7 @@
Set<String> resourceAdapters = getAvailableResourceAdapterNames();
if (resourceAdapters.contains(templateName)) {
DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
- if (this.domainMode) {
- String profile = getProfileName();
- if (profile != null) {
- builder.addNode("profile",profile);
- }
- }
+ addProfileNode(builder);
builder.addNode("subsystem", "teiid"); //$NON-NLS-1$ //$NON-NLS-2$
builder.setOperationName("read-rar-description"); //$NON-NLS-1$
builder.addProperty("rar-name", templateName);
@@ -1080,12 +1091,7 @@
final ModelNode request;
try {
if (subsystem != null) {
- if (this.domainMode) {
- String profile = getProfileName();
- if (profile != null) {
- builder.addNode("profile",profile);
- }
- }
+ addProfileNode(builder);
builder.addNode("subsystem", subsystem); //$NON-NLS-1$ //$NON-NLS-2$
}
builder.setOperationName(operationName);
Modified: trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java 2012-05-16 17:05:31 UTC (rev 4112)
+++ trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java 2012-05-16 17:14:10 UTC (rev 4113)
@@ -107,7 +107,7 @@
public void testTraslators() throws Exception {
Collection<? extends Translator> translators = admin.getTranslators();
System.out.println(translators);
- assertEquals(29, translators.size());
+ assertEquals(30, translators.size());
JavaArchive jar = getLoopyArchive();
@@ -428,6 +428,29 @@
}
}
+ @Test
+ public void testCreateConnectionFactory() throws Exception{
+ String deployedName = "wsOne";
+
+ assertFalse(admin.getDataSourceNames().contains(deployedName));
+
+ Properties p = new Properties();
+ p.setProperty("class-name", "org.teiid.resource.adapter.ws.WSManagedConnectionFactory");
+ p.setProperty("EndPoint", "{endpoint}");
+ admin.createDataSource(deployedName, "teiid-connector-ws.rar", p);
+
+ assertTrue(admin.getDataSourceNames().contains(deployedName));
+
+ admin.deleteDataSource(deployedName);
+
+ assertFalse(admin.getDataSourceNames().contains(deployedName));
+
+ admin.createDataSource(deployedName, "teiid-connector-ws.rar", p);
+
+ assertTrue(admin.getDataSourceNames().contains(deployedName));
+
+ admin.deleteDataSource(deployedName);
+ }
}
12 years, 8 months
teiid SVN: r4112 - trunk/jboss-integration/src/main/java/org/teiid/jboss.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-05-16 13:05:31 -0400 (Wed, 16 May 2012)
New Revision: 4112
Modified:
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
Log:
TEIID-2049: attach the global table even in the non-cluster case
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-05-16 17:03:28 UTC (rev 4111)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-05-16 17:05:31 UTC (rev 4112)
@@ -146,11 +146,11 @@
if (objectReplicatorInjector.getValue() != null) {
try {
gts = objectReplicatorInjector.getValue().replicate(name + version, GlobalTableStore.class, gts, 300000);
- vdbInstance.addAttchment(GlobalTableStore.class, gts);
} catch (Exception e) {
LogManager.logError(LogConstants.CTX_RUNTIME, e, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50023, gts));
}
}
+ vdbInstance.addAttchment(GlobalTableStore.class, gts);
}
};
12 years, 8 months
teiid SVN: r4111 - in trunk/build/kits/jboss-as7: bin/scripts and 4 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-05-16 13:03:28 -0400 (Wed, 16 May 2012)
New Revision: 4111
Added:
trunk/build/kits/jboss-as7/domain/
trunk/build/kits/jboss-as7/domain/configuration/
trunk/build/kits/jboss-as7/domain/configuration/teiid-security-roles.properties
trunk/build/kits/jboss-as7/domain/configuration/teiid-security-users.properties
trunk/build/kits/jboss-as7/standalone/configuration/teiid-security-roles.properties
trunk/build/kits/jboss-as7/standalone/configuration/teiid-security-users.properties
Removed:
trunk/build/kits/jboss-as7/modules/org/jboss/teiid/main/conf/teiid-security-roles.properties
trunk/build/kits/jboss-as7/modules/org/jboss/teiid/main/conf/teiid-security-users.properties
Modified:
trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli
trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
Log:
TEIID-2050: moving the auth property files to more convenient location.
Modified: trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli
===================================================================
--- trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli 2012-05-16 13:43:07 UTC (rev 4110)
+++ trunk/build/kits/jboss-as7/bin/scripts/teiid-domain-mode-install.cli 2012-05-16 17:03:28 UTC (rev 4111)
@@ -13,7 +13,7 @@
/profile=ha/subsystem=infinispan/cache-container=teiid-cache/replicated-cache=resultset/eviction=EVICTION:add(max-entries=1024, strategy=LRU)
/profile=ha/subsystem=security/security-domain=teiid-security:add(cache-type=default)
-/profile=ha/subsystem=security/security-domain=teiid-security/authentication=classic:add(login-modules=[{"code"=>"UserRoles", "flag"=>"required", "module-options"=>[("userProperties"=>"teiid-security-user.properties"), ("rolesProperties"=>"teiid-security-roles.properties")]}])
+/profile=ha/subsystem=security/security-domain=teiid-security/authentication=classic:add(login-modules=[{"code"=>"org.jboss.security.auth.spi.UsersRolesLoginModule", "flag"=>"required", "module-options"=>[("usersProperties"=>"${jboss.domain.config.dir}/teiid-security-users.properties"), ("rolesProperties"=>"${jboss.domain.config.dir}/teiid-security-roles.properties")]}])
/profile=ha/subsystem=threads/bounded-queue-thread-pool=teiid-async:add(name=teiid-async, max-threads=4, queue-length=100)
/profile=ha/subsystem=teiid:add(async-thread-pool=teiid-async, distributed-cache-jgroups-stack=udp, resultset-cache-infinispan-container=teiid-cache)
Added: trunk/build/kits/jboss-as7/domain/configuration/teiid-security-roles.properties
===================================================================
--- trunk/build/kits/jboss-as7/domain/configuration/teiid-security-roles.properties (rev 0)
+++ trunk/build/kits/jboss-as7/domain/configuration/teiid-security-roles.properties 2012-05-16 17:03:28 UTC (rev 4111)
@@ -0,0 +1,3 @@
+# A roles.properties file for use with the UsersRolesLoginModule
+# username=role1,role2
+user=example-role
Property changes on: trunk/build/kits/jboss-as7/domain/configuration/teiid-security-roles.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/domain/configuration/teiid-security-users.properties
===================================================================
--- trunk/build/kits/jboss-as7/domain/configuration/teiid-security-users.properties (rev 0)
+++ trunk/build/kits/jboss-as7/domain/configuration/teiid-security-users.properties 2012-05-16 17:03:28 UTC (rev 4111)
@@ -0,0 +1,3 @@
+# A users.properties file for use with the UsersRolesLoginModule
+# username=password
+user=user
Property changes on: trunk/build/kits/jboss-as7/domain/configuration/teiid-security-users.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/build/kits/jboss-as7/modules/org/jboss/teiid/main/conf/teiid-security-roles.properties
===================================================================
--- trunk/build/kits/jboss-as7/modules/org/jboss/teiid/main/conf/teiid-security-roles.properties 2012-05-16 13:43:07 UTC (rev 4110)
+++ trunk/build/kits/jboss-as7/modules/org/jboss/teiid/main/conf/teiid-security-roles.properties 2012-05-16 17:03:28 UTC (rev 4111)
@@ -1,3 +0,0 @@
-# A roles.properties file for use with the UsersRolesLoginModule
-# username=role1,role2
-user=example-role
Deleted: trunk/build/kits/jboss-as7/modules/org/jboss/teiid/main/conf/teiid-security-users.properties
===================================================================
--- trunk/build/kits/jboss-as7/modules/org/jboss/teiid/main/conf/teiid-security-users.properties 2012-05-16 13:43:07 UTC (rev 4110)
+++ trunk/build/kits/jboss-as7/modules/org/jboss/teiid/main/conf/teiid-security-users.properties 2012-05-16 17:03:28 UTC (rev 4111)
@@ -1,3 +0,0 @@
-# A users.properties file for use with the UsersRolesLoginModule
-# username=password
-user=user
Modified: trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
===================================================================
--- trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-05-16 13:43:07 UTC (rev 4110)
+++ trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-05-16 17:03:28 UTC (rev 4111)
@@ -259,8 +259,8 @@
<security-domain name="teiid-security" cache-type="default">
<authentication>
<login-module code="UsersRoles" flag="required">
- <module-option name="usersProperties" value="teiid-security-users.properties"/>
- <module-option name="rolesProperties" value="teiid-security-roles.properties"/>
+ <module-option name="usersProperties" value="${jboss.domain.config.dir}/teiid-security-users.properties"/>
+ <module-option name="rolesProperties" value="${jboss.domain.config.dir}/teiid-security-roles.properties"/>
</login-module>
</authentication>
</security-domain>
Added: trunk/build/kits/jboss-as7/standalone/configuration/teiid-security-roles.properties
===================================================================
--- trunk/build/kits/jboss-as7/standalone/configuration/teiid-security-roles.properties (rev 0)
+++ trunk/build/kits/jboss-as7/standalone/configuration/teiid-security-roles.properties 2012-05-16 17:03:28 UTC (rev 4111)
@@ -0,0 +1,3 @@
+# A roles.properties file for use with the UsersRolesLoginModule
+# username=role1,role2
+user=example-role
Property changes on: trunk/build/kits/jboss-as7/standalone/configuration/teiid-security-roles.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/build/kits/jboss-as7/standalone/configuration/teiid-security-users.properties
===================================================================
--- trunk/build/kits/jboss-as7/standalone/configuration/teiid-security-users.properties (rev 0)
+++ trunk/build/kits/jboss-as7/standalone/configuration/teiid-security-users.properties 2012-05-16 17:03:28 UTC (rev 4111)
@@ -0,0 +1,3 @@
+# A users.properties file for use with the UsersRolesLoginModule
+# username=password
+user=user
Property changes on: trunk/build/kits/jboss-as7/standalone/configuration/teiid-security-users.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 8 months
teiid SVN: r4110 - in trunk/api/src/test/java/org/teiid: metadata and 1 other directory.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-05-16 09:43:07 -0400 (Wed, 16 May 2012)
New Revision: 4110
Added:
trunk/api/src/test/java/org/teiid/metadata/
trunk/api/src/test/java/org/teiid/metadata/TestMetadataFactory.java
Log:
TEIID-2047: fixing the Schema merge to be correct
Added: trunk/api/src/test/java/org/teiid/metadata/TestMetadataFactory.java
===================================================================
--- trunk/api/src/test/java/org/teiid/metadata/TestMetadataFactory.java (rev 0)
+++ trunk/api/src/test/java/org/teiid/metadata/TestMetadataFactory.java 2012-05-16 13:43:07 UTC (rev 4110)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.metadata;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+@SuppressWarnings("nls")
+public class TestMetadataFactory {
+
+ @Test
+ public void testMergeFrom() {
+ Schema s = new Schema();
+ s.setName("schema-name");
+ s.setUUID("uuid");
+ s.setPhysical(false);
+ s.setVisible(true);
+
+ MetadataFactory mf = new MetadataFactory("vdb-name", 1, "model-name", null, null, null);
+ mf.mergeFrom(s);
+
+ assertEquals("schema-name", mf.getName());
+ assertEquals("uuid", mf.getUUID());
+ assertEquals(false, mf.isPhysical());
+ assertEquals(true, mf.isVisible());
+ }
+
+}
Property changes on: trunk/api/src/test/java/org/teiid/metadata/TestMetadataFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 8 months
teiid SVN: r4109 - trunk/api/src/main/java/org/teiid/metadata.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-05-16 07:53:26 -0400 (Wed, 16 May 2012)
New Revision: 4109
Modified:
trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java
Log:
TEIID-2047: fixing the Schema merge to be correct
Modified: trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java 2012-05-16 02:06:17 UTC (rev 4108)
+++ trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java 2012-05-16 11:53:26 UTC (rev 4109)
@@ -348,6 +348,10 @@
public void mergeFrom(Schema schema) {
setName(schema.getName());
setUUID(schema.getUUID());
+ setPhysical(schema.isPhysical());
+ setProperties(schema.getProperties());
+ setVisible(schema.isVisible());
+ setAnnotation(schema.getAnnotation());
for (Table t:schema.getTables().values()) {
addTable(t);
12 years, 8 months
teiid SVN: r4108 - in trunk/engine/src: main/java/org/teiid/query/optimizer/relational and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-05-15 22:06:17 -0400 (Tue, 15 May 2012)
New Revision: 4108
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
trunk/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java
Log:
TEIID-2040 fix for sort init error
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java 2012-05-16 02:06:06 UTC (rev 4107)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorManager.java 2012-05-16 02:06:17 UTC (rev 4108)
@@ -200,11 +200,10 @@
return this.executionFactory;
}
- public void setExecutionFactory(ExecutionFactory<Object, Object> ef) {
- this.executionFactory = ef;
+ public void setExecutionFactory(ExecutionFactory<?, ?> ef) {
+ this.executionFactory = (ExecutionFactory<Object, Object>) ef;
}
-
/**
* Get the ConnectionFactory object required by this manager
* @return
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2012-05-16 02:06:06 UTC (rev 4107)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2012-05-16 02:06:17 UTC (rev 4108)
@@ -393,11 +393,13 @@
if (hints.hasRelationalProc) {
rules.push(RuleConstants.PLAN_PROCEDURES);
}
+ if (hints.hasJoin) {
+ rules.push(RuleConstants.CHOOSE_DEPENDENT);
+ }
if(hints.hasAggregates) {
rules.push(new RulePushAggregates(idGenerator));
}
if(hints.hasJoin) {
- rules.push(RuleConstants.CHOOSE_DEPENDENT);
rules.push(RuleConstants.CHOOSE_JOIN_STRATEGY);
rules.push(RuleConstants.RAISE_ACCESS);
//after planning the joins, let the criteria be pushed back into place
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java 2012-05-16 02:06:06 UTC (rev 4107)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java 2012-05-16 02:06:17 UTC (rev 4108)
@@ -1298,7 +1298,8 @@
depExpressions.add(dsc.getExpression());
continue;
}
- if (sourceNode.getType() == NodeConstants.Types.SOURCE) {
+ switch (sourceNode.getType()) {
+ case NodeConstants.Types.SOURCE: {
PlanNode child = sourceNode.getFirstChild();
child = FrameUtil.findOriginatingNode(child, child.getGroups());
if (child != null && child.getType() == NodeConstants.Types.SET_OP) {
@@ -1320,7 +1321,16 @@
NodeEditor.removeChildNode(planNode.getParent(), planNode);
}
rpsc.getCreatedNodes().clear();
- }
+ break;
+ }
+ case NodeConstants.Types.GROUP: {
+ if (rpsc.pushAcrossGroupBy(sourceNode, critNode, metadata, false)) {
+ critNodes.add(critNode);
+ initialTargets.add(sourceNode.getFirstChild());
+ }
+ break;
+ }
+ }
//the source must be a null or project node, which we don't care about
}
return targets;
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2012-05-16 02:06:06 UTC (rev 4107)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2012-05-16 02:06:17 UTC (rev 4108)
@@ -136,13 +136,7 @@
}
case NodeConstants.Types.GROUP:
{
- if (!critNode.hasBooleanProperty(NodeConstants.Info.IS_HAVING)) {
- SymbolMap symbolMap = (SymbolMap) sourceNode.getProperty(NodeConstants.Info.SYMBOL_MAP);
- FrameUtil.convertNode(critNode, null, null, symbolMap.asMap(), metadata, true);
- NodeEditor.removeChildNode(critNode.getParent(), critNode);
- sourceNode.getFirstChild().addAsParent(critNode);
- moved = true;
- }
+ moved = pushAcrossGroupBy(sourceNode, critNode, metadata, true);
}
}
@@ -157,6 +151,29 @@
return plan;
}
+ boolean pushAcrossGroupBy(PlanNode sourceNode,
+ PlanNode critNode, QueryMetadataInterface metadata, boolean inPlan)
+ throws QueryPlannerException {
+ boolean moved = false;
+ if (!critNode.hasBooleanProperty(NodeConstants.Info.IS_HAVING)) {
+ SymbolMap symbolMap = (SymbolMap) sourceNode.getProperty(NodeConstants.Info.SYMBOL_MAP);
+ FrameUtil.convertNode(critNode, null, null, symbolMap.asMap(), metadata, true);
+ if (inPlan) {
+ NodeEditor.removeChildNode(critNode.getParent(), critNode);
+ sourceNode.getFirstChild().addAsParent(critNode);
+ }
+ moved = true;
+ if (critNode.hasBooleanProperty(NodeConstants.Info.IS_DEPENDENT_SET)) {
+ PlanNode accessNode = NodeEditor.findParent(critNode, NodeConstants.Types.ACCESS);
+ if (accessNode != null) {
+ markDependent(critNode, accessNode);
+ moved = false; //terminal position
+ }
+ }
+ }
+ return moved;
+ }
+
private PlanNode findOriginatingNode(QueryMetadataInterface metadata,
CapabilitiesFinder capFinder, PlanNode critNode, AnalysisRecord record)
throws TeiidComponentException, QueryMetadataException {
@@ -302,7 +319,8 @@
currentNode = path.pop();
// Look for situations where we don't allow SELECT to be pushed
- if(currentNode.getType() == NodeConstants.Types.ACCESS) {
+ switch (currentNode.getType()) {
+ case NodeConstants.Types.ACCESS:
try {
if (!RuleRaiseAccess.canRaiseOverSelect(currentNode, metadata, capFinder, critNode, null)) {
return currentNode;
@@ -311,7 +329,8 @@
satisfyAccessPatterns(critNode, currentNode);
}
- if (critNode.hasBooleanProperty(NodeConstants.Info.IS_DEPENDENT_SET)) {
+ if (critNode.hasBooleanProperty(NodeConstants.Info.IS_DEPENDENT_SET)
+ && NodeEditor.findNodePreOrder(currentNode.getFirstChild(), NodeConstants.Types.GROUP, NodeConstants.Types.SOURCE) == null) {
//once a dependent crit node is pushed, don't bother pushing it further into the command
//dependent access node will use this as an assumption for where dependent sets can appear in the command
critNode.setProperty(NodeConstants.Info.IS_PUSHED, Boolean.TRUE);
@@ -321,7 +340,8 @@
} catch(QueryMetadataException e) {
throw new QueryPlannerException(QueryPlugin.Event.TEIID30267, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30267, currentNode.getGroups()));
}
- } else if(currentNode.getType() == NodeConstants.Types.JOIN) {
+ break;
+ case NodeConstants.Types.JOIN:
//pushing below a join is not necessary under an access node
if (this.createdNodes == null && NodeEditor.findParent(currentNode, NodeConstants.Types.ACCESS) != null) {
return currentNode;
@@ -343,14 +363,25 @@
}
satisfyAccessPatterns(critNode, currentNode);
- } else if (FrameUtil.isOrderedOrStrictLimit(currentNode)) {
- return currentNode;
- }
+ break;
+ default:
+ if (FrameUtil.isOrderedOrStrictLimit(currentNode)) {
+ return currentNode;
+ }
+ }
}
-
return sourceNode;
}
+ private void markDependent(PlanNode critNode, PlanNode accessNode) {
+ //once a dependent crit node is pushed, don't bother pushing it further into the command
+ //dependent access node will use this as an assumption for where dependent sets can appear in the command
+ critNode.setProperty(NodeConstants.Info.IS_PUSHED, Boolean.TRUE);
+ if (createdNodes == null) {
+ accessNode.setProperty(NodeConstants.Info.IS_DEPENDENT_SET, Boolean.TRUE);
+ }
+ }
+
boolean pushAcrossFrame(PlanNode sourceNode, PlanNode critNode, QueryMetadataInterface metadata)
throws QueryPlannerException {
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java 2012-05-16 02:06:06 UTC (rev 4107)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestVirtualDepJoin.java 2012-05-16 02:06:17 UTC (rev 4108)
@@ -636,8 +636,8 @@
ProcessorPlan plan = TestProcessor.helpGetPlan(command, metadata, finder, context);
TestOptimizer.checkNodeTypes(plan, new int[] {
- 2, // Access
- 0, // DependentAccess
+ 1, // Access
+ 1, // DependentAccess
0, // DependentSelect
0, // DependentProject
0, // DupRemove
@@ -652,7 +652,7 @@
0 // UnionAll
});
- TestOptimizer.checkDependentJoinCount(plan, 0);
+ TestOptimizer.checkDependentJoinCount(plan, 1);
// Run query
TestProcessor.helpProcess(plan, context, dataManager, expected);
}
12 years, 8 months