cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1023089 - /cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/ReadResponseResolver.java
Date Fri, 15 Oct 2010 19:55:31 GMT
Author: jbellis
Date: Fri Oct 15 19:55:31 2010
New Revision: 1023089

URL: http://svn.apache.org/viewvc?rev=1023089&view=rev
Log:
skip clone on non-mismatch quorum read.  patch by jbellis; tested by Wayne for CASSANDRA-1622

Modified:
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/ReadResponseResolver.java

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/ReadResponseResolver.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/ReadResponseResolver.java?rev=1023089&r1=1023088&r2=1023089&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/ReadResponseResolver.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/ReadResponseResolver.java
Fri Oct 15 19:55:31 2010
@@ -68,6 +68,9 @@ public class ReadResponseResolver implem
       */
 	public Row resolve(Collection<Message> responses) throws DigestMismatchException,
IOException
     {
+        if (logger_.isDebugEnabled())
+            logger_.debug("resolving " + responses.size() + " responses");
+
         long startTime = System.currentTimeMillis();
 		List<ColumnFamily> versions = new ArrayList<ColumnFamily>(responses.size());
 		List<InetAddress> endPoints = new ArrayList<InetAddress>(responses.size());
@@ -98,7 +101,11 @@ public class ReadResponseResolver implem
                 key = result.row().key;
             }
         }
-		// If there was a digest query compare it with all the data digests 
+
+        if (logger_.isDebugEnabled())
+            logger_.debug("responses deserialized");
+
+		// If there was a digest query compare it with all the data digests
 		// If there is a mismatch then throw an exception so that read repair can happen.
         if (isDigestQuery)
         {
@@ -111,10 +118,22 @@ public class ReadResponseResolver implem
                     throw new DigestMismatchException(s);
                 }
             }
+            if (logger_.isDebugEnabled())
+                logger_.debug("digests verified");
         }
 
-        ColumnFamily resolved = resolveSuperset(versions);
-        maybeScheduleRepairs(resolved, table, key, versions, endPoints);
+        ColumnFamily resolved;
+        if (versions.size() > 1)
+        {
+            resolved = resolveSuperset(versions);
+            if (logger_.isDebugEnabled())
+                logger_.debug("versions merged");
+            maybeScheduleRepairs(resolved, table, key, versions, endPoints);
+        }
+        else
+        {
+            resolved = versions.get(0);
+        }
 
         if (logger_.isDebugEnabled())
             logger_.debug("resolve: " + (System.currentTimeMillis() - startTime) + " ms.");



Mime
View raw message