Author: rareddy
Date: 2011-07-27 13:32:38 -0400 (Wed, 27 Jul 2011)
New Revision: 3341
Modified:
branches/7.1.1.CP3/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
branches/7.1.1.CP3/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
Log:
TEIID-1657: making view name available to the mattable request such that it can be
proactively loaded at other nodes in the cluster
Modified:
branches/7.1.1.CP3/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
---
branches/7.1.1.CP3/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2011-07-27
17:32:30 UTC (rev 3340)
+++
branches/7.1.1.CP3/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2011-07-27
17:32:38 UTC (rev 3341)
@@ -1004,6 +1004,7 @@
id = store.addTempGroup(matTableName, ResolverUtil.resolveElementsInGroup(table,
metadata), false, true);
id.setQueryNode(metadata.getVirtualPlan(table.getMetadataID()));
id.setCardinality(metadata.getCardinality(table.getMetadataID()));
+ id.setOriginalMetadataID(table.getMetadataID());
Object pk = metadata.getPrimaryKey(table.getMetadataID());
if (pk != null) {
Modified:
branches/7.1.1.CP3/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
---
branches/7.1.1.CP3/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-07-27
17:32:30 UTC (rev 3340)
+++
branches/7.1.1.CP3/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-07-27
17:32:38 UTC (rev 3341)
@@ -420,8 +420,13 @@
if (!group.isTempGroupSymbol()) {
return null;
}
+ String viewName = null;
final String tableName = group.getNonCorrelationName().toUpperCase();
boolean remapColumns = !tableName.equalsIgnoreCase(group.getName());
+ TempMetadataID groupID = (TempMetadataID)group.getMetadataID();
+ if (groupID.getOriginalMetadataID() != null) {
+ viewName = context.getMetadata().getFullName(groupID.getOriginalMetadataID());
+ }
TempTable table = null;
if (group.isGlobalTable()) {
final TempTableStore globalStore = context.getGlobalTableStore();
@@ -445,9 +450,9 @@
if (load) {
if (!info.isValid()) {
//blocking load
- loadGlobalTable(context, group, tableName, null, globalStore, info, loadTime,
true);
+ loadGlobalTable(context, group, tableName, viewName, globalStore, info, loadTime,
true);
} else {
- loadAsynch(context, group, tableName, null, globalStore, info, loadTime);
+ loadAsynch(context, group, tableName, viewName, globalStore, info, loadTime);
}
}
table = globalStore.getOrCreateTempTable(tableName, query, bufferManager, false);
@@ -611,8 +616,8 @@
matTableEntry.lastUpdate = System.currentTimeMillis();
MatTableEntry entry = refreshJob.put(key, matTableEntry, null);
if (entry == null) {
- // in the case of refreshjob, cacheCreate are not being notified correctly due to
nature of how Teiid uses the cache
- // so, in order to get a cacheModified event insert again.
+ // Due to nature how the JBoss Cache being used as flat keys with nodes, node creation
event is
+ // hard to capture, this is way to insert and later do update to capture the node
modification.
refreshJob.put(key, matTableEntry, null);
}
}