Search in sources :

Example 6 with GlobalTableStore

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();
}
Also used : GlobalTableStore(org.teiid.query.tempdata.GlobalTableStore)

Example 7 with GlobalTableStore

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);
}
Also used : GlobalTableStore(org.teiid.query.tempdata.GlobalTableStore) VDBMetaData(org.teiid.adminapi.impl.VDBMetaData) QueryMetadataInterface(org.teiid.query.metadata.QueryMetadataInterface) GlobalTableStoreImpl(org.teiid.query.tempdata.GlobalTableStoreImpl) TreeMap(java.util.TreeMap) TeiidComponentException(org.teiid.core.TeiidComponentException) QueryMetadataException(org.teiid.api.exception.query.QueryMetadataException) TeiidProcessingException(org.teiid.core.TeiidProcessingException)

Example 8 with GlobalTableStore

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);
            }
        }
    }
}
Also used : GlobalTableStore(org.teiid.query.tempdata.GlobalTableStore) VDBMetaData(org.teiid.adminapi.impl.VDBMetaData)

Aggregations

GlobalTableStore (org.teiid.query.tempdata.GlobalTableStore)8 VDBMetaData (org.teiid.adminapi.impl.VDBMetaData)5 MetadataStore (org.teiid.metadata.MetadataStore)2 Schema (org.teiid.metadata.Schema)2 QueryMetadataInterface (org.teiid.query.metadata.QueryMetadataInterface)2 GlobalTableStoreImpl (org.teiid.query.tempdata.GlobalTableStoreImpl)2 VDBKey (org.teiid.vdb.runtime.VDBKey)2 TreeMap (java.util.TreeMap)1 Test (org.junit.Test)1 SessionMetadata (org.teiid.adminapi.impl.SessionMetadata)1 QueryMetadataException (org.teiid.api.exception.query.QueryMetadataException)1 InvalidSessionException (org.teiid.client.security.InvalidSessionException)1 TeiidComponentException (org.teiid.core.TeiidComponentException)1 TeiidProcessingException (org.teiid.core.TeiidProcessingException)1 CompositeGlobalTableStore (org.teiid.deployers.CompositeGlobalTableStore)1 CompositeVDB (org.teiid.deployers.CompositeVDB)1 VDBLifeCycleListener (org.teiid.deployers.VDBLifeCycleListener)1 DataModifiable (org.teiid.metadata.AbstractMetadataRecord.DataModifiable)1 Modifiable (org.teiid.metadata.AbstractMetadataRecord.Modifiable)1 MetadataException (org.teiid.metadata.MetadataException)1