You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by yz...@apache.org on 2015/05/08 15:32:55 UTC

[30/50] [abbrv] incubator-ignite git commit: # sprint-4 Fixed isEmpty() logic.

# sprint-4 Fixed isEmpty() logic.


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

Branch: refs/heads/ignite-478
Commit: c3f3dd141ba9a3cb1e7044f807e624c57ef38084
Parents: a33d3d4
Author: AKuznetsov <ak...@gridgain.com>
Authored: Thu May 7 13:14:40 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Thu May 7 13:14:40 2015 +0700

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheAdapter.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3f3dd14/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 6674993..afddc79 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
@@ -489,7 +489,12 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
     /** {@inheritDoc} */
     @Override public boolean isEmpty() {
-        return values().isEmpty();
+        try {
+            return localSize(CachePeekModes.ONHEAP_ONLY) == 0;
+        }
+        catch (IgniteCheckedException e) {
+            throw new IgniteException(e);
+        }
     }
 
     /** {@inheritDoc} */