This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch NLPCRAFT-170
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-170 by this push:
     new eba1e65  WIP.
eba1e65 is described below

commit eba1e654f7ad9a342d4cb3c5bd16019c384ccc97
Author: Aaron Radzinski <[email protected]>
AuthorDate: Sat Dec 12 14:02:07 2020 -0800

    WIP.
---
 nlpcraft/src/main/resources/ignite.xml              | 11 ++++++-----
 .../apache/nlpcraft/model/tools/cmdline/NCCli.scala | 21 +++++++++++++--------
 .../nlpcraft/server/ignite/NCIgniteRunner.scala     |  5 +++--
 3 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/nlpcraft/src/main/resources/ignite.xml 
b/nlpcraft/src/main/resources/ignite.xml
index c4e39b1..01665db 100644
--- a/nlpcraft/src/main/resources/ignite.xml
+++ b/nlpcraft/src/main/resources/ignite.xml
@@ -120,13 +120,14 @@
 
     <bean id="grid.cfg" 
class="org.apache.ignite.configuration.IgniteConfiguration">
         <property name="igniteInstanceName" value="nlpcraft"/>
+        <property name="consistentId" 
value="nlpcraft-#{T(org.apache.nlpcraft.common.version.NCVersion).current.version()}"/>
 
         <!--
             Change this path to store Ignite DB files elsewhere.
         -->
-        <property name="workDirectory" 
value="#{systemProperties['user.home']}/.nlpcraft/ignite"/>
+        <property name="workDirectory" 
value="#{systemProperties['user.home']}/.nlpcraft/ignite/v#{T(org.apache.nlpcraft.common.version.NCVersion).current.version()}"/>
 
-        <property name="sqlSchemas">
+        <property name="sqlConfiguration.sqlSchemas">
             <list>
                 <value>nlpcraft</value>
             </list>
@@ -143,9 +144,9 @@
                 <!--
                     Change these paths to store Ignite DB elsewhere.
                 -->
-                <property name="walPath" 
value="#{systemProperties['user.home']}/.nlpcraft/ignite/wal"/>
-                <property name="walArchivePath" 
value="#{systemProperties['user.home']}/.nlpcraft/ignite/wal-archive"/>
-                <property name="storagePath" 
value="#{systemProperties['user.home']}/.nlpcraft/ignite/storage"/>
+                <property name="walPath" 
value="#{systemProperties['user.home']}/.nlpcraft/ignite/v#{T(org.apache.nlpcraft.common.version.NCVersion).current.version()}/wal"/>
+                <property name="walArchivePath" 
value="#{systemProperties['user.home']}/.nlpcraft/ignite/v#{T(org.apache.nlpcraft.common.version.NCVersion).current.version()}/wal-archive"/>
+                <property name="storagePath" 
value="#{systemProperties['user.home']}/.nlpcraft/ignite/v#{T(org.apache.nlpcraft.common.version.NCVersion).current.version()}/storage"/>
             </bean>
         </property>
 
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
index c587604..8db3412 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
@@ -70,7 +70,7 @@ import scala.util.control.Exception.ignoring
  * NLPCraft CLI.
  */
 object NCCli extends App {
-    private final val NAME = "Apache NLPCraft CLI"
+    private final val NAME = "NLPCraft CLI"
 
     //noinspection RegExpRedundantEscape
     private final val TAILER_PTRN = Pattern.compile("^.*NC[a-zA-Z0-9]+ started 
\\[[\\d]+ms\\]$")
@@ -1321,7 +1321,7 @@ object NCCli extends App {
             body = cmdNoLogo,
             examples = Seq(
                 Example(
-                    usage = Seq(s"$PROMPT $SCRIPT_NAME version no-logo"),
+                    usage = Seq(s"$PROMPT $SCRIPT_NAME version -s no-logo"),
                     desc =
                         s"Displays just the version information without any 
additional logo output. " +
                         s"This command makes sense only in command lime mode 
(NOT in REPL mode)."
@@ -4137,15 +4137,20 @@ object NCCli extends App {
         // Process 'no-ansi' and 'ansi' commands first (before ASCII title is 
shown).
         processAnsi(args, repl = false)
 
-        args.find(_ == NO_LOGO_CMD.name) match {
-            case Some(_) ⇒ NO_LOGO_CMD.body(NO_LOGO_CMD, Seq.empty, false)
-            case None ⇒ title() // Show logo unless we have 'no-logo' command.
-        }
+        if (!args.contains(NO_LOGO_CMD.name))
+            title() // Show logo unless we have 'no-logo' command.
 
-        if (args.isEmpty)
+        // Remove all auxiliary commands that are combined with other 
commands, if any.
+        val xargs = args.filter(arg ⇒
+            arg != NO_ANSI_CMD.name &&
+            arg != ANSI_CMD.name &&
+            arg != NO_LOGO_CMD.name
+        )
+
+        if (xargs.isEmpty)
             doRepl()
         else
-            doCommand(args.toSeq, repl = false)
+            doCommand(xargs.toSeq, repl = false)
 
         sys.exit(exitStatus)
     }
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/ignite/NCIgniteRunner.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/ignite/NCIgniteRunner.scala
index cda069e..1bf92d7 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/ignite/NCIgniteRunner.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/ignite/NCIgniteRunner.scala
@@ -21,6 +21,7 @@ import com.typesafe.scalalogging.LazyLogging
 import org.apache.ignite.cluster.ClusterState
 import org.apache.ignite.{IgniteException, Ignition}
 import org.apache.nlpcraft.common._
+import org.apache.nlpcraft.common.version.NCVersion
 
 import java.io.File
 import scala.sys.SystemProperties
@@ -32,8 +33,7 @@ object NCIgniteRunner extends LazyLogging {
     /**
       * Starts Ignite node.
       *
-      * @param cfgPath Full path for configuration file or `null` for default 
on the
-      *               class path `ignite.xml` file.
+      * @param cfgPath Full path for configuration file or `null` for default 
on the class path `ignite.xml` file.
       * @param body Function to execute on running Ignite node.
       */
     @throws[NCE]
@@ -73,6 +73,7 @@ object NCIgniteRunner extends LazyLogging {
                         }
                     }
 
+                // Activate the cluster.
                 ignite.cluster().state(ClusterState.ACTIVE)
 
                 ignite

Reply via email to