cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1062801 - in /cassandra/trunk: ./ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/service/
Date Mon, 24 Jan 2011 14:36:44 GMT
Author: jbellis
Date: Mon Jan 24 14:36:43 2011
New Revision: 1062801

URL: http://svn.apache.org/viewvc?rev=1062801&view=rev
Log:
merge from 0.7

Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java 
 (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props
changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g
    cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
    cassandra/trunk/src/java/org/apache/cassandra/cli/CliMain.java
    cassandra/trunk/src/java/org/apache/cassandra/cli/CliUserHelp.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 24 14:36:43 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7:1026516-1062109
+/cassandra/branches/cassandra-0.7:1026516-1062800
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3:774578-796573

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1062801&r1=1062800&r2=1062801&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Mon Jan 24 14:36:43 2011
@@ -36,6 +36,8 @@
  * fix streaming of multiple CFs during bootstrap (CASSANDRA-1992)
  * explicitly set JVM GC new generation size with -Xmn (CASSANDRA-1968)
  * add short options for CLI flags (CASSANDRA-1565)
+ * make keyspace argument to "describe keyspace" in CLI optional
+   when authenticated to keyspace already (CASSANDRA-2029)
 
 
 0.7.0-final

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 24 14:36:43 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1062109
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1062800
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 24 14:36:43 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1062109
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1062800
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 24 14:36:43 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1062109
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1062800
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 24 14:36:43 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1062109
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1062800
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 24 14:36:43 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1055311,1056121,1057932
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1062109
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1062800
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198

Modified: cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g?rev=1062801&r1=1062800&r2=1062801&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g Mon Jan 24 14:36:43 2011
@@ -321,8 +321,8 @@ showKeyspaces
     ;
 
 describeTable
-    : DESCRIBE KEYSPACE keyspace 
-        -> ^(NODE_DESCRIBE_TABLE keyspace)
+    : DESCRIBE KEYSPACE (keyspace)?
+        -> ^(NODE_DESCRIBE_TABLE (keyspace)?)
     ;
     
 useKeyspace

Modified: cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java?rev=1062801&r1=1062800&r2=1062801&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java Mon Jan 24 14:36:43 2011
@@ -1364,17 +1364,30 @@ public class CliClient extends CliUserHe
         }
     }
 
-    // DESCRIBE KEYSPACE <keyspace_name> 
+    // DESCRIBE KEYSPACE (<keyspace_name>)?
     private void executeDescribeKeySpace(Tree statement) throws TException, InvalidRequestException
     {
         if (!CliMain.isConnected())
             return;
 
-        // Get keySpace name
-        String keySpaceName = CliCompiler.getKeySpace(statement, thriftClient.describe_keyspaces());
 
-        if( keySpaceName == null ) {
-            sessionState.out.println("Keyspace argument required");
+        String keySpaceName;
+
+        // Get keyspace name
+        if (statement.getChildCount() == 0)
+        {
+            // trying to use current keyspace if keyspace name was not given
+            keySpaceName = keySpace;
+        }
+        else
+        {
+            // we have keyspace name as an argument
+            keySpaceName = CliCompiler.getKeySpace(statement, thriftClient.describe_keyspaces());
+        }
+
+        if (keySpaceName == null)
+        {
+            sessionState.out.println("Keyspace argument required if you are not authorized
in any keyspace.");
             return;
         }
         

Modified: cassandra/trunk/src/java/org/apache/cassandra/cli/CliMain.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cli/CliMain.java?rev=1062801&r1=1062800&r2=1062801&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/CliMain.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/CliMain.java Mon Jan 24 14:36:43 2011
@@ -367,6 +367,7 @@ public class CliMain
             if (line.isEmpty())
                 continue;
 
+            line = line.trim();
             currentStatement += line;
 
             if (line.endsWith(";"))

Modified: cassandra/trunk/src/java/org/apache/cassandra/cli/CliUserHelp.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cli/CliUserHelp.java?rev=1062801&r1=1062800&r2=1062801&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/CliUserHelp.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/CliUserHelp.java Mon Jan 24 14:36:43
2011
@@ -97,8 +97,9 @@ public class CliUserHelp {
                 break;
 
             case CliParser.NODE_DESCRIBE_TABLE:
-                state.out.println("describe keyspace <keyspace>;\n");
-                state.out.println("Show additional information about the specified keyspace.\n");
+                state.out.println("describe keyspace (<keyspace>)?;\n");
+                state.out.println("Show additional information about the specified keyspace.");
+                state.out.println("Command could be used without <keyspace> argument
if you are already authenticated to keyspace.\n");
                 state.out.println("example:");
                 state.out.println("describe keyspace system;");
                 break;
@@ -321,7 +322,7 @@ public class CliUserHelp {
             state.out.println("help <command>;                         Display detailed,
command-specific help.");
             state.out.println("connect <hostname>/<port>;                   
        Connect to thrift service.");
             state.out.println("use <keyspace> [<username> 'password'];      
             Switch to a keyspace.");
-            state.out.println("describe keyspace <keyspacename>;                  
          Describe keyspace.");
+            state.out.println("describe keyspace (<keyspacename>)?;               
          Describe keyspace.");
             state.out.println("exit;                                                    
             Exit CLI.");
             state.out.println("quit;                                                    
             Exit CLI.");
             state.out.println("show cluster name;                                       
 Display cluster name.");

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java?rev=1062801&r1=1062800&r2=1062801&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java Mon Jan 24 14:36:43
2011
@@ -522,8 +522,9 @@ public class StorageProxy implements Sto
             Message message = command.makeReadMessage();
             Message messageDigestOnly = readMessageDigestOnly.makeReadMessage();
 
-            InetAddress dataPoint = StorageService.instance.findSuitableEndpoint(command.table,
command.key);
             List<InetAddress> endpoints = StorageService.instance.getLiveNaturalEndpoints(command.table,
command.key);
+            DatabaseDescriptor.getEndpointSnitch().sortByProximity(FBUtilities.getLocalAddress(),
endpoints);
+            InetAddress dataPoint = endpoints.get(0);
 
             ReadResponseResolver resolver = new ReadResponseResolver(command.table, command.key);
             ReadCallback<Row> handler = getReadCallback(resolver, command.table, consistency_level);

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=1062801&r1=1062800&r2=1062801&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Mon Jan 24 14:36:43
2011
@@ -1414,23 +1414,6 @@ public class StorageService implements I
         return liveEps;
     }
 
-    /**
-     * This function finds the closest live endpoint that contains a given key.
-     */
-    public InetAddress findSuitableEndpoint(String table, ByteBuffer key) throws IOException,
UnavailableException
-    {
-        List<InetAddress> endpoints = getNaturalEndpoints(table, key);
-        DatabaseDescriptor.getEndpointSnitch().sortByProximity(FBUtilities.getLocalAddress(),
endpoints);
-        if (logger_.isDebugEnabled())
-            logger_.debug("Sorted endpoints are " + StringUtils.join(endpoints, ","));
-        for (InetAddress endpoint : endpoints)
-        {
-            if (FailureDetector.instance.isAlive(endpoint))
-                return endpoint;
-        }
-        throw new UnavailableException(); // no nodes that could contain key are alive
-    }
-
     public void setLog4jLevel(String classQualifier, String rawLevel)
     {
         Level level = Level.toLevel(rawLevel);



Mime
View raw message