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 5A1F517A96 for ; Wed, 29 Apr 2015 16:04:11 +0000 (UTC) Received: (qmail 70860 invoked by uid 500); 29 Apr 2015 16:04:11 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 70796 invoked by uid 500); 29 Apr 2015 16:04:11 -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 70654 invoked by uid 99); 29 Apr 2015 16:04:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2015 16:04:11 +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; Wed, 29 Apr 2015 16:04:05 +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 46EBE283F2 for ; Wed, 29 Apr 2015 16:03:45 +0000 (UTC) Received: (qmail 68318 invoked by uid 99); 29 Apr 2015 16:03:45 -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; Wed, 29 Apr 2015 16:03:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 009A6E03C7; Wed, 29 Apr 2015 16:03:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: anovikov@apache.org To: commits@ignite.incubator.apache.org Date: Wed, 29 Apr 2015 16:03:44 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [01/50] incubator-ignite git commit: Merge with sprint-4. X-Virus-Checked: Checked by ClamAV on apache.org Repository: incubator-ignite Updated Branches: refs/heads/ignite-791 58c55d4b6 -> 51bf584e8 Merge with sprint-4. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6932fc67 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6932fc67 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6932fc67 Branch: refs/heads/ignite-791 Commit: 6932fc67bf8c8c46cf243a102951618a38331ada Parents: 0ae249e 0f3d372 Author: AKuznetsov Authored: Tue Apr 28 18:17:23 2015 +0700 Committer: AKuznetsov Committed: Tue Apr 28 18:17:23 2015 +0700 ---------------------------------------------------------------------- .../ignite/internal/util/GridJavaProcess.java | 4 + .../ignite/internal/visor/cache/VisorCache.java | 92 +++++++++++--------- .../visor/node/VisorBasicConfiguration.java | 11 +++ .../visor/node/VisorNodeDataCollectorJob.java | 2 +- .../internal/GridDiscoveryEventSelfTest.java | 30 ++++--- .../spi/discovery/tcp/TcpDiscoverySelfTest.java | 5 +- .../config/VisorConfigurationCommand.scala | 1 + .../scala/org/apache/ignite/visor/visor.scala | 11 +++ pom.xml | 5 +- 9 files changed, 105 insertions(+), 56 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6932fc67/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala ---------------------------------------------------------------------- diff --cc modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/config/VisorConfigurationCommand.scala index 3e48302,0716836..3f0f52f --- 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 @@@ -102,250 -121,283 +102,251 @@@ class VisorConfigurationCommand extend * @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 id8 = argValue("id8", argLst) - val id = argValue("id", argLst) + val nid = parseNode(argLst) match { + case Left(msg) => + scold(msg) - var node: ClusterNode = null + return - if (id8.isEmpty && id.isEmpty) { + case Right(None) => scold("One of -id8 or -id is required.") - break() - } - - if (id8.isDefined && id.isDefined) { - scold("Only one of -id8 or -id is allowed.") - - break() - } - - if (id8.isDefined) { - val ns = nodeById8(id8.get) - - if (ns.isEmpty) { - scold("Unknown 'id8' value: " + id8.get) - - break() - } - else if (ns.size != 1) { - scold("'id8' resolves to more than one node (use full 'id' instead): " + id8.get) + return - break() - } - else - node = ns.head - } - else if (id.isDefined) - try { - node = ignite.cluster.node(java.util.UUID.fromString(id.get)) - - if (node == null) { - scold("'id' does not match any node: " + id.get) + case Right(Some(n)) => + assert(n != null) - break() - } - } - catch { - case e: IllegalArgumentException => - scold("Invalid node 'id': " + id.get) + n.id() + } - break() - } + try { + val cfg = collectConfiguration(nid) - assert(node != null) + printConfiguration(cfg) - val cfg = try - nodeConfiguration(node.id()) - catch { - case e: IgniteException => - scold(e.getMessage) + cacheConfigurations(nid).foreach(ccfg => { + println() - break() - } + 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 += ("ClientMode", javaBoolToStr(basic.clientMode())) - 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 += ("ClientMode", javaBoolToStr(basic.clientMode())) + 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(node.id).foreach(cacheCfg => - VisorCacheCommand.showCacheConfiguration("\nCache '" + escapeName(cacheCfg.name()) + "':", cacheCfg)) - catch { - case e: IgniteException => - scold(e.getMessage) - } - } + spT.render() + } else + println("\nNo system properties defined.") } /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6932fc67/modules/visor-console/src/main/scala/org/apache/ignite/visor/visor.scala ----------------------------------------------------------------------