use of org.teiid.metadata.AbstractMetadataRecord.Modifiable in project teiid by teiid.
the class AccessInfo method restore.
/**
* Restore reconnects to the live metadata objects
* @throws TeiidComponentException
* @throws TeiidProcessingException
*/
void restore() throws TeiidComponentException, TeiidProcessingException {
if (this.objectsAccessed != null) {
return;
}
VDBMetaData vdb = DQPWorkContext.getWorkContext().getVDB();
TransformationMetadata tm = vdb.getAttachment(TransformationMetadata.class);
GlobalTableStore globalStore = vdb.getAttachment(GlobalTableStore.class);
if (!externalNames.isEmpty()) {
this.objectsAccessed = new HashSet<Object>(externalNames.size());
for (List<String> key : this.externalNames) {
if (key.size() == 1) {
String matTableName = key.get(0);
TempMetadataID id = globalStore.getGlobalTempTableMetadataId(matTableName);
if (id == null) {
// if the id is null, then create a local instance
String viewFullName = matTableName.substring(RelationalPlanner.MAT_PREFIX.length());
id = globalStore.getGlobalTempTableMetadataId(tm.getGroupID(viewFullName));
}
this.objectsAccessed.add(id);
} else {
Schema s = tm.getMetadataStore().getSchema(key.get(0));
Modifiable m = s.getTables().get(key.get(1));
if (m == null) {
m = s.getProcedures().get(key.get(1));
}
if (m != null) {
this.objectsAccessed.add(m);
}
}
}
} else {
this.objectsAccessed = Collections.emptySet();
}
this.externalNames = null;
}
Aggregations