cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r787408 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra: db/BinaryVerbHandler.java db/Row.java db/RowMutationVerbHandler.java db/Table.java service/CassandraServer.java
Date Mon, 22 Jun 2009 21:18:18 GMT
Author: jbellis
Date: Mon Jun 22 21:18:18 2009
New Revision: 787408

URL: http://svn.apache.org/viewvc?rev=787408&view=rev
Log:
fix more null table parameters.
patch by jbellis; reviewed by goffinet for CASSANDRA-79

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/BinaryVerbHandler.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Row.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/BinaryVerbHandler.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/BinaryVerbHandler.java?rev=787408&r1=787407&r2=787408&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/BinaryVerbHandler.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/BinaryVerbHandler.java Mon
Jun 22 21:18:18 2009
@@ -52,7 +52,7 @@
 	    {
             RowMutationMessage rmMsg = RowMutationMessage.serializer().deserialize(rowMutationCtx.buffer_);
             RowMutation rm = rmMsg.getRowMutation();            	                
-            rowMutationCtx.row_.key(rm.key());
+            rowMutationCtx.row_.setKey(rm.key());
             rm.applyBinary(rowMutationCtx.row_);
 	
 	    }        

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Row.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Row.java?rev=787408&r1=787407&r2=787408&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Row.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Row.java Mon Jun 22 21:18:18
2009
@@ -38,42 +38,45 @@
 {
     private static Logger logger_ = Logger.getLogger(Row.class);
     private String table_;
+    private static RowSerializer serializer = new RowSerializer();
 
-    public Row(String table_, String key) {
-        this.table_ = table_;
-        this.key_ = key;
+    static RowSerializer serializer()
+    {
+        return serializer;
     }
 
-    public String getTable() {
-        return table_;
+    public Row(String table, String key) {
+        assert table != null;
+        this.table_ = table;
+        this.key_ = key;
     }
 
-    static RowSerializer serializer()
+    // only for use by RMVH
+    Row()
     {
-        return new RowSerializer();
+    }
+
+    public String getTable() {
+        return table_;
     }
 
     private String key_;
 
     private Map<String, ColumnFamily> columnFamilies_ = new HashMap<String, ColumnFamily>();
 
-    protected Row()
+    public String key()
     {
+        return key_;
     }
 
-    public Row(String key)
+    void setKey(String key)
     {
         key_ = key;
     }
 
-    public String key()
+    public void setTable(String table)
     {
-        return key_;
-    }
-
-    void key(String key)
-    {
-        key_ = key;
+        table_ = table;
     }
 
     public Set<String> getColumnFamilyNames()

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java?rev=787408&r1=787407&r2=787408&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
(original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
Mon Jun 22 21:18:18 2009
@@ -18,21 +18,15 @@
 
 package org.apache.cassandra.db;
 
-import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.io.*;
 
-import org.apache.cassandra.concurrent.StageManager;
 import org.apache.cassandra.io.DataInputBuffer;
 import org.apache.cassandra.net.EndPoint;
 import org.apache.cassandra.net.IVerbHandler;
 import org.apache.cassandra.net.Message;
-import org.apache.cassandra.service.StorageService;
-import org.apache.cassandra.utils.LogUtil;
+
 import org.apache.log4j.Logger;
-import org.apache.cassandra.service.*;
-import org.apache.cassandra.utils.*;
-import org.apache.cassandra.concurrent.*;
+
 import org.apache.cassandra.net.*;
 
 /**
@@ -82,7 +76,8 @@
             }
 
             rowMutationCtx.row_.clear();
-            rowMutationCtx.row_.key(rm.key());
+            rowMutationCtx.row_.setTable(rm.table());
+            rowMutationCtx.row_.setKey(rm.key());
             rm.apply(rowMutationCtx.row_);
 
             WriteResponse response = new WriteResponse(rm.table(), rm.key(), true);

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java?rev=787408&r1=787407&r2=787408&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java Mon Jun 22 21:18:18
2009
@@ -659,7 +659,7 @@
     */
     public Row getSliceFrom(String key, String cf, boolean isAscending, int count) throws
IOException
     {
-        Row row = new Row(key);
+        Row row = new Row(table_, key);
         String[] values = RowMutation.getColumnAndColumnFamily(cf);
         String cfName = values[0];
         String startWith = values.length > 1 ? values[1] : "";

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java?rev=787408&r1=787407&r2=787408&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/CassandraServer.java Mon
Jun 22 21:18:18 2009
@@ -227,7 +227,7 @@
         {
             throw new InvalidRequestException("get_column requires non-empty columnfamily");
         }
-        if (DatabaseDescriptor.getColumnFamilyType(null, values[0]).equals("Standard"))
+        if (DatabaseDescriptor.getColumnFamilyType(tablename, values[0]).equals("Standard"))
         {
             if (values.length != 2)
             {



Mime
View raw message