cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r952657 - in /cassandra/trunk: interface/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/thrift/ test/system/
Date Tue, 08 Jun 2010 14:17:08 GMT
Author: gdusbabek
Date: Tue Jun  8 14:17:08 2010
New Revision: 952657

URL: http://svn.apache.org/viewvc?rev=952657&view=rev
Log:
remove keyspace args from some system calls. patch by Matthew Dennis, reviewed by Gary Dusbabek.
CASSANDRA-1168

Modified:
    cassandra/trunk/interface/cassandra.thrift
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
    cassandra/trunk/test/system/test_thrift_server.py

Modified: cassandra/trunk/interface/cassandra.thrift
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.thrift?rev=952657&r1=952656&r2=952657&view=diff
==============================================================================
--- cassandra/trunk/interface/cassandra.thrift (original)
+++ cassandra/trunk/interface/cassandra.thrift Tue Jun  8 14:17:08 2010
@@ -46,7 +46,7 @@ namespace rb CassandraThrift
 #           for every edit that doesn't result in a change to major/minor.
 #
 # See the Semantic Versioning Specification (SemVer) http://semver.org.
-const string VERSION = "7.0.0"
+const string VERSION = "8.0.0"
 
 #
 # data structures
@@ -442,8 +442,7 @@ service Cassandra {
    The operation succeeds only if all hosts in the cluster at available and will throw an
UnavailableException if 
    some hosts are down.
   */
-  void truncate(1:required string keyspace,
-                2:required string cfname)
+  void truncate(1:required string cfname)
        throws (1: InvalidRequestException ire, 2: UnavailableException ue),
     
   // Meta-APIs -- APIs to get information about the node or cluster,
@@ -497,11 +496,11 @@ service Cassandra {
     throws (1:InvalidRequestException ire),
     
   /** drops a column family. returns the new schema id. */
-  string system_drop_column_family(1:required string keyspace, 2:required string column_family)
+  string system_drop_column_family(1:required string column_family)
     throws (1:InvalidRequestException ire), 
     
   /** renames a column family. returns the new schema id. */
-  string system_rename_column_family(1:required string keyspace, 2:required string old_name,
3:required string new_name)
+  string system_rename_column_family(1:required string old_name, 2:required string new_name)
     throws (1:InvalidRequestException ire),
   
   /** adds a keyspace and any column families that are part of it. returns the new schema
id. */

Modified: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java?rev=952657&r1=952656&r2=952657&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java Tue
Jun  8 14:17:08 2010
@@ -156,10 +156,9 @@ public class Cassandra {
      * The operation succeeds only if all hosts in the cluster at available and will throw
an UnavailableException if
      * some hosts are down.
      * 
-     * @param keyspace
      * @param cfname
      */
-    public void truncate(String keyspace, String cfname) throws InvalidRequestException,
UnavailableException, TException;
+    public void truncate(String cfname) throws InvalidRequestException, UnavailableException,
TException;
 
     /**
      * ask the cluster if they all are using the same migration id. returns a map of version->hosts-on-that-version.
@@ -229,19 +228,17 @@ public class Cassandra {
     /**
      * drops a column family. returns the new schema id.
      * 
-     * @param keyspace
      * @param column_family
      */
-    public String system_drop_column_family(String keyspace, String column_family) throws
InvalidRequestException, TException;
+    public String system_drop_column_family(String column_family) throws InvalidRequestException,
TException;
 
     /**
      * renames a column family. returns the new schema id.
      * 
-     * @param keyspace
      * @param old_name
      * @param new_name
      */
-    public String system_rename_column_family(String keyspace, String old_name, String new_name)
throws InvalidRequestException, TException;
+    public String system_rename_column_family(String old_name, String new_name) throws InvalidRequestException,
TException;
 
     /**
      * adds a keyspace and any column families that are part of it. returns the new schema
id.
@@ -763,17 +760,16 @@ public class Cassandra {
       return;
     }
 
-    public void truncate(String keyspace, String cfname) throws InvalidRequestException,
UnavailableException, TException
+    public void truncate(String cfname) throws InvalidRequestException, UnavailableException,
TException
     {
-      send_truncate(keyspace, cfname);
+      send_truncate(cfname);
       recv_truncate();
     }
 
-    public void send_truncate(String keyspace, String cfname) throws TException
+    public void send_truncate(String cfname) throws TException
     {
       oprot_.writeMessageBegin(new TMessage("truncate", TMessageType.CALL, seqid_));
       truncate_args args = new truncate_args();
-      args.keyspace = keyspace;
       args.cfname = cfname;
       args.write(oprot_);
       oprot_.writeMessageEnd();
@@ -1076,17 +1072,16 @@ public class Cassandra {
       throw new TApplicationException(TApplicationException.MISSING_RESULT, "system_add_column_family
failed: unknown result");
     }
 
-    public String system_drop_column_family(String keyspace, String column_family) throws
InvalidRequestException, TException
+    public String system_drop_column_family(String column_family) throws InvalidRequestException,
TException
     {
-      send_system_drop_column_family(keyspace, column_family);
+      send_system_drop_column_family(column_family);
       return recv_system_drop_column_family();
     }
 
-    public void send_system_drop_column_family(String keyspace, String column_family) throws
TException
+    public void send_system_drop_column_family(String column_family) throws TException
     {
       oprot_.writeMessageBegin(new TMessage("system_drop_column_family", TMessageType.CALL,
seqid_));
       system_drop_column_family_args args = new system_drop_column_family_args();
-      args.keyspace = keyspace;
       args.column_family = column_family;
       args.write(oprot_);
       oprot_.writeMessageEnd();
@@ -1113,17 +1108,16 @@ public class Cassandra {
       throw new TApplicationException(TApplicationException.MISSING_RESULT, "system_drop_column_family
failed: unknown result");
     }
 
-    public String system_rename_column_family(String keyspace, String old_name, String new_name)
throws InvalidRequestException, TException
+    public String system_rename_column_family(String old_name, String new_name) throws InvalidRequestException,
TException
     {
-      send_system_rename_column_family(keyspace, old_name, new_name);
+      send_system_rename_column_family(old_name, new_name);
       return recv_system_rename_column_family();
     }
 
-    public void send_system_rename_column_family(String keyspace, String old_name, String
new_name) throws TException
+    public void send_system_rename_column_family(String old_name, String new_name) throws
TException
     {
       oprot_.writeMessageBegin(new TMessage("system_rename_column_family", TMessageType.CALL,
seqid_));
       system_rename_column_family_args args = new system_rename_column_family_args();
-      args.keyspace = keyspace;
       args.old_name = old_name;
       args.new_name = new_name;
       args.write(oprot_);
@@ -1795,7 +1789,7 @@ public class Cassandra {
         iprot.readMessageEnd();
         truncate_result result = new truncate_result();
         try {
-          iface_.truncate(args.keyspace, args.cfname);
+          iface_.truncate(args.cfname);
         } catch (InvalidRequestException ire) {
           result.ire = ire;
         } catch (UnavailableException ue) {
@@ -2091,7 +2085,7 @@ public class Cassandra {
         iprot.readMessageEnd();
         system_drop_column_family_result result = new system_drop_column_family_result();
         try {
-          result.success = iface_.system_drop_column_family(args.keyspace, args.column_family);
+          result.success = iface_.system_drop_column_family(args.column_family);
         } catch (InvalidRequestException ire) {
           result.ire = ire;
         } catch (Throwable th) {
@@ -2129,7 +2123,7 @@ public class Cassandra {
         iprot.readMessageEnd();
         system_rename_column_family_result result = new system_rename_column_family_result();
         try {
-          result.success = iface_.system_rename_column_family(args.keyspace, args.old_name,
args.new_name);
+          result.success = iface_.system_rename_column_family(args.old_name, args.new_name);
         } catch (InvalidRequestException ire) {
           result.ire = ire;
         } catch (Throwable th) {
@@ -13419,16 +13413,13 @@ public class Cassandra {
   public static class truncate_args implements TBase<truncate_args._Fields>, java.io.Serializable,
Cloneable, Comparable<truncate_args>   {
     private static final TStruct STRUCT_DESC = new TStruct("truncate_args");
 
-    private static final TField KEYSPACE_FIELD_DESC = new TField("keyspace", TType.STRING,
(short)1);
-    private static final TField CFNAME_FIELD_DESC = new TField("cfname", TType.STRING, (short)2);
+    private static final TField CFNAME_FIELD_DESC = new TField("cfname", TType.STRING, (short)1);
 
-    public String keyspace;
     public String cfname;
 
     /** The set of fields this struct contains, along with convenience methods for finding
and manipulating them. */
     public enum _Fields implements TFieldIdEnum {
-      KEYSPACE((short)1, "keyspace"),
-      CFNAME((short)2, "cfname");
+      CFNAME((short)1, "cfname");
 
       private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -13484,8 +13475,6 @@ public class Cassandra {
     // isset id assignments
 
     public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new
EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-      put(_Fields.KEYSPACE, new FieldMetaData("keyspace", TFieldRequirementType.REQUIRED,

-          new FieldValueMetaData(TType.STRING)));
       put(_Fields.CFNAME, new FieldMetaData("cfname", TFieldRequirementType.REQUIRED, 
           new FieldValueMetaData(TType.STRING)));
     }});
@@ -13498,11 +13487,9 @@ public class Cassandra {
     }
 
     public truncate_args(
-      String keyspace,
       String cfname)
     {
       this();
-      this.keyspace = keyspace;
       this.cfname = cfname;
     }
 
@@ -13510,9 +13497,6 @@ public class Cassandra {
      * Performs a deep copy on <i>other</i>.
      */
     public truncate_args(truncate_args other) {
-      if (other.isSetKeyspace()) {
-        this.keyspace = other.keyspace;
-      }
       if (other.isSetCfname()) {
         this.cfname = other.cfname;
       }
@@ -13527,30 +13511,6 @@ public class Cassandra {
       return new truncate_args(this);
     }
 
-    public String getKeyspace() {
-      return this.keyspace;
-    }
-
-    public truncate_args setKeyspace(String keyspace) {
-      this.keyspace = keyspace;
-      return this;
-    }
-
-    public void unsetKeyspace() {
-      this.keyspace = null;
-    }
-
-    /** Returns true if field keyspace is set (has been asigned a value) and false otherwise
*/
-    public boolean isSetKeyspace() {
-      return this.keyspace != null;
-    }
-
-    public void setKeyspaceIsSet(boolean value) {
-      if (!value) {
-        this.keyspace = null;
-      }
-    }
-
     public String getCfname() {
       return this.cfname;
     }
@@ -13577,14 +13537,6 @@ public class Cassandra {
 
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
-      case KEYSPACE:
-        if (value == null) {
-          unsetKeyspace();
-        } else {
-          setKeyspace((String)value);
-        }
-        break;
-
       case CFNAME:
         if (value == null) {
           unsetCfname();
@@ -13602,9 +13554,6 @@ public class Cassandra {
 
     public Object getFieldValue(_Fields field) {
       switch (field) {
-      case KEYSPACE:
-        return getKeyspace();
-
       case CFNAME:
         return getCfname();
 
@@ -13619,8 +13568,6 @@ public class Cassandra {
     /** Returns true if field corresponding to fieldID is set (has been asigned a value)
and false otherwise */
     public boolean isSet(_Fields field) {
       switch (field) {
-      case KEYSPACE:
-        return isSetKeyspace();
       case CFNAME:
         return isSetCfname();
       }
@@ -13644,15 +13591,6 @@ public class Cassandra {
       if (that == null)
         return false;
 
-      boolean this_present_keyspace = true && this.isSetKeyspace();
-      boolean that_present_keyspace = true && that.isSetKeyspace();
-      if (this_present_keyspace || that_present_keyspace) {
-        if (!(this_present_keyspace && that_present_keyspace))
-          return false;
-        if (!this.keyspace.equals(that.keyspace))
-          return false;
-      }
-
       boolean this_present_cfname = true && this.isSetCfname();
       boolean that_present_cfname = true && that.isSetCfname();
       if (this_present_cfname || that_present_cfname) {
@@ -13678,15 +13616,6 @@ public class Cassandra {
       int lastComparison = 0;
       truncate_args typedOther = (truncate_args)other;
 
-      lastComparison = Boolean.valueOf(isSetKeyspace()).compareTo(typedOther.isSetKeyspace());
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-      if (isSetKeyspace()) {        lastComparison = TBaseHelper.compareTo(keyspace, typedOther.keyspace);
-        if (lastComparison != 0) {
-          return lastComparison;
-        }
-      }
       lastComparison = Boolean.valueOf(isSetCfname()).compareTo(typedOther.isSetCfname());
       if (lastComparison != 0) {
         return lastComparison;
@@ -13709,14 +13638,7 @@ public class Cassandra {
           break;
         }
         switch (field.id) {
-          case 1: // KEYSPACE
-            if (field.type == TType.STRING) {
-              this.keyspace = iprot.readString();
-            } else { 
-              TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          case 2: // CFNAME
+          case 1: // CFNAME
             if (field.type == TType.STRING) {
               this.cfname = iprot.readString();
             } else { 
@@ -13738,11 +13660,6 @@ public class Cassandra {
       validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
-      if (this.keyspace != null) {
-        oprot.writeFieldBegin(KEYSPACE_FIELD_DESC);
-        oprot.writeString(this.keyspace);
-        oprot.writeFieldEnd();
-      }
       if (this.cfname != null) {
         oprot.writeFieldBegin(CFNAME_FIELD_DESC);
         oprot.writeString(this.cfname);
@@ -13757,14 +13674,6 @@ public class Cassandra {
       StringBuilder sb = new StringBuilder("truncate_args(");
       boolean first = true;
 
-      sb.append("keyspace:");
-      if (this.keyspace == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.keyspace);
-      }
-      first = false;
-      if (!first) sb.append(", ");
       sb.append("cfname:");
       if (this.cfname == null) {
         sb.append("null");
@@ -13778,9 +13687,6 @@ public class Cassandra {
 
     public void validate() throws TException {
       // check for required fields
-      if (keyspace == null) {
-        throw new TProtocolException("Required field 'keyspace' was not present! Struct:
" + toString());
-      }
       if (cfname == null) {
         throw new TProtocolException("Required field 'cfname' was not present! Struct: "
+ toString());
       }
@@ -19162,16 +19068,13 @@ public class Cassandra {
   public static class system_drop_column_family_args implements TBase<system_drop_column_family_args._Fields>,
java.io.Serializable, Cloneable, Comparable<system_drop_column_family_args>   {
     private static final TStruct STRUCT_DESC = new TStruct("system_drop_column_family_args");
 
-    private static final TField KEYSPACE_FIELD_DESC = new TField("keyspace", TType.STRING,
(short)1);
-    private static final TField COLUMN_FAMILY_FIELD_DESC = new TField("column_family", TType.STRING,
(short)2);
+    private static final TField COLUMN_FAMILY_FIELD_DESC = new TField("column_family", TType.STRING,
(short)1);
 
-    public String keyspace;
     public String column_family;
 
     /** The set of fields this struct contains, along with convenience methods for finding
and manipulating them. */
     public enum _Fields implements TFieldIdEnum {
-      KEYSPACE((short)1, "keyspace"),
-      COLUMN_FAMILY((short)2, "column_family");
+      COLUMN_FAMILY((short)1, "column_family");
 
       private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -19227,8 +19130,6 @@ public class Cassandra {
     // isset id assignments
 
     public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new
EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-      put(_Fields.KEYSPACE, new FieldMetaData("keyspace", TFieldRequirementType.REQUIRED,

-          new FieldValueMetaData(TType.STRING)));
       put(_Fields.COLUMN_FAMILY, new FieldMetaData("column_family", TFieldRequirementType.REQUIRED,

           new FieldValueMetaData(TType.STRING)));
     }});
@@ -19241,11 +19142,9 @@ public class Cassandra {
     }
 
     public system_drop_column_family_args(
-      String keyspace,
       String column_family)
     {
       this();
-      this.keyspace = keyspace;
       this.column_family = column_family;
     }
 
@@ -19253,9 +19152,6 @@ public class Cassandra {
      * Performs a deep copy on <i>other</i>.
      */
     public system_drop_column_family_args(system_drop_column_family_args other) {
-      if (other.isSetKeyspace()) {
-        this.keyspace = other.keyspace;
-      }
       if (other.isSetColumn_family()) {
         this.column_family = other.column_family;
       }
@@ -19270,30 +19166,6 @@ public class Cassandra {
       return new system_drop_column_family_args(this);
     }
 
-    public String getKeyspace() {
-      return this.keyspace;
-    }
-
-    public system_drop_column_family_args setKeyspace(String keyspace) {
-      this.keyspace = keyspace;
-      return this;
-    }
-
-    public void unsetKeyspace() {
-      this.keyspace = null;
-    }
-
-    /** Returns true if field keyspace is set (has been asigned a value) and false otherwise
*/
-    public boolean isSetKeyspace() {
-      return this.keyspace != null;
-    }
-
-    public void setKeyspaceIsSet(boolean value) {
-      if (!value) {
-        this.keyspace = null;
-      }
-    }
-
     public String getColumn_family() {
       return this.column_family;
     }
@@ -19320,14 +19192,6 @@ public class Cassandra {
 
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
-      case KEYSPACE:
-        if (value == null) {
-          unsetKeyspace();
-        } else {
-          setKeyspace((String)value);
-        }
-        break;
-
       case COLUMN_FAMILY:
         if (value == null) {
           unsetColumn_family();
@@ -19345,9 +19209,6 @@ public class Cassandra {
 
     public Object getFieldValue(_Fields field) {
       switch (field) {
-      case KEYSPACE:
-        return getKeyspace();
-
       case COLUMN_FAMILY:
         return getColumn_family();
 
@@ -19362,8 +19223,6 @@ public class Cassandra {
     /** Returns true if field corresponding to fieldID is set (has been asigned a value)
and false otherwise */
     public boolean isSet(_Fields field) {
       switch (field) {
-      case KEYSPACE:
-        return isSetKeyspace();
       case COLUMN_FAMILY:
         return isSetColumn_family();
       }
@@ -19387,15 +19246,6 @@ public class Cassandra {
       if (that == null)
         return false;
 
-      boolean this_present_keyspace = true && this.isSetKeyspace();
-      boolean that_present_keyspace = true && that.isSetKeyspace();
-      if (this_present_keyspace || that_present_keyspace) {
-        if (!(this_present_keyspace && that_present_keyspace))
-          return false;
-        if (!this.keyspace.equals(that.keyspace))
-          return false;
-      }
-
       boolean this_present_column_family = true && this.isSetColumn_family();
       boolean that_present_column_family = true && that.isSetColumn_family();
       if (this_present_column_family || that_present_column_family) {
@@ -19421,15 +19271,6 @@ public class Cassandra {
       int lastComparison = 0;
       system_drop_column_family_args typedOther = (system_drop_column_family_args)other;
 
-      lastComparison = Boolean.valueOf(isSetKeyspace()).compareTo(typedOther.isSetKeyspace());
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-      if (isSetKeyspace()) {        lastComparison = TBaseHelper.compareTo(keyspace, typedOther.keyspace);
-        if (lastComparison != 0) {
-          return lastComparison;
-        }
-      }
       lastComparison = Boolean.valueOf(isSetColumn_family()).compareTo(typedOther.isSetColumn_family());
       if (lastComparison != 0) {
         return lastComparison;
@@ -19452,14 +19293,7 @@ public class Cassandra {
           break;
         }
         switch (field.id) {
-          case 1: // KEYSPACE
-            if (field.type == TType.STRING) {
-              this.keyspace = iprot.readString();
-            } else { 
-              TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          case 2: // COLUMN_FAMILY
+          case 1: // COLUMN_FAMILY
             if (field.type == TType.STRING) {
               this.column_family = iprot.readString();
             } else { 
@@ -19481,11 +19315,6 @@ public class Cassandra {
       validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
-      if (this.keyspace != null) {
-        oprot.writeFieldBegin(KEYSPACE_FIELD_DESC);
-        oprot.writeString(this.keyspace);
-        oprot.writeFieldEnd();
-      }
       if (this.column_family != null) {
         oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC);
         oprot.writeString(this.column_family);
@@ -19500,14 +19329,6 @@ public class Cassandra {
       StringBuilder sb = new StringBuilder("system_drop_column_family_args(");
       boolean first = true;
 
-      sb.append("keyspace:");
-      if (this.keyspace == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.keyspace);
-      }
-      first = false;
-      if (!first) sb.append(", ");
       sb.append("column_family:");
       if (this.column_family == null) {
         sb.append("null");
@@ -19521,9 +19342,6 @@ public class Cassandra {
 
     public void validate() throws TException {
       // check for required fields
-      if (keyspace == null) {
-        throw new TProtocolException("Required field 'keyspace' was not present! Struct:
" + toString());
-      }
       if (column_family == null) {
         throw new TProtocolException("Required field 'column_family' was not present! Struct:
" + toString());
       }
@@ -19899,19 +19717,16 @@ public class Cassandra {
   public static class system_rename_column_family_args implements TBase<system_rename_column_family_args._Fields>,
java.io.Serializable, Cloneable, Comparable<system_rename_column_family_args>   {
     private static final TStruct STRUCT_DESC = new TStruct("system_rename_column_family_args");
 
-    private static final TField KEYSPACE_FIELD_DESC = new TField("keyspace", TType.STRING,
(short)1);
-    private static final TField OLD_NAME_FIELD_DESC = new TField("old_name", TType.STRING,
(short)2);
-    private static final TField NEW_NAME_FIELD_DESC = new TField("new_name", TType.STRING,
(short)3);
+    private static final TField OLD_NAME_FIELD_DESC = new TField("old_name", TType.STRING,
(short)1);
+    private static final TField NEW_NAME_FIELD_DESC = new TField("new_name", TType.STRING,
(short)2);
 
-    public String keyspace;
     public String old_name;
     public String new_name;
 
     /** The set of fields this struct contains, along with convenience methods for finding
and manipulating them. */
     public enum _Fields implements TFieldIdEnum {
-      KEYSPACE((short)1, "keyspace"),
-      OLD_NAME((short)2, "old_name"),
-      NEW_NAME((short)3, "new_name");
+      OLD_NAME((short)1, "old_name"),
+      NEW_NAME((short)2, "new_name");
 
       private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -19967,8 +19782,6 @@ public class Cassandra {
     // isset id assignments
 
     public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new
EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-      put(_Fields.KEYSPACE, new FieldMetaData("keyspace", TFieldRequirementType.REQUIRED,

-          new FieldValueMetaData(TType.STRING)));
       put(_Fields.OLD_NAME, new FieldMetaData("old_name", TFieldRequirementType.REQUIRED,

           new FieldValueMetaData(TType.STRING)));
       put(_Fields.NEW_NAME, new FieldMetaData("new_name", TFieldRequirementType.REQUIRED,

@@ -19983,12 +19796,10 @@ public class Cassandra {
     }
 
     public system_rename_column_family_args(
-      String keyspace,
       String old_name,
       String new_name)
     {
       this();
-      this.keyspace = keyspace;
       this.old_name = old_name;
       this.new_name = new_name;
     }
@@ -19997,9 +19808,6 @@ public class Cassandra {
      * Performs a deep copy on <i>other</i>.
      */
     public system_rename_column_family_args(system_rename_column_family_args other) {
-      if (other.isSetKeyspace()) {
-        this.keyspace = other.keyspace;
-      }
       if (other.isSetOld_name()) {
         this.old_name = other.old_name;
       }
@@ -20017,30 +19825,6 @@ public class Cassandra {
       return new system_rename_column_family_args(this);
     }
 
-    public String getKeyspace() {
-      return this.keyspace;
-    }
-
-    public system_rename_column_family_args setKeyspace(String keyspace) {
-      this.keyspace = keyspace;
-      return this;
-    }
-
-    public void unsetKeyspace() {
-      this.keyspace = null;
-    }
-
-    /** Returns true if field keyspace is set (has been asigned a value) and false otherwise
*/
-    public boolean isSetKeyspace() {
-      return this.keyspace != null;
-    }
-
-    public void setKeyspaceIsSet(boolean value) {
-      if (!value) {
-        this.keyspace = null;
-      }
-    }
-
     public String getOld_name() {
       return this.old_name;
     }
@@ -20091,14 +19875,6 @@ public class Cassandra {
 
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
-      case KEYSPACE:
-        if (value == null) {
-          unsetKeyspace();
-        } else {
-          setKeyspace((String)value);
-        }
-        break;
-
       case OLD_NAME:
         if (value == null) {
           unsetOld_name();
@@ -20124,9 +19900,6 @@ public class Cassandra {
 
     public Object getFieldValue(_Fields field) {
       switch (field) {
-      case KEYSPACE:
-        return getKeyspace();
-
       case OLD_NAME:
         return getOld_name();
 
@@ -20144,8 +19917,6 @@ public class Cassandra {
     /** Returns true if field corresponding to fieldID is set (has been asigned a value)
and false otherwise */
     public boolean isSet(_Fields field) {
       switch (field) {
-      case KEYSPACE:
-        return isSetKeyspace();
       case OLD_NAME:
         return isSetOld_name();
       case NEW_NAME:
@@ -20171,15 +19942,6 @@ public class Cassandra {
       if (that == null)
         return false;
 
-      boolean this_present_keyspace = true && this.isSetKeyspace();
-      boolean that_present_keyspace = true && that.isSetKeyspace();
-      if (this_present_keyspace || that_present_keyspace) {
-        if (!(this_present_keyspace && that_present_keyspace))
-          return false;
-        if (!this.keyspace.equals(that.keyspace))
-          return false;
-      }
-
       boolean this_present_old_name = true && this.isSetOld_name();
       boolean that_present_old_name = true && that.isSetOld_name();
       if (this_present_old_name || that_present_old_name) {
@@ -20214,15 +19976,6 @@ public class Cassandra {
       int lastComparison = 0;
       system_rename_column_family_args typedOther = (system_rename_column_family_args)other;
 
-      lastComparison = Boolean.valueOf(isSetKeyspace()).compareTo(typedOther.isSetKeyspace());
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-      if (isSetKeyspace()) {        lastComparison = TBaseHelper.compareTo(keyspace, typedOther.keyspace);
-        if (lastComparison != 0) {
-          return lastComparison;
-        }
-      }
       lastComparison = Boolean.valueOf(isSetOld_name()).compareTo(typedOther.isSetOld_name());
       if (lastComparison != 0) {
         return lastComparison;
@@ -20254,21 +20007,14 @@ public class Cassandra {
           break;
         }
         switch (field.id) {
-          case 1: // KEYSPACE
-            if (field.type == TType.STRING) {
-              this.keyspace = iprot.readString();
-            } else { 
-              TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          case 2: // OLD_NAME
+          case 1: // OLD_NAME
             if (field.type == TType.STRING) {
               this.old_name = iprot.readString();
             } else { 
               TProtocolUtil.skip(iprot, field.type);
             }
             break;
-          case 3: // NEW_NAME
+          case 2: // NEW_NAME
             if (field.type == TType.STRING) {
               this.new_name = iprot.readString();
             } else { 
@@ -20290,11 +20036,6 @@ public class Cassandra {
       validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
-      if (this.keyspace != null) {
-        oprot.writeFieldBegin(KEYSPACE_FIELD_DESC);
-        oprot.writeString(this.keyspace);
-        oprot.writeFieldEnd();
-      }
       if (this.old_name != null) {
         oprot.writeFieldBegin(OLD_NAME_FIELD_DESC);
         oprot.writeString(this.old_name);
@@ -20314,14 +20055,6 @@ public class Cassandra {
       StringBuilder sb = new StringBuilder("system_rename_column_family_args(");
       boolean first = true;
 
-      sb.append("keyspace:");
-      if (this.keyspace == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.keyspace);
-      }
-      first = false;
-      if (!first) sb.append(", ");
       sb.append("old_name:");
       if (this.old_name == null) {
         sb.append("null");
@@ -20343,9 +20076,6 @@ public class Cassandra {
 
     public void validate() throws TException {
       // check for required fields
-      if (keyspace == null) {
-        throw new TProtocolException("Required field 'keyspace' was not present! Struct:
" + toString());
-      }
       if (old_name == null) {
         throw new TProtocolException("Required field 'old_name' was not present! Struct:
" + toString());
       }

Modified: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java?rev=952657&r1=952656&r2=952657&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java Tue
Jun  8 14:17:08 2010
@@ -42,6 +42,6 @@ import org.slf4j.LoggerFactory;
 
 public class Constants {
 
-  public static final String VERSION = "7.0.0";
+  public static final String VERSION = "8.0.0";
 
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java?rev=952657&r1=952656&r2=952657&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java Tue Jun  8 14:17:08
2010
@@ -658,7 +658,7 @@ public class CassandraServer implements 
         }
     }
 
-    public String system_drop_column_family(String keyspace, String column_family) throws
InvalidRequestException, TException
+    public String system_drop_column_family(String column_family) throws InvalidRequestException,
TException
     {
         checkKeyspaceAndLoginAuthorized(AccessLevel.FULL);
         
@@ -668,7 +668,7 @@ public class CassandraServer implements 
 
         try
         {
-            DropColumnFamily drop = new DropColumnFamily(keyspace, column_family, true);
+            DropColumnFamily drop = new DropColumnFamily(keySpace.get(), column_family, true);
             drop.apply();
             drop.announce();
             return DatabaseDescriptor.getDefsVersion().toString();
@@ -687,7 +687,7 @@ public class CassandraServer implements 
         }
     }
 
-    public String system_rename_column_family(String keyspace, String old_name, String new_name)
throws InvalidRequestException, TException
+    public String system_rename_column_family(String old_name, String new_name) throws InvalidRequestException,
TException
     {
         checkKeyspaceAndLoginAuthorized(AccessLevel.FULL);
         
@@ -697,7 +697,7 @@ public class CassandraServer implements 
 
         try
         {
-            RenameColumnFamily rename = new RenameColumnFamily(keyspace, old_name, new_name);
+            RenameColumnFamily rename = new RenameColumnFamily(keySpace.get(), old_name,
new_name);
             rename.apply();
             rename.announce();
             return DatabaseDescriptor.getDefsVersion().toString();
@@ -860,13 +860,13 @@ public class CassandraServer implements 
                     cf_def.key_cache_size);
     }
 
-    public void truncate(String keyspace, String cfname) throws InvalidRequestException,
UnavailableException, TException
+    public void truncate(String cfname) throws InvalidRequestException, UnavailableException,
TException
     {
-        logger.debug("truncating {} in {}", cfname, keyspace);
+        logger.debug("truncating {} in {}", cfname, keySpace.get());
         checkKeyspaceAndLoginAuthorized(AccessLevel.FULL);
         try
         {
-            StorageProxy.truncateBlocking(keyspace, cfname);
+            StorageProxy.truncateBlocking(keySpace.get(), cfname);
         }
         catch (TimeoutException e)
         {

Modified: cassandra/trunk/test/system/test_thrift_server.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/system/test_thrift_server.py?rev=952657&r1=952656&r2=952657&view=diff
==============================================================================
--- cassandra/trunk/test/system/test_thrift_server.py (original)
+++ cassandra/trunk/test/system/test_thrift_server.py Tue Jun  8 14:17:08 2010
@@ -1100,13 +1100,13 @@ class TestMutations(ThriftTester):
         assert 'NewColumnFamily' in ks1
         
         # rename
-        client.system_rename_column_family('Keyspace1', 'NewColumnFamily', 'RenameColumnFamily')
+        client.system_rename_column_family('NewColumnFamily', 'RenameColumnFamily')
         ks1 = client.describe_keyspace('Keyspace1')
         assert 'RenameColumnFamily' in ks1
         assert 'NewColumnFamily' not in ks1
         
         # drop
-        client.system_drop_column_family('Keyspace1', 'RenameColumnFamily')
+        client.system_drop_column_family('RenameColumnFamily')
         ks1 = client.describe_keyspace('Keyspace1')
         assert 'RenameColumnFamily' not in ks1
         assert 'NewColumnFamily' not in ks1
@@ -1123,13 +1123,13 @@ class TestMutations(ThriftTester):
         assert 'NewSuperColumnFamily' in ks1
         
         # rename
-        client.system_rename_column_family('Keyspace1', 'NewSuperColumnFamily', 'RenameSuperColumnFamily')
+        client.system_rename_column_family('NewSuperColumnFamily', 'RenameSuperColumnFamily')
         ks1 = client.describe_keyspace('Keyspace1')
         assert 'RenameSuperColumnFamily' in ks1
         assert 'NewSuperColumnFamily' not in ks1
         
         # drop
-        client.system_drop_column_family('Keyspace1', 'RenameSuperColumnFamily')
+        client.system_drop_column_family('RenameSuperColumnFamily')
         ks1 = client.describe_keyspace('Keyspace1')
         assert 'RenameSuperColumnFamily' not in ks1
         assert 'NewSuperColumnFamily' not in ks1
@@ -1198,10 +1198,10 @@ class TestTruncate(ThriftTester):
         _insert_super()
 
         # truncate Standard1
-        client.truncate('Keyspace1', 'Standard1')
+        client.truncate('Standard1')
         assert _big_slice('key1', ColumnParent('Standard1')) == []
 
         # truncate Super1
-        client.truncate('Keyspace1', 'Super1')
+        client.truncate('Super1')
         assert _big_slice('key1', ColumnParent('Super1')) == []
         assert _big_slice('key1', ColumnParent('Super1', 'sc1')) == []



Mime
View raw message