ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [3/5] incubator-ignite git commit: #ignite-758: Remove method GridCache.randomEntry().
Date Wed, 15 Apr 2015 17:00:48 GMT
#ignite-758: Remove method GridCache.randomEntry().


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

Branch: refs/heads/ignite-758
Commit: 0316790f4577f6fcb96b81991f2816904fcec24b
Parents: 64b61ad
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Wed Apr 15 18:16:19 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Wed Apr 15 18:16:19 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCache.java | 16 ----------------
 .../internal/processors/cache/GridCacheAdapter.java |  2 +-
 .../processors/cache/GridCacheProxyImpl.java        | 12 ------------
 .../cache/GridCachePreloadingEvictionsSelfTest.java |  4 +---
 4 files changed, 2 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0316790f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCache.java
index dbcd866..d2cfffb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCache.java
@@ -179,22 +179,6 @@ public interface GridCache<K, V> extends CacheProjection<K,
V> {
     public Iterator<Map.Entry<K, V>> offHeapIterator() throws IgniteCheckedException;
 
     /**
-     * Gets a random entry out of cache. In the worst cache scenario this method
-     * has complexity of <pre>O(S * N/64)</pre> where {@code N} is the size of
internal hash
-     * table and {@code S} is the number of hash table buckets to sample, which is {@code
5}
-     * by default. However, if the table is pretty dense, with density factor of {@code N/64},
-     * which is true for near fully populated caches, this method will generally perform
significantly
-     * faster with complexity of O(S) where {@code S = 5}.
-     * <p>
-     * Note that this method is not available on {@link CacheProjection} API since it is
-     * impossible (or very hard) to deterministically return a number value when pre-filtering
-     * and post-filtering is involved (e.g. projection level predicate filters).
-     *
-     * @return Random entry, or {@code null} if cache is empty.
-     */
-    @Nullable public Cache.Entry<K, V> randomEntry();
-
-    /**
      * Forces this cache node to re-balance its partitions. This method is usually used when
      * {@link CacheConfiguration#getRebalanceDelay()} configuration parameter has non-zero
value.
      * When many nodes are started or stopped almost concurrently, it is more efficient to
delay

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0316790f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 5ba4944..63c42d3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -3603,7 +3603,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public Cache.Entry<K, V> randomEntry() {
+    @Nullable public Cache.Entry<K, V> randomEntry() {
         GridCacheMapEntry e = map.randomEntry();
 
         return e == null || e.obsolete() ? null : e.<K, V>wrapLazyValue();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0316790f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index d521659..895f82d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -254,18 +254,6 @@ public class GridCacheProxyImpl<K, V> implements GridCacheProxy<K,
V>, Externali
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public Cache.Entry<K, V> randomEntry() {
-        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
-
-        try {
-            return cache.randomEntry();
-        }
-        finally {
-            gate.leave(prev);
-        }
-    }
-
-    /** {@inheritDoc} */
     @Override public GridCacheProjectionEx<K, V> forSubjectId(UUID subjId) {
         return delegate.forSubjectId(subjId);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0316790f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
index b79d4d7..a2bcd93 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePreloadingEvictionsSelfTest.java
@@ -206,9 +206,7 @@ public class GridCachePreloadingEvictionsSelfTest extends GridCommonAbstractTest
      * @return Random entry from cache.
      */
     @Nullable private Cache.Entry<Integer, Object> randomEntry(Ignite g) {
-        IgniteKernal g1 = (IgniteKernal)g;
-
-        return g1.<Integer, Object>internalCache().randomEntry();
+        return g.<Integer, Object>cache(null).randomEntry();
     }
 
     /**


Mime
View raw message