cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r884571 - in /incubator/cassandra/trunk: CHANGES.txt src/java/org/apache/cassandra/db/HintedHandOffManager.java src/java/org/apache/cassandra/db/RowMutation.java
Date Thu, 26 Nov 2009 14:58:11 GMT
Author: jbellis
Date: Thu Nov 26 14:58:10 2009
New Revision: 884571

URL: http://svn.apache.org/viewvc?rev=884571&view=rev
Log:
avoid adding CFs w/ no data to RowMutation on HH
patch by jbellis; tested by Dan Di Spaltro for CASSANDRA-585

Modified:
    incubator/cassandra/trunk/CHANGES.txt
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java

Modified: incubator/cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/CHANGES.txt?rev=884571&r1=884570&r2=884571&view=diff
==============================================================================
--- incubator/cassandra/trunk/CHANGES.txt (original)
+++ incubator/cassandra/trunk/CHANGES.txt Thu Nov 26 14:58:10 2009
@@ -3,6 +3,7 @@
  * fix possibility of partition when many nodes restart at once
    in clusters with multiple seeds (CASSANDRA-150)
  * fix NPE in get_range_slice when no data is found (CASSANDRA-578)
+ * fix potential NPE in hinted handoff (CASSANDRA-585)
 
 
 0.5.0 beta

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java?rev=884571&r1=884570&r2=884571&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java Thu
Nov 26 14:58:10 2009
@@ -112,7 +112,9 @@
         RowMutation rm = new RowMutation(tableName, key);
         for (ColumnFamilyStore cfstore : table.getColumnFamilyStores().values())
         {
-            rm.add(cfstore.getColumnFamily(new IdentityQueryFilter(key, new QueryPath(cfstore.getColumnFamilyName()))));
+            ColumnFamily cf = cfstore.getColumnFamily(new IdentityQueryFilter(key, new QueryPath(cfstore.getColumnFamilyName())));
+            if (cf != null)
+                rm.add(cf);
         }
         Message message = rm.makeRowMutationMessage();
         WriteResponseHandler responseHandler = new WriteResponseHandler(1);

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=884571&r1=884570&r2=884571&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 Thu Nov 26
14:58:10 2009
@@ -116,6 +116,7 @@
     */
     public void add(ColumnFamily columnFamily)
     {
+        assert columnFamily != null;
         if (modifications_.containsKey(columnFamily.name()))
         {
             throw new IllegalArgumentException("ColumnFamily " + columnFamily.name() + "
is already being modified");



Mime
View raw message