ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [02/28] incubator-ignite git commit: # IGNITE-639 WIP.
Date Thu, 09 Apr 2015 06:03:47 GMT
# IGNITE-639 WIP.


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

Branch: refs/heads/ignite-694
Commit: a9ab57127ba41e44a9dec9e04efd266a616b757b
Parents: 58d241c
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Tue Mar 31 10:46:30 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Tue Mar 31 10:46:30 2015 +0700

----------------------------------------------------------------------
 .../commands/cache/VisorCacheCommand.scala      | 35 +++++++++++++-------
 1 file changed, 23 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9ab5712/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
index f044d53..e11c197 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
@@ -19,20 +19,22 @@ package org.apache.ignite.visor.commands.cache
 
 import org.apache.ignite._
 import org.apache.ignite.cluster.ClusterNode
+import org.apache.ignite.internal.processors.cache.{GridCacheUtils => CU}
 import org.apache.ignite.internal.util.typedef._
-import org.apache.ignite.internal.visor.cache._
-import org.apache.ignite.internal.visor.node.{VisorGridConfiguration, VisorNodeConfigurationCollectorTask}
-import org.apache.ignite.internal.visor.util.VisorTaskUtils._
 import org.apache.ignite.lang.IgniteBiTuple
+import org.apache.ignite.visor.VisorTag
+import org.apache.ignite.visor.commands.cache.VisorCacheCommand._
+import org.apache.ignite.visor.commands.{VisorConsoleCommand, VisorTextTable}
+import org.apache.ignite.visor.visor._
+
 import org.jetbrains.annotations._
 
 import java.lang.{Boolean => JavaBoolean}
 import java.util.UUID
 
-import org.apache.ignite.visor.VisorTag
-import org.apache.ignite.visor.commands.cache.VisorCacheCommand._
-import org.apache.ignite.visor.commands.{VisorConsoleCommand, VisorTextTable}
-import org.apache.ignite.visor.visor._
+import org.apache.ignite.internal.visor.cache._
+import org.apache.ignite.internal.visor.node.{VisorGridConfiguration, VisorNodeConfigurationCollectorTask}
+import org.apache.ignite.internal.visor.util.VisorTaskUtils._
 
 import scala.collection.JavaConversions._
 import scala.language.{implicitConversions, reflectiveCalls}
@@ -238,7 +240,7 @@ class VisorCacheCommand {
                     case Right(n) => n
                 }
 
-                val cacheName = argValue("c", argLst) match {
+                var cacheName = argValue("c", argLst) match {
                     case Some(dfltName) if dfltName == DFLT_CACHE_KEY || dfltName == DFLT_CACHE_NAME
=>
                         argLst = argLst.filter(_._1 != "c") ++ Seq("c" -> null)
 
@@ -250,7 +252,10 @@ class VisorCacheCommand {
                 if (Seq("clear", "swap", "scan", "stop").exists(hasArgFlag(_, argLst))) {
                     if (cacheName.isEmpty)
                         askForCache("Select cache from:", node) match {
-                            case Some(name) => argLst = argLst ++ Seq("c" -> name)
+                            case Some(name) =>
+                                argLst = argLst ++ Seq("c" -> name)
+
+                                cacheName = Some(name)
                             case None => break()
                         }
 
@@ -260,8 +265,14 @@ class VisorCacheCommand {
                         VisorCacheSwapCommand().swap(argLst, node)
                     else if (hasArgFlag("scan", argLst))
                         VisorCacheScanCommand().scan(argLst, node)
-                    else if (hasArgFlag("stop", argLst))
-                        VisorCacheStopCommand().scan(argLst, node)
+                    else if (hasArgFlag("stop", argLst)) {
+                        cacheName.foreach(name => {
+                            if (!CU.isSystemCache(name))
+                                VisorCacheStopCommand().scan(argLst, node)
+                            else
+                                warn("Stopping of system cache is not allowed: " + name)
+                        })
+                    }
 
                     break()
                 }
@@ -739,7 +750,7 @@ object VisorCacheCommand {
 
     /** Default cache name to show on screen. */
     private final val DFLT_CACHE_NAME = escapeName(null)
-    
+
     /** Default cache key. */
     protected val DFLT_CACHE_KEY = DFLT_CACHE_NAME + "-" + UUID.randomUUID().toString
 


Mime
View raw message