geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hiteshkhame...@apache.org
Subject incubator-geode git commit: GEODE-1828 Added some more logging to debug further
Date Fri, 02 Sep 2016 22:28:08 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop d2d62d680 -> fac42cbc2


GEODE-1828 Added some more logging to debug further


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/fac42cbc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/fac42cbc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/fac42cbc

Branch: refs/heads/develop
Commit: fac42cbc2e461da50d80c7cd1ae5188227fbc5a6
Parents: d2d62d6
Author: Hitesh Khamesra <hiteshk25@yahoo.com>
Authored: Fri Sep 2 15:15:46 2016 -0700
Committer: Hitesh Khamesra <hiteshk25@yahoo.com>
Committed: Fri Sep 2 15:16:23 2016 -0700

----------------------------------------------------------------------
 .../gemstone/gemfire/internal/cache/EntryExpiryTask.java    | 3 +++
 .../com/gemstone/gemfire/internal/cache/ExpiryTask.java     | 5 +++++
 .../test/java/com/gemstone/gemfire/TXExpiryJUnitTest.java   | 3 +++
 .../java/com/gemstone/gemfire/cache30/RegionTestCase.java   | 9 ++++++---
 4 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fac42cbc/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryExpiryTask.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryExpiryTask.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryExpiryTask.java
index 252c9c3..ac2a054 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryExpiryTask.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryExpiryTask.java
@@ -345,6 +345,9 @@ public class EntryExpiryTask extends ExpiryTask {
     boolean superCancel = super.cancel();
     if (superCancel) {
       this.re = null;
+      if (expiryTaskListener != null) {
+        expiryTaskListener.afterCancel(this);
+      }
     }
     return superCancel;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fac42cbc/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ExpiryTask.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ExpiryTask.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ExpiryTask.java
index 09ee1ea..5e09cbe 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ExpiryTask.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/ExpiryTask.java
@@ -535,5 +535,10 @@ public abstract class ExpiryTask extends SystemTimer.SystemTimerTask
{
      */
     public void afterExpire(ExpiryTask et);
     
+    /**
+     * Called when task has been canceled
+     */
+    public void afterCancel(ExpiryTask et);
+    
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fac42cbc/geode-core/src/test/java/com/gemstone/gemfire/TXExpiryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/TXExpiryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/TXExpiryJUnitTest.java
index caa4d86..d5e54dc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/TXExpiryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/TXExpiryJUnitTest.java
@@ -271,6 +271,9 @@ public class TXExpiryJUnitTest {
       this.et = et;
     }
     @Override
+    public void afterCancel(ExpiryTask et) {
+    }
+    @Override
     public void afterSchedule(ExpiryTask et) {
     }
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fac42cbc/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
index aaa2abe..e88b6f0 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RegionTestCase.java
@@ -3544,7 +3544,10 @@ public abstract class RegionTestCase extends JUnit4CacheTestCase {
   }
   
   class ExpiryCallbacks implements ExpiryTaskListener {
-
+	  @Override
+    public void afterCancel(ExpiryTask et) {
+      getCache().getLogger().info("ExpiryCallbacks.afterCancel", new RuntimeException("TaskCanceled"));
+    }
     @Override
     public void afterSchedule(ExpiryTask et) {
       printState(et, "ExpiryCallbacks.afterSchedule " );
@@ -3571,7 +3574,6 @@ public abstract class RegionTestCase extends JUnit4CacheTestCase {
       Date ttlTime = new Date(et.getTTLExpirationTime());
       Date getNow = new Date(et.getNow());
       Date scheduleETime = new Date(et.scheduledExecutionTime());
-      //et.getKey();
       getCache().getLogger().info(callback + " now: " + getCurrentTimeStamp(now) + " ttl:"
+ getCurrentTimeStamp(ttl) + " idleExpTime:" + getCurrentTimeStamp(idleExpTime) + 
           " ttlTime:" + getCurrentTimeStamp(ttlTime)  + " getNow:" + getCurrentTimeStamp(getNow)
+ " scheduleETime:" + getCurrentTimeStamp(scheduleETime) +
           " getKey:" + et.getKey() + " isPending:" + et.isPending() +
@@ -3602,11 +3604,12 @@ public abstract class RegionTestCase extends JUnit4CacheTestCase {
   @Test
   public void testEntryIdleDestroy() throws Exception {
 
+	  EntryExpiryTask.expiryTaskListener = new ExpiryCallbacks();
     final String name = this.getUniqueName();
     final int timeout = 20; // ms
     final String key = "KEY";
     final String value = "VALUE";
-    EntryExpiryTask.expiryTaskListener = new ExpiryCallbacks();
+   
     AttributesFactory factory = new AttributesFactory(getRegionAttributes());
     ExpirationAttributes expire =
             new ExpirationAttributes(timeout, ExpirationAction.DESTROY);


Mime
View raw message