Examples of FIFOAlgorithmConfig


Examples of org.jboss.cache.eviction.FIFOAlgorithmConfig

   protected void createCaches() throws Throwable
   {
      Configuration c = new Configuration();

      // the FIFO policy cfg
      FIFOAlgorithmConfig cfg = new FIFOAlgorithmConfig();
      cfg.setMaxNodes(1);
      cfg.setMinTimeToLive(0);

      // the region configuration
      EvictionRegionConfig regionCfg = new EvictionRegionConfig();
      regionCfg.setRegionFqn(dummy.getParent());
      regionCfg.setRegionName(dummy.getParent().toString());
View Full Code Here

Examples of org.jboss.cache.eviction.FIFOAlgorithmConfig

      assertEquals("EC default pol", LRUAlgorithm.class.getName(), ec.getDefaultEvictionRegionConfig().getEvictionAlgorithmConfig().getEvictionAlgorithmClassName());
      List<EvictionRegionConfig> ercs = ec.getEvictionRegionConfigs();
      EvictionRegionConfig erc = ercs.get(0);
      assertEquals("ERC1 name", "/org/jboss/data", erc.getRegionName());
      assertEquals("ERC1 queue size", 1000, erc.getEventQueueSize());
      FIFOAlgorithmConfig fifo = (FIFOAlgorithmConfig) erc.getEvictionAlgorithmConfig();
      assertEquals("EPC1 pol", FIFOAlgorithm.class.getName(), fifo.getEvictionAlgorithmClassName());
      assertEquals("EPC1 maxnodes", 5000, fifo.getMaxNodes());
      erc = ercs.get(1);
      assertEquals("ERC2 name", "/test", erc.getRegionName());
      assertEquals("ERC2 queue size", 1000, erc.getEventQueueSize());
      MRUAlgorithmConfig mru = (MRUAlgorithmConfig) erc.getEvictionAlgorithmConfig();
      assertEquals("EPC2 pol", MRUAlgorithm.class.getName(), mru.getEvictionAlgorithmClassName());
View Full Code Here

Examples of org.jboss.cache.eviction.FIFOAlgorithmConfig

               .setExpirationKeyName(ExpirationAlgorithmConfig.EXPIRATION_KEY);
            useExpiration = true;
         }
         else if (config instanceof FIFOAlgorithmConfig)
         {
            FIFOAlgorithmConfig fifoConfig = (FIFOAlgorithmConfig)config;
            if (fifoConfig.getMinTimeToLive() > 0)
            {
               LOG.warn("The FIFO algorithm with a minTimeToLive greater than 0 can cause a memory leak, " +
                   "please use another eviction algorithm or set the minTimeToLive to 0.");
            }
         }
View Full Code Here

Examples of org.jboss.cache.eviction.FIFOAlgorithmConfig

   public void testControl()
   {
      Configuration c = new Configuration();
      c.setEvictionConfig(new EvictionConfig());
      EvictionRegionConfig defaultRegion = c.getEvictionConfig().getDefaultEvictionRegionConfig();
      defaultRegion.setEvictionAlgorithmConfig(new FIFOAlgorithmConfig(2));
      doTest(c);
   }
View Full Code Here

Examples of org.jboss.cache.eviction.FIFOAlgorithmConfig

    */
   private ExoCache<Serializable, Object> create(ExoCacheConfig config, Cache<Serializable, Object> cache,
            int maxNodes, long minTimeToLive)
      throws ExoCacheInitException
   {
      final FIFOAlgorithmConfig fifo = new FIFOAlgorithmConfig(maxNodes);
      fifo.setMinTimeToLive(minTimeToLive);
      Fqn<String> rooFqn = addEvictionRegion(config, cache, fifo);
      return new FIFOExoCache(config, cache, rooFqn, fifo);
   }
View Full Code Here

Examples of org.jboss.cache.eviction.FIFOAlgorithmConfig

      log.trace("**** setup called");

      Configuration c = new Configuration();
     
      // the FIFO policy cfg
      FIFOAlgorithmConfig cfg = new FIFOAlgorithmConfig();
      cfg.setMaxNodes(1);
      cfg.setMinTimeToLive(0);

      // the region configuration
      EvictionRegionConfig regionCfg = new EvictionRegionConfig();
      regionCfg.setRegionFqn(dummy.getParent());
      regionCfg.setRegionName(dummy.getParent().toString());
View Full Code Here

Examples of org.jboss.cache.eviction.FIFOAlgorithmConfig

   @Override
   protected EvictionAlgorithmConfigBase getEvictionAlgorithmConfig()
   {
      startBusyThread();
      FIFOAlgorithmConfig cfg = new FIFOAlgorithmConfig();
      cfg.setMaxNodes(1);
      return cfg;
   }
View Full Code Here

Examples of org.jboss.cache.eviction.FIFOAlgorithmConfig

               .setExpirationKeyName(ExpirationAlgorithmConfig.EXPIRATION_KEY);
            useExpiration = true;
         }
         else if (config instanceof FIFOAlgorithmConfig)
         {
            FIFOAlgorithmConfig fifoConfig = (FIFOAlgorithmConfig)config;
            if (fifoConfig.getMinTimeToLive() > 0)
            {
               LOG.warn("The FIFO algorithm with a minTimeToLive greater than 0 can cause a memory leak, "
                  + "please use another eviction algorithm or set the minTimeToLive to 0.");
            }
         }
View Full Code Here

Examples of org.jboss.cache.eviction.FIFOAlgorithmConfig

               .setExpirationKeyName(ExpirationAlgorithmConfig.EXPIRATION_KEY);
            useExpiration = true;
         }
         else if (config instanceof FIFOAlgorithmConfig)
         {
            FIFOAlgorithmConfig fifoConfig = (FIFOAlgorithmConfig)config;
            if (fifoConfig.getMinTimeToLive() > 0)
            {
               LOG.warn("The FIFO algorithm with a minTimeToLive greater than 0 can cause a memory leak, " +
                   "please use another eviction algorithm or set the minTimeToLive to 0.");
            }
         }
View Full Code Here

Examples of org.jboss.cache.eviction.FIFOAlgorithmConfig

               .setExpirationKeyName(ExpirationAlgorithmConfig.EXPIRATION_KEY);
            useExpiration = true;
         }
         else if (config instanceof FIFOAlgorithmConfig)
         {
            FIFOAlgorithmConfig fifoConfig = (FIFOAlgorithmConfig)config;
            if (fifoConfig.getMinTimeToLive() > 0)
            {
               LOG.warn("The FIFO algorithm with a minTimeToLive greater than 0 can cause a memory leak, "
                  + "please use another eviction algorithm or set the minTimeToLive to 0.");
            }
         }
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.