Examples of CacheConfiguration


Examples of org.teiid.cache.CacheConfiguration

        //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

Examples of org.wso2.caching.CacheConfiguration

     *          or if there is a problem in loading the DigestGenerator
     */
    public static CacheConfiguration processCachingPolicy(PolicySubject policySubject) throws CachingException {

        if (policySubject.getAttachedPolicyComponents().size() != 0) {
            CacheConfiguration cacheConfig = new CacheConfiguration();
            Collection topLevelAssertionList = policySubject.getAttachedPolicyComponents();
            handlePolicyComponents(cacheConfig, topLevelAssertionList);
            return cacheConfig;
        } else {
            return null;
View Full Code Here

Examples of org.wso2.carbon.caching.core.CacheConfiguration

     * {@inheritDoc}
     */
    public void initialize(String carbonHome) {
        CarbonBaseUtils.checkSecurity(ALLOWED_CLASSES);
        log.debug("Starting Cache Manager initialization");
        CacheConfiguration cacheConfiguration = CacheConfiguration.getInstance();

        // Infinispan requires the bind.address system property to be set to function as a
        // distributed cache. This has been done in CarbonServerManager#initializeCarbon()
        GlobalConfiguration globalConfiguration;
        if (Boolean.toString(true).equals(
                cacheConfiguration.getProperty("configuration.clustering.enabled"))) {
            globalConfiguration = GlobalConfiguration.getClusteredDefault();
            String clusterName =
                    cacheConfiguration.getProperty("configuration.clustering.clusterName");
            if (clusterName != null) {
                globalConfiguration.setClusterName(clusterName);
            } else {
                globalConfiguration.setClusterName(DEFAULT_CLUSTER_NAME);
            }
        } else {
            globalConfiguration = GlobalConfiguration.getNonClusteredDefault();
        }

        String ec2ConfigFile = cacheConfiguration.getProperty("configuration.ec2.configFile");
        if (ec2ConfigFile != null) {
            Properties props = new Properties();
            props.setProperty("configurationFile", ec2ConfigFile.replace("${carbon.home}",
                    carbonHome));
            globalConfiguration.setTransportProperties(props);
        }

        globalConfiguration.setAllowDuplicateDomains(true);

        Configuration configuration = new Configuration();

        String cacheMode = cacheConfiguration.getProperty("configuration.cacheMode");
        boolean sync = Boolean.toString(true).equals(
                cacheConfiguration.getProperty("configuration.sync"));
        if ("distributed".equals(cacheMode)) {
            configuration.setCacheMode(sync ?
                    Configuration.CacheMode.DIST_SYNC : Configuration.CacheMode.DIST_ASYNC);
            if (log.isDebugEnabled()) {
                log.debug("Infinispan Cache Mode  : " + cacheMode +
                        (sync ? " (synchronous)" : " (asynchronous)"));
            }
            if (Boolean.toString(true).equals(
                    cacheConfiguration.getProperty("configuration.l1.enabled"))) {
                configuration.setL1CacheEnabled(true);
                String l1Lifespan = cacheConfiguration.getProperty("configuration.l1.lifespan");
                if (l1Lifespan != null) {
                    configuration.setL1Lifespan(Long.parseLong(l1Lifespan));
                    if (log.isDebugEnabled()) {
                        log.debug("Infinispan L1 Cache    : enabled");
                        log.debug("Infinispan L1 Lifespan : " + l1Lifespan);
View Full Code Here

Examples of org.xwiki.cache.config.CacheConfiguration

     * @throws InterruptedException
     * @throws CacheException
     */
    public void testCache() throws XWikiException, InterruptedException, CacheException
    {
        CacheConfiguration cacheConfigurationGroups = new CacheConfiguration();

        Cache<Map<String, String>> tmpCache = this.ldapUtils.getCache(cacheConfigurationGroups, getContext());
        Cache<Map<String, String>> cache = this.ldapUtils.getCache(cacheConfigurationGroups, getContext());

        assertSame("Cache is recreated", tmpCache, cache);
View Full Code Here

Examples of railo.runtime.cache.eh.remote.rest.sax.CacheConfiguration

 

  public Struct getCustomInfo() {
    Struct info=super.getCustomInfo();
    try  {
      CacheConfiguration conf = rest.getMeta(name).getCacheConfiguration();
     
      info.setEL("disk_expiry_thread_interval", new Double(conf.getDiskExpiryThreadIntervalSeconds()));
      info.setEL("disk_spool_buffer_size", new Double(conf.getDiskSpoolBufferSize()));
      info.setEL("max_elements_in_memory", new Double(conf.getMaxElementsInMemory()));
      info.setEL("max_elements_on_disk", new Double(conf.getMaxElementsOnDisk()));
      info.setEL("time_to_idle", new Double(conf.getTimeToIdleSeconds()));
      info.setEL("time_to_live", new Double(conf.getTimeToLiveSeconds()));
      info.setEL(KeyConstants._name, conf.getName());
    }
    catch(Throwable t){
      //print.printST(t);
    }
   
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.