ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [19/44] incubator-ignite git commit: GG-10591 Reworked daemon node stop fix.
Date Thu, 30 Jul 2015 07:26:39 GMT
GG-10591 Reworked daemon node stop fix.


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

Branch: refs/heads/ignite-900
Commit: c9ee1dae971f0c5a85efea10b7b2d41170335ea7
Parents: c5dc492
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Thu Jul 23 10:29:21 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Thu Jul 23 10:29:21 2015 +0700

----------------------------------------------------------------------
 .../visor/commands/open/VisorOpenCommand.scala      | 16 +++++-----------
 .../main/scala/org/apache/ignite/visor/visor.scala  |  3 +++
 2 files changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c9ee1dae/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala
index 5ec4cd0..7d2ee3c 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/open/VisorOpenCommand.scala
@@ -240,11 +240,11 @@ class VisorOpenCommand extends VisorConsoleCommand {
         if ("true".equalsIgnoreCase(sys.props.getOrElse(IGNITE_QUIET, "true")))
             cfg.setGridLogger(new NullLogger)
 
-        val startedGridName = try {
+        ignite = try {
             // We need to stop previous daemon node before to start new one.
-            Ignition.stopAll(true)
+            prevIgnite.foreach(g => Ignition.stop(g.name(), true))
 
-            Ignition.start(cfg).name
+            Ignition.start(cfg).asInstanceOf[IgniteEx]
         }
         finally {
             Ignition.setDaemon(daemon)
@@ -252,15 +252,9 @@ class VisorOpenCommand extends VisorConsoleCommand {
             System.setProperty(IGNITE_NO_SHUTDOWN_HOOK, shutdownHook)
         }
 
-        ignite =
-            try
-                Ignition.ignite(startedGridName).asInstanceOf[IgniteEx]
-            catch {
-                case _: IllegalStateException =>
-                    throw new IgniteException("Named grid unavailable: " + startedGridName)
-            }
+        prevIgnite = Some(ignite)
 
-        visor.open(startedGridName, cfgPath)
+        visor.open(ignite.name(), cfgPath)
     }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c9ee1dae/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 67e3d70..7bd6818 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
@@ -228,6 +228,9 @@ object visor extends VisorTag {
     /** */
     @volatile var ignite: IgniteEx = null
 
+    /** */
+    @volatile var prevIgnite: Option[IgniteEx] = None
+
     private var reader: ConsoleReader = null
 
     def reader(reader: ConsoleReader) {


Mime
View raw message