2 Replies Latest reply on Apr 28, 2009 10:16 PM by krishnan366

    ExpirationPolicy not working

    krishnan366

      Hi ,
      I am setting up expirationalgorithm in my code as follows


      long timeout = 60*1000;
      Long expTime = new Long(System.currentTimeMillis()+timeout);
       ExpirationAlgorithmConfig expirationConfiguration = new ExpirationAlgorithmConfig();
       expirationConfiguration.setTimeToLive(1000);
       expirationConfiguration.setExpirationKeyName("expiryTime");
      
       EvictionConfig ec = new EvictionConfig();
       List<EvictionRegionConfig> ercs = new ArrayList<EvictionRegionConfig>();
      
      
       keyNode.put(ExpirationAlgorithmConfig.EXPIRATION_KEY, expTime);
       EvictionRegionConfig erc = new EvictionRegionConfig(keyNode.getFqn(), expirationConfiguration);
      
       ercs.add(erc);
       ec.setEvictionRegionConfigs(ercs);
       objCache.getConfiguration().setEvictionConfig(ec);
      


      1) On setting this , I expect eviction to run after a minute on this node, but it does not .

      2) I do not have any settings in my config file for eviction. I do have a Cacheloader setup in my config file. On eviction , will the node get expired and be removed from cacheloader as well ?

      From the log files



      EvictionRegionConfig{regionFqn=/data/key109, eventQueueSize=null, evictionAlgorithmConfig=ExpirationAlgorithmConfig{expirationKeyName='expiryTime', warnNoExpirationKey=true, timeToLive=1000, maxNodes=-1, minTTL=-1}, evictionActionPolicyClassName='null'}


      Is there anything else I am missing for the eviction to run?