use of org.teiid.query.tempdata.GlobalTableStore in project teiid by teiid.
the class VDBRepository method removeVDB.
private VDBMetaData removeVDB(VDBKey key) {
notifyBeforeRemove(key.getName(), key.getVersion(), this.vdbRepo.get(key));
this.pendingDeployments.remove(key);
CompositeVDB removed = this.vdbRepo.remove(key);
if (removed == null) {
return null;
}
removed.getVDB().setStatus(Status.REMOVED);
// stop object replication
if (this.objectReplictor != null) {
GlobalTableStore gts = removed.getVDB().getAttachment(GlobalTableStore.class);
this.objectReplictor.stop(gts);
}
notifyRemove(key.getName(), key.getVersion(), removed);
return removed.getVDB();
}
use of org.teiid.query.tempdata.GlobalTableStore in project teiid by teiid.
the class CompositeGlobalTableStore method createInstance.
public static GlobalTableStore createInstance(CompositeVDB vdb, BufferManager bufferManager, ObjectReplicator replicator) {
VDBMetaData vdbMetadata = vdb.getVDB();
QueryMetadataInterface metadata = vdbMetadata.getAttachment(TransformationMetadata.class);
GlobalTableStore gts = new GlobalTableStoreImpl(bufferManager, vdbMetadata, metadata);
if (replicator != null) {
try {
gts = replicator.replicate(vdbMetadata.getFullName(), GlobalTableStore.class, gts, 300000);
} catch (Exception e) {
LogManager.logError(LogConstants.CTX_RUNTIME, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40088, gts));
}
}
if (vdb.getChildren() == null) {
return gts;
}
TreeMap<String, GlobalTableStore> stores = new TreeMap<String, GlobalTableStore>(String.CASE_INSENSITIVE_ORDER);
buildStoreMap(vdb, stores);
return new CompositeGlobalTableStore(stores, gts, metadata);
}
use of org.teiid.query.tempdata.GlobalTableStore in project teiid by teiid.
the class CompositeGlobalTableStore method buildStoreMap.
static void buildStoreMap(CompositeVDB vdb, TreeMap<String, GlobalTableStore> stores) {
for (CompositeVDB cvdb : vdb.getChildren().values()) {
VDBMetaData child = cvdb.getVDB();
GlobalTableStore childGts = child.getAttachment(GlobalTableStore.class);
if (cvdb.getChildren() != null) {
buildStoreMap(cvdb, stores);
}
for (String name : child.getModelMetaDatas().keySet()) {
if (cvdb.getChildren() == null || !child.getImportedModels().contains(name)) {
stores.put(name, childGts);
}
}
}
}
Aggregations