You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/02/16 11:56:42 UTC

[2/7] ignite git commit: ignite-3477 Do not try expire if there are no pending entries.

ignite-3477 Do not try expire if there are no pending entries.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0314dec7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0314dec7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0314dec7

Branch: refs/heads/ignite-4652
Commit: 0314dec71b19c90f06ed13c415dfed269cac3ddb
Parents: 5bde9b1
Author: sboikov <sb...@gridgain.com>
Authored: Mon Feb 13 14:58:01 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Feb 13 14:58:01 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheOffheapManagerImpl.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0314dec7/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index 531665c..5df99b6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@ -98,6 +98,9 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter imple
     protected PendingEntriesTree pendingEntries;
 
     /** */
+    private volatile boolean hasPendingEntries;
+
+    /** */
     private static final PendingRow START_PENDING_ROW = new PendingRow(Long.MIN_VALUE, 0);
 
     /** */
@@ -773,7 +776,7 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter imple
         IgniteInClosure2X<GridCacheEntryEx, GridCacheVersion> c,
         int amount
     ) throws IgniteCheckedException {
-        if (pendingEntries != null) {
+        if (hasPendingEntries && pendingEntries != null) {
             GridCacheVersion obsoleteVer = null;
 
             long now = U.currentTimeMillis();
@@ -979,9 +982,12 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter imple
                         rowStore.removeRow(old.link());
                 }
 
-                if (pendingEntries != null && expireTime != 0)
+                if (pendingEntries != null && expireTime != 0) {
                     pendingEntries.putx(new PendingRow(expireTime, dataRow.link()));
 
+                    hasPendingEntries = true;
+                }
+
                 updateIgfsMetrics(key, (old != null ? old.value() : null), val);
             }
             finally {