ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [18/35] incubator-ignite git commit: ignite-968 avoid wait for affinity future on metrics creation
Date Wed, 03 Jun 2015 17:14:49 GMT
ignite-968 avoid wait for affinity future on metrics creation


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

Branch: refs/heads/ignite-218
Commit: 3c1f0caae8266cf65079f345f95063bea5d5e2a8
Parents: 4e563ed
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Jun 2 10:30:29 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Jun 2 10:30:29 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/managers/discovery/GridDiscoveryManager.java | 4 +++-
 .../ignite/internal/processors/cache/CacheMetricsImpl.java       | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c1f0caa/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 4ef602e..1db0b07 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -695,7 +695,9 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
                 Map<Integer, CacheMetrics> metrics = null;
 
                 for (GridCacheAdapter<?, ?> cache : caches) {
-                    if (cache.context().started() && cache.configuration().isStatisticsEnabled())
{
+                    if (cache.configuration().isStatisticsEnabled() &&
+                        cache.context().started() &&
+                        cache.context().affinity().affinityTopologyVersion().topologyVersion()
> 0) {
                         if (metrics == null)
                             metrics = U.newHashMap(caches.size());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3c1f0caa/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
index 4e6a447..74ba100 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
@@ -225,7 +225,7 @@ public class CacheMetricsImpl implements CacheMetrics {
     /** {@inheritDoc} */
     @Override public long getOffHeapPrimaryEntriesCount() {
         try {
-            return cctx.swap().offheapEntriesCount(true, false, NONE);
+            return cctx.swap().offheapEntriesCount(true, false, cctx.affinity().affinityTopologyVersion());
         }
         catch (IgniteCheckedException e) {
             return 0;
@@ -235,7 +235,7 @@ public class CacheMetricsImpl implements CacheMetrics {
     /** {@inheritDoc} */
     @Override public long getOffHeapBackupEntriesCount() {
         try {
-            return cctx.swap().offheapEntriesCount(false, true, NONE);
+            return cctx.swap().offheapEntriesCount(false, true, cctx.affinity().affinityTopologyVersion());
         }
         catch (IgniteCheckedException e) {
             return 0;


Mime
View raw message