Package org.teiid.cache

Examples of org.teiid.cache.DefaultCache


    Table t = RealMetadataFactory.exampleBQT().getGroupID("bqt1.smalla");
    cc.accessedDataObject(t);
    plan.setContext(cc);
    results.setResults(tb, plan);
    results.setCommand(new Query());
    Cache cache = new DefaultCache("dummy"); //$NON-NLS-1$
    long ts = results.getAccessInfo().getCreationTime();
    // simulate the jboss-cache remote transport, where the batches are remotely looked up
    // in cache
    for (int row=1; row<=tb.getRowCount();row+=4) {
      cache.put(results.getId()+","+row, tb.getBatch(row), null); //$NON-NLS-1$
    }
   
    results.prepare(cache, bm);
   
    CachedResults cachedResults = UnitTestUtil.helpSerialize(results);
   
    FakeMetadataFactory.buildWorkContext(RealMetadataFactory.exampleBQT());
   
    cachedResults.restore(cache, bm);
   
    // since restored, simulate a async cache flush
    cache.clear();
   
    TupleBuffer cachedTb = cachedResults.getResults();
   
    assertTrue(cachedTb.isFinal());
    assertEquals(tb.getRowCount(), cachedTb.getRowCount());
View Full Code Here

TOP

Related Classes of org.teiid.cache.DefaultCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.