Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B86010883 for ; Tue, 28 Apr 2015 14:34:19 +0000 (UTC) Received: (qmail 11438 invoked by uid 500); 28 Apr 2015 14:34:19 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 11406 invoked by uid 500); 28 Apr 2015 14:34:19 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 11307 invoked by uid 99); 28 Apr 2015 14:34:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2015 14:34:19 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [54.191.145.13] (HELO mx1-us-west.apache.org) (54.191.145.13) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2015 14:34:14 +0000 Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id BD9AC283F8 for ; Tue, 28 Apr 2015 14:33:53 +0000 (UTC) Received: (qmail 5458 invoked by uid 99); 28 Apr 2015 14:33:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2015 14:33:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AD973E0777; Tue, 28 Apr 2015 14:33:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akuznetsov@apache.org To: commits@ignite.incubator.apache.org Date: Tue, 28 Apr 2015 14:34:11 -0000 Message-Id: <568b36ea79854cb396c0ed529d967378@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [24/42] incubator-ignite git commit: # ignite-gg-9830 WIP X-Virus-Checked: Checked by ClamAV on apache.org # ignite-gg-9830 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/d79afdfa Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d79afdfa Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d79afdfa Branch: refs/heads/ignite-sprint-4 Commit: d79afdfa3e1e5cf1bb500231718cc0895e568f00 Parents: 3a2c39f Author: anovikov Authored: Thu Apr 23 23:54:37 2015 +0700 Committer: anovikov Committed: Thu Apr 23 23:54:37 2015 +0700 ---------------------------------------------------------------------- .../commands/cache/VisorCacheCommand.scala | 4 +- .../commands/common/VisorConsoleCommand.scala | 16 +- .../config/VisorConfigurationCommand.scala | 342 ++++++++++--------- .../scala/org/apache/ignite/visor/visor.scala | 7 + 4 files changed, 197 insertions(+), 172 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d79afdfa/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 8583637..ccfc5ef 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 @@ -436,7 +436,7 @@ class VisorCacheCommand { .foreach(ccfg => { nl() - showCacheConfiguration("Cache configuration:", ccfg) + printCacheConfiguration("Cache configuration:", ccfg) })) }) } @@ -808,7 +808,7 @@ object VisorCacheCommand { * @param title Specified title for table. * @param cfg Config to show information. */ - private[commands] def showCacheConfiguration(title: String, cfg: VisorCacheConfiguration) { + private[commands] def printCacheConfiguration(title: String, cfg: VisorCacheConfiguration) { val affinityCfg = cfg.affinityConfiguration() val nearCfg = cfg.nearConfiguration() val rebalanceCfg = cfg.rebalanceConfiguration() http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d79afdfa/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/common/VisorConsoleCommand.scala ---------------------------------------------------------------------- diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/common/VisorConsoleCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/common/VisorConsoleCommand.scala index e20b901..51e7970 100644 --- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/common/VisorConsoleCommand.scala +++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/common/VisorConsoleCommand.scala @@ -63,4 +63,18 @@ trait VisorConsoleCommand { warn(warnMsgs: _*) warn(s"Type 'help $name' to see how to use this command.") } -} \ No newline at end of file + + /** + * Joins array of strings to a single string with line feed. + * + * @param lines Lines to join together. + * @param dflt Value to return in case of array is `null` or empty. + *@return Joined line. + */ + protected def join(lines: Iterable[Any], dflt: String = ""): String = { + if (lines == null || lines.isEmpty) + null + else + lines.mkString("[", ", ", "]") + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d79afdfa/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala ---------------------------------------------------------------------- diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala index e6e3782..1f36ff8 100644 --- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala +++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala @@ -17,18 +17,19 @@ package org.apache.ignite.visor.commands.config -import org.apache.ignite._ +import org.apache.ignite.cluster.ClusterGroupEmptyException import org.apache.ignite.internal.util.scala.impl import org.apache.ignite.internal.util.{IgniteUtils => U} 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.cache.VisorCacheCommand._ import org.apache.ignite.visor.commands.common.{VisorConsoleCommand, VisorTextTable} import org.apache.ignite.visor.visor._ import java.lang.System._ +import java.util.UUID -import org.apache.ignite.internal.visor.node.VisorNodeConfigurationCollectorTask +import org.apache.ignite.internal.visor.node.{VisorGridConfiguration, VisorNodeConfigurationCollectorTask} import org.apache.ignite.internal.visor.util.VisorTaskUtils._ import scala.collection.JavaConversions._ @@ -102,247 +103,250 @@ class VisorConfigurationCommand extends VisorConsoleCommand { * @param args Command arguments. */ def config(args: String) { - breakable { - if (!isConnected) { - adviseToConnect() + if (!isConnected) { + adviseToConnect() - break() - } + return + } - val argLst = parseArgs(args) + val argLst = parseArgs(args) - val nid = parseNode(argLst) match { - case Left(msg) => - scold(msg) + val nid = parseNode(argLst) match { + case Left(msg) => + scold(msg) - break() + return - case Right(None) => - scold("One of -id8 or -id is required.") + case Right(None) => + scold("One of -id8 or -id is required.") - break() + return - case Right(Some(n)) => - assert(n != null) + case Right(Some(n)) => + assert(n != null) - n.id() - } + n.id() + } - val cfg = try - executeOne(nid, classOf[VisorNodeConfigurationCollectorTask], null) - catch { - case e: IgniteException => - scold(e) + try { + val cfg = collectConfiguration(nid) - break() - } + printConfiguration(cfg) + + cacheConfigurations(nid).foreach(ccfg => { + println() + + printCacheConfiguration(s"Cache '${escapeName(ccfg.name())}':", ccfg) + }) + } + catch { + case e: Throwable => scold(e) + } + } - println("Common Parameters:") + @throws[ClusterGroupEmptyException]("In case of empty topology.") + protected def collectConfiguration(nid: UUID) = { + executeOne(nid, classOf[VisorNodeConfigurationCollectorTask], null) + } - val cmnT = VisorTextTable() + protected def printConfiguration(cfg: VisorGridConfiguration) { + println("Common Parameters:") - val basic = cfg.basic() + val cmnT = VisorTextTable() - cmnT += ("Grid name", escapeName(basic.gridName())) - cmnT += ("Ignite home", safe(basic.ggHome())) - cmnT += ("Localhost", safe(basic.localHost())) - cmnT += ("Node ID", safe(basic.nodeId())) - cmnT += ("Marshaller", basic.marshaller()) - cmnT += ("Deployment mode", safe(basic.deploymentMode())) - cmnT += ("Daemon", bool2Str(basic.daemon())) - cmnT += ("Remote JMX", bool2Str(basic.jmxRemote())) - cmnT += ("Restart", bool2Str(basic.restart())) - cmnT += ("Network timeout", basic.networkTimeout() + "ms") - cmnT += ("Grid logger", safe(basic.logger())) - cmnT += ("Discovery startup delay", basic.discoStartupDelay() + "ms") - cmnT += ("MBean server", safe(basic.mBeanServer())) - cmnT += ("ASCII logo disabled", bool2Str(basic.noAscii())) - cmnT += ("Discovery order not required", bool2Str(basic.noDiscoOrder())) - cmnT += ("Shutdown hook disabled", bool2Str(basic.noShutdownHook())) - cmnT += ("Program name", safe(basic. programName())) - cmnT += ("Quiet mode", bool2Str(basic.quiet())) - cmnT += ("Success filename", safe(basic.successFile())) - cmnT += ("Update notification", bool2Str(basic.updateNotifier())) - cmnT += ("Include properties", safe(cfg.includeProperties())) + val basic = cfg.basic() - val atomic = cfg.atomic() + cmnT += ("Grid name", escapeName(basic.gridName())) + cmnT += ("Ignite home", safe(basic.ggHome())) + cmnT += ("Localhost", safe(basic.localHost())) + cmnT += ("Node ID", safe(basic.nodeId())) + cmnT += ("Marshaller", basic.marshaller()) + cmnT += ("Deployment mode", safe(basic.deploymentMode())) + cmnT += ("Daemon", bool2Str(basic.daemon())) + cmnT += ("Remote JMX", bool2Str(basic.jmxRemote())) + cmnT += ("Restart", bool2Str(basic.restart())) + cmnT += ("Network timeout", basic.networkTimeout() + "ms") + cmnT += ("Grid logger", safe(basic.logger())) + cmnT += ("Discovery startup delay", basic.discoStartupDelay() + "ms") + cmnT += ("MBean server", safe(basic.mBeanServer())) + cmnT += ("ASCII logo disabled", bool2Str(basic.noAscii())) + cmnT += ("Discovery order not required", bool2Str(basic.noDiscoOrder())) + cmnT += ("Shutdown hook disabled", bool2Str(basic.noShutdownHook())) + cmnT += ("Program name", safe(basic. programName())) + cmnT += ("Quiet mode", bool2Str(basic.quiet())) + cmnT += ("Success filename", safe(basic.successFile())) + cmnT += ("Update notification", bool2Str(basic.updateNotifier())) + cmnT += ("Include properties", safe(cfg.includeProperties())) - cmnT += ("Atomic Cache Mode", atomic.cacheMode()) - cmnT += ("Atomic Sequence Reservation Size", atomic.atomicSequenceReserveSize()) - cmnT += ("Atomic Number Of Backup Nodes", atomic.backups()) + val atomic = cfg.atomic() - val trn = cfg.transaction() + cmnT += ("Atomic Cache Mode", atomic.cacheMode()) + cmnT += ("Atomic Sequence Reservation Size", atomic.atomicSequenceReserveSize()) + cmnT += ("Atomic Number Of Backup Nodes", atomic.backups()) - cmnT += ("Transaction Concurrency", trn.defaultTxConcurrency()) - cmnT += ("Transaction Isolation", trn.defaultTxIsolation()) - cmnT += ("Transaction Timeout", trn.defaultTxTimeout() + "ms") - cmnT += ("Transaction Log Cleanup Delay", trn.pessimisticTxLogLinger() + "ms") - cmnT += ("Transaction Log Size", trn.getPessimisticTxLogSize) - cmnT += ("Transaction Serializable Enabled", bool2Str(trn.txSerializableEnabled())) + val trn = cfg.transaction() - cmnT.render() + cmnT += ("Transaction Concurrency", trn.defaultTxConcurrency()) + cmnT += ("Transaction Isolation", trn.defaultTxIsolation()) + cmnT += ("Transaction Timeout", trn.defaultTxTimeout() + "ms") + cmnT += ("Transaction Log Cleanup Delay", trn.pessimisticTxLogLinger() + "ms") + cmnT += ("Transaction Log Size", trn.getPessimisticTxLogSize) + cmnT += ("Transaction Serializable Enabled", bool2Str(trn.txSerializableEnabled())) - println("\nMetrics:") + cmnT.render() - val metricsT = VisorTextTable() + println("\nMetrics:") - val expTime = cfg.metrics().expireTime() + val metricsT = VisorTextTable() - metricsT += ("Metrics expire time", if (expTime != Long.MaxValue) expTime + "ms" else "") - metricsT += ("Metrics history size", cfg.metrics().historySize()) - metricsT += ("Metrics log frequency", cfg.metrics().loggerFrequency()) + val expTime = cfg.metrics().expireTime() - metricsT.render() + metricsT += ("Metrics expire time", if (expTime != Long.MaxValue) expTime + "ms" else "") + metricsT += ("Metrics history size", cfg.metrics().historySize()) + metricsT += ("Metrics log frequency", cfg.metrics().loggerFrequency()) - println("\nSPIs:") + metricsT.render() - val spisT = VisorTextTable() + println("\nSPIs:") - def spiClass(spi: IgniteBiTuple[String, java.util.Map[String, AnyRef]]) = { - if (spi != null) spi.get2().getOrElse("Class Name", NA) else NA - } + val spisT = VisorTextTable() - def spisClass(spis: Array[IgniteBiTuple[String, java.util.Map[String, AnyRef]]]) = { - spis.map(spiClass).mkString("[", ", ", "]") - } + def spiClass(spi: IgniteBiTuple[String, java.util.Map[String, AnyRef]]) = { + if (spi != null) spi.get2().getOrElse("Class Name", NA) else NA + } - spisT += ("Discovery", spiClass(cfg.spis().discoverySpi())) - spisT += ("Communication", spiClass(cfg.spis().communicationSpi())) - spisT += ("Event storage", spiClass(cfg.spis().eventStorageSpi())) - spisT += ("Collision", spiClass(cfg.spis().collisionSpi())) - spisT += ("Deployment", spiClass(cfg.spis().deploymentSpi())) - spisT += ("Checkpoints", spisClass(cfg.spis().checkpointSpis())) - spisT += ("Failovers", spisClass(cfg.spis().failoverSpis())) - spisT += ("Load balancings", spisClass(cfg.spis().loadBalancingSpis())) - spisT += ("Swap spaces", spiClass(cfg.spis().swapSpaceSpi())) - spisT += ("Indexing", spisClass(cfg.spis().indexingSpis())) + def spisClass(spis: Array[IgniteBiTuple[String, java.util.Map[String, AnyRef]]]) = { + spis.map(spiClass).mkString("[", ", ", "]") + } - spisT.render() + spisT += ("Discovery", spiClass(cfg.spis().discoverySpi())) + spisT += ("Communication", spiClass(cfg.spis().communicationSpi())) + spisT += ("Event storage", spiClass(cfg.spis().eventStorageSpi())) + spisT += ("Collision", spiClass(cfg.spis().collisionSpi())) + spisT += ("Deployment", spiClass(cfg.spis().deploymentSpi())) + spisT += ("Checkpoints", spisClass(cfg.spis().checkpointSpis())) + spisT += ("Failovers", spisClass(cfg.spis().failoverSpis())) + spisT += ("Load balancings", spisClass(cfg.spis().loadBalancingSpis())) + spisT += ("Swap spaces", spiClass(cfg.spis().swapSpaceSpi())) + spisT += ("Indexing", spisClass(cfg.spis().indexingSpis())) - println("\nPeer-to-Peer:") + spisT.render() - val p2pT = VisorTextTable() + println("\nPeer-to-Peer:") - p2pT += ("Peer class loading enabled", bool2Str(cfg.p2p().p2pEnabled())) - p2pT += ("Missed resources cache size", cfg.p2p().p2pMissedResponseCacheSize()) - p2pT += ("Peer-to-Peer loaded packages", safe(cfg.p2p().p2pLocalClassPathExclude())) + val p2pT = VisorTextTable() - p2pT.render() + p2pT += ("Peer class loading enabled", bool2Str(cfg.p2p().p2pEnabled())) + p2pT += ("Missed resources cache size", cfg.p2p().p2pMissedResponseCacheSize()) + p2pT += ("Peer-to-Peer loaded packages", safe(cfg.p2p().p2pLocalClassPathExclude())) - println("\nLifecycle:") + p2pT.render() - val lifecycleT = VisorTextTable() + println("\nLifecycle:") - lifecycleT += ("Beans", safe(cfg.lifecycle().beans())) + val lifecycleT = VisorTextTable() - lifecycleT.render() + lifecycleT += ("Beans", safe(cfg.lifecycle().beans())) - println("\nExecutor services:") + lifecycleT.render() - val execSvcT = VisorTextTable() + println("\nExecutor services:") - val execCfg = cfg.executeService() + val execSvcT = VisorTextTable() - execSvcT += ("Public thread pool size", safe(execCfg.publicThreadPoolSize())) - execSvcT += ("System thread pool size", safe(execCfg.systemThreadPoolSize())) - execSvcT += ("Management thread pool size", safe(execCfg.managementThreadPoolSize())) - execSvcT += ("IGFS thread pool size", safe(execCfg.igfsThreadPoolSize())) - execSvcT += ("Peer-to-Peer thread pool size", safe(execCfg.peerClassLoadingThreadPoolSize())) - execSvcT += ("REST thread pool size", safe(execCfg.restThreadPoolSize())) + val execCfg = cfg.executeService() - execSvcT.render() + execSvcT += ("Public thread pool size", safe(execCfg.publicThreadPoolSize())) + execSvcT += ("System thread pool size", safe(execCfg.systemThreadPoolSize())) + execSvcT += ("Management thread pool size", safe(execCfg.managementThreadPoolSize())) + execSvcT += ("IGFS thread pool size", safe(execCfg.igfsThreadPoolSize())) + execSvcT += ("Peer-to-Peer thread pool size", safe(execCfg.peerClassLoadingThreadPoolSize())) + execSvcT += ("REST thread pool size", safe(execCfg.restThreadPoolSize())) - println("\nSegmentation:") + execSvcT.render() - val segT = VisorTextTable() + println("\nSegmentation:") - segT += ("Segmentation policy", safe(cfg.segmentation().policy())) - segT += ("Segmentation resolvers", safe(cfg.segmentation().resolvers())) - segT += ("Segmentation check frequency", cfg.segmentation().checkFrequency()) - segT += ("Wait for segmentation on start", bool2Str(cfg.segmentation().waitOnStart())) - segT += ("All resolvers pass required", bool2Str(cfg.segmentation().passRequired())) + val segT = VisorTextTable() - segT.render() + segT += ("Segmentation policy", safe(cfg.segmentation().policy())) + segT += ("Segmentation resolvers", safe(cfg.segmentation().resolvers())) + segT += ("Segmentation check frequency", cfg.segmentation().checkFrequency()) + segT += ("Wait for segmentation on start", bool2Str(cfg.segmentation().waitOnStart())) + segT += ("All resolvers pass required", bool2Str(cfg.segmentation().passRequired())) - println("\nEvents:") + segT.render() - val evtsT = VisorTextTable() + println("\nEvents:") - val inclEvtTypes = Option(cfg.includeEventTypes()).fold(NA)(et => arr2Str(et.map(U.gridEventName))) + val evtsT = VisorTextTable() - evtsT += ("Included event types", inclEvtTypes) + val inclEvtTypes = Option(cfg.includeEventTypes()).fold(NA)(et => arr2Str(et.map(U.gridEventName))) - evtsT.render() + evtsT += ("Included event types", inclEvtTypes) - println("\nREST:") + evtsT.render() - val restT = VisorTextTable() + println("\nREST:") - restT += ("REST enabled", bool2Str(cfg.rest().restEnabled())) - restT += ("Rest accessible folders", safe(cfg.rest().accessibleFolders())) - restT += ("Jetty path", safe(cfg.rest().jettyPath())) - restT += ("Jetty host", safe(cfg.rest().jettyHost())) - restT += ("Jetty port", safe(cfg.rest().jettyPort())) - restT += ("Tcp ssl enabled", bool2Str(cfg.rest().tcpSslEnabled())) - restT += ("Tcp ssl context factory", safe(cfg.rest().tcpSslContextFactory())) - restT += ("Tcp host", safe(cfg.rest().tcpHost())) - restT += ("Tcp port", safe(cfg.rest().tcpPort())) + val restT = VisorTextTable() - restT.render() + restT += ("REST enabled", bool2Str(cfg.rest().restEnabled())) + restT += ("Rest accessible folders", safe(cfg.rest().accessibleFolders())) + restT += ("Jetty path", safe(cfg.rest().jettyPath())) + restT += ("Jetty host", safe(cfg.rest().jettyHost())) + restT += ("Jetty port", safe(cfg.rest().jettyPort())) + restT += ("Tcp ssl enabled", bool2Str(cfg.rest().tcpSslEnabled())) + restT += ("Tcp ssl context factory", safe(cfg.rest().tcpSslContextFactory())) + restT += ("Tcp host", safe(cfg.rest().tcpHost())) + restT += ("Tcp port", safe(cfg.rest().tcpPort())) - if (cfg.userAttributes().nonEmpty) { - println("\nUser attributes:") + restT.render() - val uaT = VisorTextTable() + if (cfg.userAttributes().nonEmpty) { + println("\nUser attributes:") - uaT #= ("Name", "Value") + val uaT = VisorTextTable() - cfg.userAttributes().foreach(a => uaT += (a._1, a._2)) + uaT #= ("Name", "Value") - uaT.render() - } else - println("\nNo user attributes defined.") + cfg.userAttributes().foreach(a => uaT += (a._1, a._2)) - if (cfg.env().nonEmpty) { - println("\nEnvironment variables:") + uaT.render() + } else + println("\nNo user attributes defined.") - val envT = VisorTextTable() + if (cfg.env().nonEmpty) { + println("\nEnvironment variables:") - envT.maxCellWidth = 80 + val envT = VisorTextTable() - envT #= ("Name", "Value") + envT.maxCellWidth = 80 - cfg.env().foreach(v => envT += (v._1, compactProperty(v._1, v._2))) + envT #= ("Name", "Value") - envT.render() - } else - println("\nNo environment variables defined.") + cfg.env().foreach(v => envT += (v._1, compactProperty(v._1, v._2))) - val sysProps = cfg.systemProperties().toMap + envT.render() + } else + println("\nNo environment variables defined.") - if (sysProps.nonEmpty) { - println("\nSystem properties:") + val sysProps = cfg.systemProperties().toMap - val spT = VisorTextTable() + if (sysProps.nonEmpty) { + println("\nSystem properties:") - spT.maxCellWidth = 80 + val spT = VisorTextTable() - spT #= ("Name", "Value") + spT.maxCellWidth = 80 - sysProps.foreach(p => spT += (p._1, compactProperty(p._1, p._2))) + spT #= ("Name", "Value") - spT.render() - } else - println("\nNo system properties defined.") + sysProps.foreach(p => spT += (p._1, compactProperty(p._1, p._2))) - try - cacheConfigurations(nid).foreach(cacheCfg => - VisorCacheCommand.showCacheConfiguration("\nCache '" + escapeName(cacheCfg.name()) + "':", cacheCfg)) - catch { - case e: IgniteException => - scold(e) - } - } + spT.render() + } else + println("\nNo system properties defined.") } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d79afdfa/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 aaf74a4..0336ae8 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 @@ -1881,6 +1881,7 @@ object visor extends VisorTag { def toTaskArgument[A](nids: Iterable[UUID], arg: A): VisorTaskArgument[A] = new VisorTaskArgument(new JavaHashSet(nids), arg, false) + @throws[ClusterGroupEmptyException]("In case of empty topology.") private def execute[A, R, J](grp: ClusterGroup, task: Class[_ <: VisorMultiNodeTask[A, R, J]], arg: A): R = { if (grp.nodes().isEmpty) throw new ClusterGroupEmptyException("Topology is empty.") @@ -1899,6 +1900,7 @@ object visor extends VisorTag { * @tparam J Job class. * @return Task result. */ + @throws[ClusterGroupEmptyException]("In case of empty topology.") def executeOne[A, R, J](nid: UUID, task: Class[_ <: VisorMultiNodeTask[A, R, J]], arg: A): R = execute(ignite.cluster.forNodeId(nid), task, arg) @@ -1913,6 +1915,7 @@ object visor extends VisorTag { * @tparam J Job class. * @return Task result. */ + @throws[ClusterGroupEmptyException]("In case of empty topology.") def executeRandom[A, R, J](grp: ClusterGroup, task: Class[_ <: VisorMultiNodeTask[A, R, J]], arg: A): R = execute(grp.forRandom(), task, arg) @@ -1926,6 +1929,7 @@ object visor extends VisorTag { * @tparam J Job class. * @return Task result. */ + @throws[ClusterGroupEmptyException]("In case of empty topology.") def executeRandom[A, R, J](task: Class[_ <: VisorMultiNodeTask[A, R, J]], arg: A): R = execute(ignite.cluster.forRandom(), task, arg) @@ -1940,6 +1944,7 @@ object visor extends VisorTag { * @tparam J Job class. * @return Task result. */ + @throws[ClusterGroupEmptyException]("In case of empty topology.") def executeMulti[A, R, J](nids: Iterable[UUID], task: Class[_ <: VisorMultiNodeTask[A, R, J]], arg: A): R = execute(ignite.cluster.forNodeIds(nids), task, arg) @@ -1953,6 +1958,7 @@ object visor extends VisorTag { * @tparam J Job class. * @return Task result. */ + @throws[ClusterGroupEmptyException]("In case of empty topology.") def executeMulti[A, R, J](task: Class[_ <: VisorMultiNodeTask[A, R, J]], arg: A): R = execute(ignite.cluster.forRemotes(), task, arg) @@ -1962,6 +1968,7 @@ object visor extends VisorTag { * @param nid Node ID to collect configuration from. * @return Collection of cache configurations. */ + @throws[ClusterGroupEmptyException]("In case of empty topology.") def cacheConfigurations(nid: UUID): JavaCollection[VisorCacheConfiguration] = executeOne(nid, classOf[VisorCacheConfigurationCollectorTask], null.asInstanceOf[JavaCollection[IgniteUuid]]).values()