ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [10/14] ignite git commit: IGNITE-3227 IgniteCache: add method to calculate size per partition
Date Mon, 04 Jul 2016 03:46:49 GMT
IGNITE-3227 IgniteCache: add method to calculate size per partition


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

Branch: refs/heads/ignite-3227
Commit: 4b08a7a59ce4bc28e04d06d7da2f96de565729d3
Parents: d3fec9c
Author: samaitra <saikat.maitra@gmail.com>
Authored: Mon Jun 27 22:53:08 2016 +0530
Committer: samaitra <saikat.maitra@gmail.com>
Committed: Mon Jun 27 22:53:08 2016 +0530

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheAdapter.java   | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4b08a7a5/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 04e319c..a44b6a3 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
@@ -4011,13 +4011,15 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
                     size += size();
             } else {
                 if (modes.heap) {
-                    GridDhtLocalPartition gridDthLocalPartition = ctx.topology().localPartition(partition,
topVer, true);
+                    GridDhtLocalPartition gridDthLocalPartition = ctx.topology().localPartition(partition,
topVer, false);
 
-                    if (modes.primary && gridDthLocalPartition.primary(topVer)) {
-                        size += gridDthLocalPartition.publicSize();
-                    }
-                    if (modes.backup && gridDthLocalPartition.backup(topVer)) {
-                        size += gridDthLocalPartition.publicSize();
+                    if (!(gridDthLocalPartition == null)){
+                        if (modes.primary && gridDthLocalPartition.primary(topVer))
{
+                            size += gridDthLocalPartition.publicSize();
+                        }
+                        else if (modes.backup && gridDthLocalPartition.backup(topVer))
{
+                            size += gridDthLocalPartition.publicSize();
+                        }
                     }
                 }
             }


Mime
View raw message