cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r794431 - in /incubator/cassandra/trunk: interface/ interface/gen-java/org/apache/cassandra/service/ src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/db/ test/system/
Date Wed, 15 Jul 2009 22:04:58 GMT
Author: jbellis
Date: Wed Jul 15 22:04:57 2009
New Revision: 794431

URL: http://svn.apache.org/viewvc?rev=794431&view=rev
Log:
missed one: rename column.column_name -> column.name
patch by jbellis; reviewed by Evan Weaver and Sandeep Tata for CASSANDRA-139

Modified:
    incubator/cassandra/trunk/interface/cassandra.thrift
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java
    incubator/cassandra/trunk/test/system/test_server.py

Modified: incubator/cassandra/trunk/interface/cassandra.thrift
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/interface/cassandra.thrift?rev=794431&r1=794430&r2=794431&view=diff
==============================================================================
--- incubator/cassandra/trunk/interface/cassandra.thrift (original)
+++ incubator/cassandra/trunk/interface/cassandra.thrift Wed Jul 15 22:04:57 2009
@@ -31,7 +31,7 @@
 #
 
 struct Column {
-   1: string                        column_name,
+   1: string                        name,
    2: binary                        value,
    3: i64                           timestamp,
 }

Modified: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java?rev=794431&r1=794430&r2=794431&view=diff
==============================================================================
--- incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java
(original)
+++ incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Column.java
Wed Jul 15 22:04:57 2009
@@ -20,12 +20,12 @@
 
 public class Column implements TBase, java.io.Serializable, Cloneable {
   private static final TStruct STRUCT_DESC = new TStruct("Column");
-  private static final TField COLUMN_NAME_FIELD_DESC = new TField("column_name", TType.STRING,
(short)1);
+  private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1);
   private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short)2);
   private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)3);
 
-  public String column_name;
-  public static final int COLUMN_NAME = 1;
+  public String name;
+  public static final int NAME = 1;
   public byte[] value;
   public static final int VALUE = 2;
   public long timestamp;
@@ -37,7 +37,7 @@
   }
 
   public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new
