Search in sources :

Example 6 with TempTableStore

use of org.teiid.query.tempdata.TempTableStore in project teiid by teiid.

the class Program method reset.

/**
 * Resets this program, so it can be run through again.
 */
public void reset(String sessionId) {
    counter = 0;
    this.tempTables = new TempTableStore(sessionId, TransactionMode.ISOLATE_WRITES);
    this.startedTxn = false;
    this.trappingExceptions = false;
}
Also used : TempTableStore(org.teiid.query.tempdata.TempTableStore)

Example 7 with TempTableStore

use of org.teiid.query.tempdata.TempTableStore in project teiid by teiid.

the class TestMaterialization method setUp.

@Before
public void setUp() {
    // $NON-NLS-1$
    tempStore = new TempTableStore("1", TransactionMode.ISOLATE_WRITES);
    BufferManager bm = BufferManagerFactory.getStandaloneBufferManager();
    TransformationMetadata actualMetadata = RealMetadataFactory.exampleMaterializedView();
    globalStore = new GlobalTableStoreImpl(bm, actualMetadata.getVdbMetaData(), actualMetadata);
    metadata = new TempMetadataAdapter(actualMetadata, tempStore.getMetadataStore());
    hdm = new HardcodedDataManager();
    hdm.addData("SELECT MatSrc.MatSrc.x FROM MatSrc.MatSrc", new List[] { Arrays.asList((String) null), Arrays.asList("one"), Arrays.asList("two"), Arrays.asList("three") });
    hdm.addData("SELECT MatTable.info.e1, MatTable.info.e2 FROM MatTable.info", new List[] { Arrays.asList("a", 1), Arrays.asList("a", 2) });
    hdm.addData("SELECT MatTable.info.e2, MatTable.info.e1 FROM MatTable.info", new List[] { Arrays.asList(1, "a"), Arrays.asList(2, "a") });
    SessionAwareCache<CachedResults> cache = new SessionAwareCache<CachedResults>("resultset", DefaultCacheFactory.INSTANCE, SessionAwareCache.Type.RESULTSET, 0);
    cache.setTupleBufferCache(bm);
    dataManager = new TempTableDataManager(hdm, bm, cache);
}
Also used : TempMetadataAdapter(org.teiid.query.metadata.TempMetadataAdapter) TempTableStore(org.teiid.query.tempdata.TempTableStore) TransformationMetadata(org.teiid.query.metadata.TransformationMetadata) SessionAwareCache(org.teiid.dqp.internal.process.SessionAwareCache) TempTableDataManager(org.teiid.query.tempdata.TempTableDataManager) BufferManager(org.teiid.common.buffer.BufferManager) GlobalTableStoreImpl(org.teiid.query.tempdata.GlobalTableStoreImpl) CachedResults(org.teiid.dqp.internal.process.CachedResults) Before(org.junit.Before)

Example 8 with TempTableStore

use of org.teiid.query.tempdata.TempTableStore in project teiid by teiid.

the class TempTableTestHarness method setUp.

public void setUp(QueryMetadataInterface qmi, ProcessorDataManager dm, BufferManager bm) {
    // $NON-NLS-1$
    tempStore = new TempTableStore("1", TransactionMode.ISOLATE_WRITES);
    metadata = new TempMetadataAdapter(qmi, tempStore.getMetadataStore());
    metadata.setSession(true);
    SessionAwareCache<CachedResults> cache = new SessionAwareCache<CachedResults>("resultset", DefaultCacheFactory.INSTANCE, SessionAwareCache.Type.RESULTSET, 0);
    cache.setTupleBufferCache(bm);
    dataManager = new TempTableDataManager(dm, bm, cache);
}
Also used : TempMetadataAdapter(org.teiid.query.metadata.TempMetadataAdapter) TempTableStore(org.teiid.query.tempdata.TempTableStore) SessionAwareCache(org.teiid.dqp.internal.process.SessionAwareCache) TempTableDataManager(org.teiid.query.tempdata.TempTableDataManager) CachedResults(org.teiid.dqp.internal.process.CachedResults)

Aggregations

TempTableStore (org.teiid.query.tempdata.TempTableStore)8 CachedResults (org.teiid.dqp.internal.process.CachedResults)3 SessionAwareCache (org.teiid.dqp.internal.process.SessionAwareCache)3 TempMetadataAdapter (org.teiid.query.metadata.TempMetadataAdapter)3 TempTableDataManager (org.teiid.query.tempdata.TempTableDataManager)3 BufferManager (org.teiid.common.buffer.BufferManager)2 TransactionContext (org.teiid.dqp.service.TransactionContext)2 VariableContext (org.teiid.query.sql.util.VariableContext)2 GlobalTableStoreImpl (org.teiid.query.tempdata.GlobalTableStoreImpl)2 Before (org.junit.Before)1 XATransactionException (org.teiid.client.xa.XATransactionException)1 BlockedException (org.teiid.common.buffer.BlockedException)1 TupleBuffer (org.teiid.common.buffer.TupleBuffer)1 TupleSource (org.teiid.common.buffer.TupleSource)1 BufferManagerImpl (org.teiid.common.buffer.impl.BufferManagerImpl)1 TeiidComponentException (org.teiid.core.TeiidComponentException)1 TeiidProcessingException (org.teiid.core.TeiidProcessingException)1 DataTierTupleSource (org.teiid.dqp.internal.process.DataTierTupleSource)1 QueryProcessorFactoryImpl (org.teiid.dqp.internal.process.QueryProcessorFactoryImpl)1 TransactionService (org.teiid.dqp.service.TransactionService)1