ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [05/50] [abbrv] incubator-ignite git commit: # ignite-337: ClusterMetrics.totalNodes() covered with test and restore previous usages
Date Thu, 12 Mar 2015 15:16:06 GMT
# ignite-337: ClusterMetrics.totalNodes() covered with test and restore previous usages


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

Branch: refs/heads/ignite-443
Commit: 6c82371fb674b340e44d30434391a8ab67b94d7a
Parents: 30fc792
Author: Artem Shutak <ashutak@gridgain.com>
Authored: Tue Mar 10 13:58:23 2015 +0300
Committer: Artem Shutak <ashutak@gridgain.com>
Committed: Tue Mar 10 13:58:23 2015 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/internal/IgniteKernal.java   | 8 ++++----
 .../org/apache/ignite/internal/ClusterMetricsSelfTest.java   | 2 ++
 .../ignite/visor/commands/top/VisorTopologyCommand.scala     | 7 +++----
 .../src/main/scala/org/apache/ignite/visor/visor.scala       | 8 +++-----
 4 files changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c82371f/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 0385411..ffdb0f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -934,7 +934,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                             Collection<ClusterNode> nodes0 = cluster().nodes();
 
                             hosts = U.neighborhood(nodes0).size();
-                            nodes = nodes0.size();
+                            nodes = metrics.getTotalNodes();
                             cpus = metrics.getTotalCpus();
                         }
                         catch (IgniteException ignore) {
@@ -1970,10 +1970,10 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
     /**
      * Whether or not node restart is enabled. Node restart us supported when this node was
started
      * with {@code bin/ignite.{sh|bat}} script using {@code -r} argument. Node can be
-     * programmatically restarted using {@link org.apache.ignite.Ignition#restart(boolean)}}
method.
+     * programmatically restarted using {@link Ignition#restart(boolean)}} method.
      *
      * @return {@code True} if restart mode is enabled, {@code false} otherwise.
-     * @see org.apache.ignite.Ignition#restart(boolean)
+     * @see Ignition#restart(boolean)
      */
     @Override public boolean isRestartEnabled() {
         return System.getProperty(IGNITE_SUCCESS_FILE) != null;
@@ -2085,7 +2085,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
     /**
      * @param cfg Grid configuration.
-     * @return Components provided in configuration which can implement {@link org.apache.ignite.lifecycle.LifecycleAware}
interface.
+     * @return Components provided in configuration which can implement {@link LifecycleAware}
interface.
      */
     private Iterable<Object> lifecycleAwares(IgniteConfiguration cfg) {
         Collection<Object> objs = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c82371f/modules/core/src/test/java/org/apache/ignite/internal/ClusterMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/ClusterMetricsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/ClusterMetricsSelfTest.java
index 8b226ee..3c52d97 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/ClusterMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/ClusterMetricsSelfTest.java
@@ -136,6 +136,8 @@ public class ClusterMetricsSelfTest extends GridCommonAbstractTest {
      */
     @SuppressWarnings({"FloatingPointEquality"})
     private void checkMetrics(ClusterMetrics m) {
+        assert m.getTotalNodes() == NODES_CNT;
+
         assert m.getMaximumActiveJobs() == 0;
         assert m.getAverageActiveJobs() == 0;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c82371f/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/VisorTopologyCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/VisorTopologyCommand.scala
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/VisorTopologyCommand.scala
index 92a3aa0..b903755 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/VisorTopologyCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/top/VisorTopologyCommand.scala
@@ -23,13 +23,12 @@ import org.apache.ignite.internal.IgniteNodeAttributes._
 import org.apache.ignite.internal.util.typedef.X
 import org.apache.ignite.internal.util.{IgniteUtils => U}
 import org.apache.ignite.lang.IgnitePredicate
-
-import java.net.{InetAddress, UnknownHostException}
-
 import org.apache.ignite.visor.VisorTag
 import org.apache.ignite.visor.commands.{VisorConsoleCommand, VisorTextTable}
 import org.apache.ignite.visor.visor._
 
+import java.net.{InetAddress, UnknownHostException}
+
 import scala.collection.JavaConversions._
 import scala.language.{implicitConversions, reflectiveCalls}
 import scala.util.control.Breaks._
@@ -334,7 +333,7 @@ class VisorTopologyCommand {
         val sumT = VisorTextTable()
 
         sumT += ("Total hosts", U.neighborhood(nodes).size)
-        sumT += ("Total nodes", nodes.size)
+        sumT += ("Total nodes", m.getTotalNodes)
         sumT += ("Total CPUs", m.getTotalCpus)
         sumT += ("Avg. CPU load", safePercent(m.getAverageCpuLoad * 100))
         sumT += ("Avg. free heap", formatDouble(freeHeap) + " %")

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6c82371f/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
index e79f617..840d009 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala
@@ -39,7 +39,8 @@ import org.apache.ignite.internal.visor.util.VisorTaskUtils._
 import org.apache.ignite.lang.{IgniteNotPeerDeployable, IgnitePredicate}
 import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi
 import org.apache.ignite.thread.IgniteThreadPoolExecutor
-
+import org.apache.ignite.visor.commands.VisorConsole.consoleReader
+import org.apache.ignite.visor.commands.{VisorConsoleCommand, VisorTextTable}
 import org.jetbrains.annotations.Nullable
 
 import java.io._
@@ -48,9 +49,6 @@ import java.text._
 import java.util.concurrent._
 import java.util.{HashSet => JHashSet, _}
 
-import org.apache.ignite.visor.commands.VisorConsole.consoleReader
-import org.apache.ignite.visor.commands.{VisorConsoleCommand, VisorTextTable}
-
 import scala.collection.JavaConversions._
 import scala.collection.immutable
 import scala.language.{implicitConversions, reflectiveCalls}
@@ -2535,7 +2533,7 @@ object visor extends VisorTag {
 
         logText("H/N/C" + pipe +
             U.neighborhood(ignite.cluster.nodes()).size.toString.padTo(4, ' ') + pipe +
-            ignite.cluster.nodes().size().toString.padTo(4, ' ') + pipe +
+            m.getTotalNodes.toString.padTo(4, ' ') + pipe +
             m.getTotalCpus.toString.padTo(4, ' ') + pipe +
             bar(m.getAverageCpuLoad, m.getHeapMemoryUsed / m.getHeapMemoryTotal) + pipe
         )


Mime
View raw message