cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1062909 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/cli/CliMain.java src/java/org/apache/cassandra/cli/CliOptions.java src/java/org/apache/cassandra/cli/CliSessionState.java
Date Mon, 24 Jan 2011 18:18:13 GMT
Author: jbellis
Date: Mon Jan 24 18:18:13 2011
New Revision: 1062909

URL: http://svn.apache.org/viewvc?rev=1062909&view=rev
Log:
add verbose option to CLI file mode
patch by Pavel YAskevich; reviewed by jbellis for CASSANDRA-2030

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliOptions.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliSessionState.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1062909&r1=1062908&r2=1062909&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Mon Jan 24 18:18:13 2011
@@ -34,6 +34,7 @@
    to allow "warm spare" nodes or performing JMX maintenance before
    joining the ring (CASSANDRA-526)
  * log migrations at INFO (CASSANDRA-2028)
+ * add CLI verbose option in file mode (CASSANDRA-2030)
 
 
 0.7.0-final

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java?rev=1062909&r1=1062908&r2=1062909&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java Mon Jan
24 18:18:13 2011
@@ -308,7 +308,7 @@ public class CliMain
                 sessionState.err.printf("Unable to open %s for writing %n", historyFile);
             }
         }
-        else
+        else if (!sessionState.verbose) // if in batch mode but no verbose flag
         {
             sessionState.out.close();
         }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliOptions.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliOptions.java?rev=1062909&r1=1062908&r2=1062909&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliOptions.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliOptions.java Mon
Jan 24 18:18:13 2011
@@ -43,6 +43,7 @@ public class CliOptions
     private static final String HELP_OPTION = "help";
     private static final String FILE_OPTION = "file";
     private static final String JMX_PORT_OPTION = "jmxport";
+    private static final String VERBOSE_OPTION  = "verbose";
 
     // Default values for optional command line arguments
     private static final int    DEFAULT_THRIFT_PORT = 9160;
@@ -66,6 +67,7 @@ public class CliOptions
         options.addOption(null, UNFRAME_OPTION, "use cassandra server's unframed transport");
         options.addOption(null, DEBUG_OPTION,   "display stack traces");
         options.addOption("?",  HELP_OPTION,    "usage help.");
+        options.addOption("v",  VERBOSE_OPTION, "verbose output when using batch mode.");
     }
 
     private static void printUsage()
@@ -153,6 +155,11 @@ public class CliOptions
                 System.exit(1);
             }
 
+            if (cmd.hasOption(VERBOSE_OPTION))
+            {
+                css.verbose = true;
+            }
+
             // Abort if there are any unrecognized arguments left
             if (cmd.getArgs().length > 0)
             {

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliSessionState.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliSessionState.java?rev=1062909&r1=1062908&r2=1062909&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliSessionState.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliSessionState.java
Mon Jan 24 18:18:13 2011
@@ -39,7 +39,7 @@ public class CliSessionState
     public boolean batch = false; // enable/disable batch processing mode
     public String  filename = ""; // file to read commands from
     public int     jmxPort = 8080;// JMX service port
-
+    public boolean verbose = false; // verbose output
     /*
      * Streams to read/write from
      */



Mime
View raw message