ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [14/50] incubator-ignite git commit: ignite-724 Cluster doesn't start with daemon node and cache metrics enabled
Date Mon, 13 Apr 2015 06:40:45 GMT
ignite-724 Cluster doesn't start with daemon node and cache metrics enabled


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

Branch: refs/heads/ignite-709
Commit: 7bb7586b202ee2c6dec8db85e86d6f0c5d94025a
Parents: c3210d8
Author: Andrey Gura <agura@gridgain.com>
Authored: Fri Apr 10 22:30:19 2015 +0300
Committer: Andrey Gura <agura@gridgain.com>
Committed: Fri Apr 10 22:55:25 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/TcpDiscoverySpi.java |  1 -
 .../discovery/tcp/internal/TcpDiscoveryNode.java  | 12 +++++++-----
 .../CacheMetricsForClusterGroupSelfTest.java      | 18 +++++++++++++++++-
 3 files changed, 24 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7bb7586b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 4b43fec..6cf6de8 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -4330,7 +4330,6 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
         {
             assert nodeId != null;
             assert metrics != null;
-            assert cacheMetrics != null;
 
             TcpDiscoveryNode node = ring.node(nodeId);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7bb7586b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
index f5c1edb..bb8f051 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
@@ -128,8 +128,11 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements
Cluste
      * @param metricsProvider Metrics provider.
      * @param ver Version.
      */
-    public TcpDiscoveryNode(UUID id, Collection<String> addrs, Collection<String>
hostNames, int discPort,
-                            DiscoveryMetricsProvider metricsProvider, IgniteProductVersion
ver) {
+    public TcpDiscoveryNode(UUID id,
+        Collection<String> addrs,
+        Collection<String> hostNames, int discPort,
+        DiscoveryMetricsProvider metricsProvider, IgniteProductVersion ver)
+    {
         assert id != null;
         assert !F.isEmpty(addrs);
         assert metricsProvider != null;
@@ -145,6 +148,7 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements
Cluste
         consistentId = U.consistentId(addrs, discPort);
 
         metrics = metricsProvider.metrics();
+        cacheMetrics = metricsProvider.cacheMetrics();
         sockAddrs = U.toSocketAddresses(this, discPort);
     }
 
@@ -248,9 +252,7 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements
Cluste
      * @param cacheMetrics Cache metrics.
      */
     public void setCacheMetrics(Map<Integer, CacheMetrics> cacheMetrics) {
-        assert cacheMetrics != null;
-
-        this.cacheMetrics = cacheMetrics;
+        this.cacheMetrics = cacheMetrics != null ? cacheMetrics : Collections.<Integer,
CacheMetrics>emptyMap();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7bb7586b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
index 19d7aab..1ba24e3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
@@ -56,9 +56,25 @@ public class CacheMetricsForClusterGroupSelfTest extends GridCommonAbstractTest
     /** Cache 2. */
     private IgniteCache<Integer, Integer> cache2;
 
+    /** Daemon grid. */
+    private boolean daemon;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        cfg.setDaemon(daemon);
+
+        return cfg;
+    }
+
     /** {@inheritDoc} */
     @Override protected void beforeTestsStarted() throws Exception {
         startGrids(GRID_CNT);
+
+        daemon = true;
+
+        startGrid(GRID_CNT);
     }
 
     /** {@inheritDoc} */
@@ -150,7 +166,7 @@ public class CacheMetricsForClusterGroupSelfTest extends GridCommonAbstractTest
      * Wait for {@link EventType#EVT_NODE_METRICS_UPDATED} event will be receieved.
      */
     private void awaitMetricsUpdate() throws InterruptedException {
-        final CountDownLatch latch = new CountDownLatch(GRID_CNT * 2);
+        final CountDownLatch latch = new CountDownLatch((GRID_CNT + 1) * 2);
 
         IgnitePredicate<Event> lsnr = new IgnitePredicate<Event>() {
             @Override public boolean apply(Event ignore) {


Mime
View raw message