HashMap<Integer, FieldMetaData>() {{
-    put(COLUMN_NAME, new FieldMetaData("column_name", TFieldRequirementType.DEFAULT, 
+    put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
         new FieldValueMetaData(TType.STRING)));
     put(VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT, 
         new FieldValueMetaData(TType.STRING)));
@@ -53,12 +53,12 @@
   }
 
   public Column(
-    String column_name,
+    String name,
     byte[] value,
     long timestamp)
   {
     this();
-    this.column_name = column_name;
+    this.name = name;
     this.value = value;
     this.timestamp = timestamp;
     this.__isset.timestamp = true;
@@ -68,8 +68,8 @@
    * Performs a deep copy on <i>other</i>.
    */
   public Column(Column other) {
-    if (other.isSetColumn_name()) {
-      this.column_name = other.column_name;
+    if (other.isSetName()) {
+      this.name = other.name;
     }
     if (other.isSetValue()) {
       this.value = new byte[other.value.length];
@@ -84,26 +84,26 @@
     return new Column(this);
   }
 
-  public String getColumn_name() {
-    return this.column_name;
+  public String getName() {
+    return this.name;
   }
 
-  public void setColumn_name(String column_name) {
-    this.column_name = column_name;
+  public void setName(String name) {
+    this.name = name;
   }
 
-  public void unsetColumn_name() {
-    this.column_name = null;
+  public void unsetName() {
+    this.name = null;
   }
 
-  // Returns true if field column_name is set (has been asigned a value) and false otherwise
-  public boolean isSetColumn_name() {
-    return this.column_name != null;
+  // Returns true if field name is set (has been asigned a value) and false otherwise
+  public boolean isSetName() {
+    return this.name != null;
   }
 
-  public void setColumn_nameIsSet(boolean value) {
+  public void setNameIsSet(boolean value) {
     if (!value) {
-      this.column_name = null;
+      this.name = null;
     }
   }
 
@@ -154,11 +154,11 @@
 
   public void setFieldValue(int fieldID, Object value) {
     switch (fieldID) {
-    case COLUMN_NAME:
+    case NAME:
       if (value == null) {
-        unsetColumn_name();
+        unsetName();
       } else {
-        setColumn_name((String)value);
+        setName((String)value);
       }
       break;
 
@@ -185,8 +185,8 @@
 
   public Object getFieldValue(int fieldID) {
     switch (fieldID) {
-    case COLUMN_NAME:
-      return getColumn_name();
+    case NAME:
+      return getName();
 
     case VALUE:
       return getValue();
@@ -202,8 +202,8 @@
   // Returns true if field corresponding to fieldID is set (has been asigned a value) and
false otherwise
   public boolean isSet(int fieldID) {
     switch (fieldID) {
-    case COLUMN_NAME:
-      return isSetColumn_name();
+    case NAME:
+      return isSetName();
     case VALUE:
       return isSetValue();
     case TIMESTAMP:
@@ -226,12 +226,12 @@
     if (that == null)
       return false;
 
-    boolean this_present_column_name = true && this.isSetColumn_name();
-    boolean that_present_column_name = true && that.isSetColumn_name();
-    if (this_present_column_name || that_present_column_name) {
-      if (!(this_present_column_name && that_present_column_name))
+    boolean this_present_name = true && this.isSetName();
+    boolean that_present_name = true && that.isSetName();
+    if (this_present_name || that_present_name) {
+      if (!(this_present_name && that_present_name))
         return false;
-      if (!this.column_name.equals(that.column_name))
+      if (!this.name.equals(that.name))
         return false;
     }
 
@@ -272,9 +272,9 @@
       }
       switch (field.id)
       {
-        case COLUMN_NAME:
+        case NAME:
           if (field.type == TType.STRING) {
-            this.column_name = iprot.readString();
+            this.name = iprot.readString();
           } else { 
             TProtocolUtil.skip(iprot, field.type);
           }
@@ -311,9 +311,9 @@
     validate();
 
     oprot.writeStructBegin(STRUCT_DESC);
-    if (this.column_name != null) {
-      oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC);
-      oprot.writeString(this.column_name);
+    if (this.name != null) {
+      oprot.writeFieldBegin(NAME_FIELD_DESC);
+      oprot.writeString(this.name);
       oprot.writeFieldEnd();
     }
     if (this.value != null) {
@@ -333,11 +333,11 @@
     StringBuilder sb = new StringBuilder("Column(");
     boolean first = true;
 
-    sb.append("column_name:");
-    if (this.column_name == null) {
+    sb.append("name:");
+    if (this.name == null) {
       sb.append("null");
     } else {
-      sb.append(this.column_name);
+      sb.append(this.name);
     }
     first = false;
     if (!first) sb.append(", ");

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java?rev=794431&r1=794430&r2=794431&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java Wed Jul 15
22:04:57 2009
@@ -139,24 +139,21 @@
             int size = columns.size();
             for (Iterator<Column> colIter = columns.iterator(); colIter.hasNext();
)
             {
-                Column col = colIter.next();
+                Column column = colIter.next();
                 css_.out.printf("  (column=%s, value=%s; timestamp=%d)\n",
-                                 col.column_name, col.value, col.timestamp);
+                                 column.name, column.value, column.timestamp);
             }
             css_.out.println("Returned " + size + " rows.");
         }
-        else if (columnSpecCnt == 1)
+        else
         {
+            assert columnSpecCnt == 1;
             // table.cf['key']['column']
             String columnName = CliCompiler.getColumn(columnFamilySpec, 0);
-            Column col = new Column();
-           	col = thriftClient_.get_column(tableName, key, new ColumnPath(columnFamily, null,
columnName));
+            Column column = new Column();
+           	column = thriftClient_.get_column(tableName, key, new ColumnPath(columnFamily,
null, columnName));
             css_.out.printf("==> (name=%s, value=%s; timestamp=%d)\n",
-                            col.column_name, col.value, col.timestamp);
-        }
-        else
-        {
-            assert(false);
+                            column.name, column.value, column.timestamp);
         }
     }
 

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java?rev=794431&r1=794430&r2=794431&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java Wed Jul 15
22:04:57 2009
@@ -260,9 +260,9 @@
         for (String cfname : batchMutation.cfmap.keySet())
         {
             List<org.apache.cassandra.service.Column> list = batchMutation.cfmap.get(cfname);
-            for (org.apache.cassandra.service.Column columnData : list)
+            for (org.apache.cassandra.service.Column column : list)
             {
-                rm.add(new QueryPath(cfname, null, columnData.column_name), columnData.value,
columnData.timestamp);
+                rm.add(new QueryPath(cfname, null, column.name), column.value, column.timestamp);
             }
         }
         return rm;
@@ -277,7 +277,7 @@
             {
                 for (org.apache.cassandra.service.Column column : super_column.columns)
                 {
-                    rm.add(new QueryPath(cfName, super_column.name, column.column_name),
column.value, column.timestamp);
+                    rm.add(new QueryPath(cfName, super_column.name, column.name), column.value,
column.timestamp);
                 }
             }
         }

Modified: incubator/cassandra/trunk/test/system/test_server.py
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/system/test_server.py?rev=794431&r1=794430&r2=794431&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/system/test_server.py (original)
+++ incubator/cassandra/trunk/test/system/test_server.py Wed Jul 15 22:04:57 2009
@@ -64,8 +64,8 @@
 def _verify_range():
     result = client.get_slice('Table1','key1', ColumnParent('Standard1'), 'c1', 'c2', True,
0, 1000)
     assert len(result) == 2
-    assert result[0].column_name == 'c1'
-    assert result[1].column_name == 'c2'
+    assert result[0].name == 'c1'
+    assert result[1].name == 'c2'
 
     result = client.get_slice('Table1','key1', ColumnParent('Standard1'), 'a', 'z' , True,
0, 1000)
     assert len(result) == 3, result
@@ -305,10 +305,10 @@
         _insert_range()
         result = client.get_slice_by_names('Table1','key1', ColumnParent('Standard1'), ['c1',
'c2']) 
         assert len(result) == 2
-        assert result[0].column_name == 'c1'
-        assert result[1].column_name == 'c2'
+        assert result[0].name == 'c1'
+        assert result[1].name == 'c2'
 
         _insert_super()
         result = client.get_slice_by_names('Table1','key1', ColumnParent('Super1', 'sc1'),
['c4']) 
         assert len(result) == 1
-        assert result[0].column_name == 'c4'
+        assert result[0].name == 'c4'



Mime
View raw message