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/10/10 11:37:37 UTC

ignite git commit: Removed unused GridDhtLocalPartition.evictHist.

Repository: ignite
Updated Branches:
  refs/heads/master bf99fd3ab -> 74c48496d


Removed unused GridDhtLocalPartition.evictHist.


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

Branch: refs/heads/master
Commit: 74c48496d432367856da380f17ffb788810782c4
Parents: bf99fd3
Author: sboikov <sb...@gridgain.com>
Authored: Tue Oct 10 14:35:00 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Oct 10 14:35:00 2017 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtLocalPartition.java  | 59 --------------------
 .../dht/preloader/GridDhtPartitionDemander.java |  9 ---
 2 files changed, 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/74c48496/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index f0e0d47..c363729 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -17,10 +17,8 @@
 
 package org.apache.ignite.internal.processors.cache.distributed.dht;
 
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -127,10 +125,6 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements
     @GridToStringExclude
     private final long createTime = U.currentTimeMillis();
 
-    /** Eviction history. */
-    @GridToStringExclude
-    private final Map<KeyCacheObject, GridCacheVersion> evictHist = new HashMap<>();
-
     /** Lock. */
     @GridToStringExclude
     private final ReentrantLock lock = new ReentrantLock();
@@ -429,53 +423,6 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements
     }
 
     /**
-     * @param key Key.
-     * @param ver Version.
-     */
-    public void onEntryEvicted(KeyCacheObject key, GridCacheVersion ver) {
-        assert key != null;
-        assert ver != null;
-        assert lock.isHeldByCurrentThread(); // Only one thread can enter this method at a time.
-
-        if (state() != MOVING)
-            return;
-
-        Map<KeyCacheObject, GridCacheVersion> evictHist0 = evictHist;
-
-        if (evictHist0 != null) {
-            GridCacheVersion ver0 = evictHist0.get(key);
-
-            if (ver0 == null || ver0.isLess(ver)) {
-                GridCacheVersion ver1 = evictHist0.put(key, ver);
-
-                assert ver1 == ver0;
-            }
-        }
-    }
-
-    /**
-     * Cache preloader should call this method within partition lock.
-     *
-     * @param key Key.
-     * @param ver Version.
-     * @return {@code True} if preloading is permitted.
-     */
-    public boolean preloadingPermitted(KeyCacheObject key, GridCacheVersion ver) {
-        assert key != null;
-        assert ver != null;
-        assert lock.isHeldByCurrentThread(); // Only one thread can enter this method at a time.
-
-        if (state() != MOVING)
-            return false;
-
-        GridCacheVersion ver0 = evictHist.get(key);
-
-        // Permit preloading if version in history
-        // is missing or less than passed in.
-        return ver0 == null || ver0.isLess(ver);
-    }
-
-    /**
      * Reserves a partition so it won't be cleared.
      *
      * @return {@code True} if reserved.
@@ -593,9 +540,6 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements
                 if (log.isDebugEnabled())
                     log.debug("Owned partition: " + this);
 
-                // No need to keep history any more.
-                evictHist.clear();
-
                 return true;
             }
         }
@@ -637,9 +581,6 @@ public class GridDhtLocalPartition extends GridCacheConcurrentMapImpl implements
                 if (log.isDebugEnabled())
                     log.debug("Marked partition as LOST: " + this);
 
-                // No need to keep history any more.
-                evictHist.clear();
-
                 return true;
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/74c48496/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
index 54661ec..b0ac657 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionDemander.java
@@ -674,15 +674,6 @@ public class GridDhtPartitionDemander {
                         try {
                             // Loop through all received entries and try to preload them.
                             for (GridCacheEntryInfo entry : e.getValue().infos()) {
-                                if (!part.preloadingPermitted(entry.key(), entry.version())) {
-                                    if (log.isDebugEnabled())
-                                        log.debug("Preloading is not permitted for entry due to " +
-                                            "evictions [key=" + entry.key() +
-                                            ", ver=" + entry.version() + ']');
-
-                                    continue;
-                                }
-
                                 if (!preloadEntry(node, p, entry, topVer)) {
                                     if (log.isDebugEnabled())
                                         log.debug("Got entries for invalid partition during " +