cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1126502 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
Date Mon, 23 May 2011 14:23:36 GMT
Author: jbellis
Date: Mon May 23 14:23:36 2011
New Revision: 1126502

URL: http://svn.apache.org/viewvc?rev=1126502&view=rev
Log:
add placeholders formissingrows inrange query pseudo-RR
patch by jbellis; reviewed by slebresne for CASSANDRA-2680

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1126502&r1=1126501&r2=1126502&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Mon May 23 14:23:36 2011
@@ -6,6 +6,7 @@
  * don't perform HH to client-mode [storageproxy] nodes (CASSANDRA-2668)
  * fix IntegerType.getString with direct buffers (CASSANDRA-2684)
  * avoid replaying hints to dropped columnfamilies (CASSANDRA-2685)
+ * add placeholders for missing rows in range query pseudo-RR (CASSANDRA-2680)
 
 
 0.7.6

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java?rev=1126502&r1=1126501&r2=1126502&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
Mon May 23 14:23:36 2011
@@ -24,8 +24,6 @@ import java.util.*;
 import java.util.concurrent.LinkedBlockingQueue;
 
 import com.google.common.collect.AbstractIterator;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
 import org.apache.commons.collections.iterators.CollatingIterator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -104,7 +102,21 @@ public class RangeSliceResponseResolver 
 
             protected Row getReduced()
             {
-                ColumnFamily resolved = RowRepairResolver.resolveSuperset(versions);
+                ColumnFamily resolved = versions.size() > 1
+                                      ? RowRepairResolver.resolveSuperset(versions)
+                                      : versions.get(0);
+                if (versions.size() < sources.size())
+                {
+                    // add placeholder rows for sources that didn't have any data, so maybeScheduleRepairs
sees them
+                    for (InetAddress source : sources)
+                    {
+                        if (!versionSources.contains(source))
+                        {
+                            versions.add(null);
+                            versionSources.add(source);
+                        }
+                    }
+                }
                 RowRepairResolver.maybeScheduleRepairs(resolved, table, key, versions, versionSources);
                 versions.clear();
                 versionSources.clear();



Mime
View raw message