3 Replies Latest reply on Feb 24, 2006 12:50 AM by Srivathsa

    Significance of wakeUpIntervalSeconds ?

    Srivathsa Newbie

      Hi ppl,
      Thanks 4 the support u r giving....
      Here i have another doubt....I am not clear with the concept of wakeUpIntervalSeconds.....
      Can anyone explain me in detail what is the significance of it in evicting a node......

        • 1. Re: Significance of wakeUpIntervalSeconds ?
          Ben Wang Master

          That's the eviction thread wake up interval to process eviction.

          • 2. Re: Significance of wakeUpIntervalSeconds ?
            Srivathsa Newbie

            Do you mean to say if in this period the node is not accessed it will be evicted.
            In the test cases dealing with wakeUpIntervalSeconds you have used a method called _sleep(period ) where the period depends on wakeUpIntervalSeconds. How is this going to affect the performance of the test case.

            • 3. Re: Significance of wakeUpIntervalSeconds ?
              Srivathsa Newbie

              Here in the Code pasted below what I have seen is that the value of the node /aop/3 is null if it is not processed in the last 9.950sec. The value given for the wakeUpIntervalSecond is 5 sec and for the timeToLiveSeconds for region /aop is 4 sec.
              When I access the node /aop/3/1 even after 13 sec without processig in the mean time i am able to access it.Is this because I am refreshing the node /aop/3.
              But when iam trying to retrieve the value of /aop/3 after refreshing /aop/3/1 i am getting null value.
              Could u explain all of this number game of eviction.....


              public void testUpdateEviction() {
              String rootStr = "/aop/";
              AOPInstance aop = new AOPInstance();
              try {
              for(int i=0; i < 4; i++) {
              String stri = rootStr +i;
              Fqn fqni = Fqn.fromString(stri);
              cache_.put(fqni, stri, stri);
              cache_.put(fqni, AOPInstance.KEY, aop); // signals that this is an aop node.
              cache_.put(fqni, InternalDelegate.CLASS_INTERNAL, String.class); // signals that this is an aop node.
              for(int j=0; j < 2; j++) {
              String strj = stri +"/" +j;
              Fqn fqnj = Fqn.fromString(strj);
              cache_.put(fqnj, strj, strj);
              }
              }
              } catch (Exception e) {
              e.printStackTrace();
              fail("Failed to insert data" +e);
              }

              int period = (wakeupIntervalMillis_ +1000);
              log("period is " +period);
              // _sleep(period); // it really depends on the eviction thread time.
              String str = rootStr + "3";
              Fqn fqn = Fqn.fromString(str);
              System.out.println(cache_.toString(true));
              try {
              String val = (String)cache_.get(fqn, str); // just to keep it fresh
              System.out.println("val is :"+val);

              //_sleep(period); // it really depends the eviction thread time.
              val = (String)cache_.get(fqn, str); // just to keep it fresh
              System.out.println("val is :"+val);

              //_sleep(period); // it really depends the eviction thread time.
              val = (String)cache_.get(rootStr +"3/1", rootStr+"3/1");
              System.out.println("val is :"+val);
              assertNotNull("Node should not be empty ", val);
              //_sleep(wakeupIntervalMillis_ +2000);
              _sleep(period + 2000);
              val = (String)cache_.get(rootStr +"3", rootStr+"3");
              System.out.println("val is :"+val);
              assertNotNull("Node should be empty. But this is broken because of TreeCache._removeData() has disabled " +
              "sendNodeEvent. See the FIXME. ", val);
              } catch (Exception e) {
              e.printStackTrace();
              }
              }