Package org.teiid.cache

Examples of org.teiid.cache.CacheConfiguration


        core.setTransactionService(new FakeTransactionService());
       
        config = new DQPConfiguration();
        config.setMaxActivePlans(1);
        config.setUserRequestSourceConcurrency(2);
        config.setResultsetCacheConfig(new CacheConfiguration());
        core.start(config);
        core.getPrepPlanCache().setModTime(1);
        core.getRsCache().setModTime(1);
    }
View Full Code Here


        this.bufferManager = bufferManager;
        this.executor = executor;
        this.cache = cache;
        this.distributedCache = distibutedCache;
        if (distibutedCache != null) {
          CacheConfiguration cc = new CacheConfiguration(Policy.LRU, -1, -1, "MaterializationUpdates"); //$NON-NLS-1$
          tables = cacheFactory.get(cc.getLocation(), cc);
        }
    }
View Full Code Here

            return new BasicSourceCapabilities();
          }
        });
       
        DQPConfiguration config = new DQPConfiguration();
        config.setResultsetCacheConfig(new CacheConfiguration(Policy.LRU, 60, 250, "resultsetcache")); //$NON-NLS-1$
        this.dqp.setCacheFactory(new DefaultCacheFactory());
        this.dqp.start(config);
        this.sessionService.setDqp(this.dqp);
       
        registerClientService(ILogon.class, logon, null);
View Full Code Here

  public SessionAwareCache(){
    this(DEFAULT_MAX_SIZE_TOTAL);
  }
 
  SessionAwareCache(int maxSize){
    this(new DefaultCacheFactory(), Type.RESULTSET, new CacheConfiguration(Policy.LRU, 60, maxSize, "default")); //$NON-NLS-1$
  }
View Full Code Here

        //get buffer manager
        this.bufferManager = bufferService.getBufferManager();
       
        //result set cache
        CacheConfiguration rsCacheConfig = config.getResultsetCacheConfig();
        if (rsCacheConfig != null && rsCacheConfig.isEnabled()) {
      this.rsCache = new SessionAwareCache<CachedResults>(this.cacheFactory, SessionAwareCache.Type.RESULTSET, rsCacheConfig);
      this.rsCache.setBufferManager(this.bufferManager);
        }

        //prepared plan cache
        CacheConfiguration ppCacheConfig = config.getPreparedPlanCacheConfig();
        prepPlanCache = new SessionAwareCache<PreparedPlan>(this.cacheFactory, SessionAwareCache.Type.PREPAREDPLAN,  ppCacheConfig);
        prepPlanCache.setBufferManager(this.bufferManager);
   
        this.processWorkerPool = new ThreadReuseExecutor(DQPConfiguration.PROCESS_PLAN_QUEUE_NAME, config.getMaxThreads());
        this.maxActivePlans = config.getMaxActivePlans();
       
        if (this.maxActivePlans > config.getMaxThreads()) {
          LogManager.logWarning(LogConstants.CTX_DQP, QueryPlugin.Util.getString("DQPCore.invalid_max_active_plan", this.maxActivePlans, config.getMaxThreads())); //$NON-NLS-1$
          this.maxActivePlans = config.getMaxThreads();
        }

        //hack to set the max active plans
        this.bufferManager.setMaxActivePlans(this.maxActivePlans);
        try {
      this.bufferManager.initialize();
    } catch (TeiidComponentException e) {
      throw new TeiidRuntimeException(e);
    }
       
        this.userRequestSourceConcurrency = config.getUserRequestSourceConcurrency();
        if (this.userRequestSourceConcurrency < 1) {
          this.userRequestSourceConcurrency = Math.min(config.getMaxThreads(), 2*config.getMaxThreads()/this.maxActivePlans);
        }
       
        if (cacheFactory.isReplicated()) {
          matTables = new SessionAwareCache<CachedResults>(this.cacheFactory, SessionAwareCache.Type.RESULTSET, new CacheConfiguration(Policy.EXPIRATION, -1, -1, "MaterilizationTables")); //$NON-NLS-1$
          matTables.setBufferManager(this.bufferManager);
        }
       
        DataTierManagerImpl processorDataManager = new DataTierManagerImpl(this,this.bufferService, this.config.isDetectingChangeEvents());
        processorDataManager.setEventDistributor(eventDistributor);
View Full Code Here

TOP

Related Classes of org.teiid.cache.CacheConfiguration

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.