cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r1147334 - in /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra: cli/CliClient.java tools/NodeCmd.java
Date Fri, 15 Jul 2011 22:12:23 GMT
Author: brandonwilliams
Date: Fri Jul 15 22:12:22 2011
New Revision: 1147334

URL: http://svn.apache.org/viewvc?rev=1147334&view=rev
Log:
Fix broken merge

Modified:
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeCmd.java

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java?rev=1147334&r1=1147333&r2=1147334&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java Fri
Jul 15 22:12:22 2011
@@ -408,12 +408,6 @@ public class CliClient
                                       ? convertValueByFunction(columnTree, null, null).array()
                                       : columnNameAsByteArray(CliCompiler.getColumn(columnFamilySpec,
0), cfDef);
 
-            // table.cf['key']['column']
-            assert columnTree != null;
-
-            byte[] columnNameBytes = (columnTree.getType() == CliParser.FUNCTION_CALL)
-                                      ? convertValueByFunction(columnTree, null, null).array()
-                                      : columnNameAsByteArray(CliCompiler.getColumn(columnFamilySpec,
0), cfDef);
 
             if (isSuper)
                 superColumnName = columnNameBytes;

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeCmd.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeCmd.java?rev=1147334&r1=1147333&r2=1147334&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeCmd.java (original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/NodeCmd.java Fri
Jul 15 22:12:22 2011
@@ -603,19 +603,17 @@ public class NodeCmd
 
         switch (command)
         {
-            case RING            : complainNonzeroArgs(arguments, command); nodeCmd.printRing(System.out);
break;
-            case INFO            : complainNonzeroArgs(arguments, command); nodeCmd.printInfo(System.out);
break;
-            case CFSTATS         : complainNonzeroArgs(arguments, command); nodeCmd.printColumnFamilyStats(System.out);
break;
-            case DECOMMISSION    : complainNonzeroArgs(arguments, command); probe.decommission();
break;
-            case LOADBALANCE     : complainNonzeroArgs(arguments, command); probe.loadBalance();
break;
-            case CLEARSNAPSHOT   : complainNonzeroArgs(arguments, command); probe.clearSnapshot();
break;
-            case TPSTATS         : complainNonzeroArgs(arguments, command); nodeCmd.printThreadPoolStats(System.out);
break;
-            case VERSION         : complainNonzeroArgs(arguments, command); nodeCmd.printReleaseVersion(System.out);
break;
-            case COMPACTIONSTATS : complainNonzeroArgs(arguments, command); nodeCmd.printCompactionStats(System.out);
break;
-            case DISABLEGOSSIP   : complainNonzeroArgs(arguments, command); probe.stopGossiping();
break;
-            case ENABLEGOSSIP    : complainNonzeroArgs(arguments, command); probe.startGossiping();
break;
-            case DISABLETHRIFT   : complainNonzeroArgs(arguments, command); probe.stopThriftServer();
break;
-            case ENABLETHRIFT    : complainNonzeroArgs(arguments, command); probe.startThriftServer();
break;
+            case RING            : nodeCmd.printRing(System.out); break;
+            case INFO            : nodeCmd.printInfo(System.out); break;
+            case CFSTATS         : nodeCmd.printColumnFamilyStats(System.out); break;
+            case DECOMMISSION    : probe.decommission(); break;
+            case TPSTATS         : nodeCmd.printThreadPoolStats(System.out); break;
+            case VERSION         : nodeCmd.printReleaseVersion(System.out); break;
+            case COMPACTIONSTATS : nodeCmd.printCompactionStats(System.out); break;
+            case DISABLEGOSSIP   : probe.stopGossiping(); break;
+            case ENABLEGOSSIP    : probe.startGossiping(); break;
+            case DISABLETHRIFT   : probe.stopThriftServer(); break;
+            case ENABLETHRIFT    : probe.startThriftServer(); break;
             case STATUSTHRIFT    : nodeCmd.printIsThriftServerRunning(System.out); break;
 
             case DRAIN :
@@ -722,7 +720,7 @@ public class NodeCmd
         e.printStackTrace();
         System.exit(3);
     }
-
+    
     private static void complainNonzeroArgs(String[] args, NodeCommand cmd)
     {
         if (args.length > 0) {
@@ -732,6 +730,27 @@ public class NodeCmd
         }
     }
 
+    private static void handleSnapshots(NodeCommand nc, String tag, String[] cmdArgs, NodeProbe
probe) throws InterruptedException, IOException
+    {
+        int length = cmdArgs.length > 1 ? cmdArgs.length - 1 : 0;
+        String[] keyspaces = new String[length];
+        for (int i = 0; i < keyspaces.length; i++)
+            keyspaces[i] = cmdArgs[i + 1];
+
+        switch (nc)
+        {
+            case SNAPSHOT :
+                if (tag == null || tag.equals(""))
+                    tag = new Long(System.currentTimeMillis()).toString();
+                probe.takeSnapshot(tag, keyspaces);
+                System.out.println("Snapshot directory: " + tag);
+                break;
+            case CLEARSNAPSHOT :
+                probe.clearSnapshot(tag, keyspaces);
+                break;
+        }
+    }
+
     private static void optionalKSandCFs(NodeCommand nc, String[] cmdArgs, NodeProbe probe)
throws InterruptedException, IOException
     {
         // if there is one additional arg, it's the keyspace; more are columnfamilies



Mime
View raw message