Package org.teiid.cache

Examples of org.teiid.cache.Cachable.prepare()


    SessionAwareCache<Cachable> cache = new SessionAwareCache<Cachable>();
   
    CacheID id = new CacheID(buildWorkContext(), new ParseInfo(), "SELECT * FROM FOO");
   
    Cachable result = Mockito.mock(Cachable.class);
    Mockito.stub(result.prepare((Cache)anyObject(), (BufferManager)anyObject())).toReturn(true);
    Mockito.stub(result.restore((Cache)anyObject(), (BufferManager)anyObject())).toReturn(true);
       
    cache.put(id, Determinism.USER_DETERMINISTIC, result, null);
   
    // make sure that in the case of session specific; we do not call prepare
View Full Code Here


    SessionAwareCache<Cachable> cache = new SessionAwareCache<Cachable>();
   
    CacheID id = new CacheID(buildWorkContext(), new ParseInfo(), "SELECT * FROM FOO");
   
    Cachable result = Mockito.mock(Cachable.class);
    Mockito.stub(result.prepare((Cache)anyObject(), (BufferManager)anyObject())).toReturn(true);
    Mockito.stub(result.restore((Cache)anyObject(), (BufferManager)anyObject())).toReturn(true);   
   
    cache.put(id, Determinism.VDB_DETERMINISTIC, result, null);
   
    // make sure that in the case of session specific; we do not call prepare
View Full Code Here

    SessionAwareCache<Cachable> cache = new SessionAwareCache<Cachable>();
   
    CacheID id = new CacheID(buildWorkContext(), new ParseInfo(), "SELECT * FROM FOO");
   
    Cachable result = Mockito.mock(Cachable.class);
    Mockito.stub(result.prepare((Cache)anyObject(), (BufferManager)anyObject())).toReturn(true);
    Mockito.stub(result.restore((Cache)anyObject(), (BufferManager)anyObject())).toReturn(true);   
   
    id = new CacheID(buildWorkContext(), new ParseInfo(), "SELECT * FROM FOO");
    cache.put(id, Determinism.VDB_DETERMINISTIC, result, null);
   
View Full Code Here

        id.setUserName(null);
      }
     
      if (t instanceof Cachable) {
        Cachable c = (Cachable)t;
        insert = c.prepare(this.tupleBatchCache, this.bufferManager);
      }
     
      if (insert) {
        LogManager.logTrace(LogConstants.CTX_DQP, "Adding to global/distributed cache", id); //$NON-NLS-1$
        this.distributedCache.put(id, t, ttl);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.