cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1053417 - /cassandra/trunk/src/java/org/apache/cassandra/service/ReadResponseResolver.java
Date Tue, 28 Dec 2010 19:59:25 GMT
Author: jbellis
Date: Tue Dec 28 19:59:25 2010
New Revision: 1053417

URL: http://svn.apache.org/viewvc?rev=1053417&view=rev
Log:
undo gratuitous refactoring of RRR code from #1072
patch by jbellis

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/service/ReadResponseResolver.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/ReadResponseResolver.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/ReadResponseResolver.java?rev=1053417&r1=1053416&r2=1053417&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/ReadResponseResolver.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/ReadResponseResolver.java Tue Dec
28 19:59:25 2010
@@ -56,13 +56,6 @@ public class ReadResponseResolver implem
         this.key = StorageService.getPartitioner().decorateKey(key);
     }
 
-    private void checkDigest(DecoratedKey key, ByteBuffer digest, ByteBuffer resultDigest)
throws DigestMismatchException
-    {
-        if (resultDigest.equals(digest))
-            return;
-        throw new DigestMismatchException(key, digest, resultDigest);
-    }
-    
     /*
       * This method for resolving read data should look at the timestamps of each
       * of the columns that are read and should pick up columns with the latest
@@ -92,9 +85,16 @@ public class ReadResponseResolver implem
             Message message = entry.getKey();
             if (result.isDigestQuery())
             {
-                if (digest != null)
-                    checkDigest(key, digest, result.digest());
-                digest = result.digest();
+                if (digest == null)
+                {
+                    digest = result.digest();
+                }
+                else
+                {
+                    ByteBuffer digest2 = result.digest();
+                    if (!digest.equals(digest2))
+                        throw new DigestMismatchException(key, digest, digest2);
+                }
             }
             else
             {
@@ -122,7 +122,9 @@ public class ReadResponseResolver implem
             
             for (ColumnFamily cf : versions)
             {
-                checkDigest(key, digest, ColumnFamily.digest(cf));
+                ByteBuffer digest2 = ColumnFamily.digest(cf);
+                if (!digest2.equals(digest))
+                    throw new DigestMismatchException(key, digest, digest2);
             }
             if (logger_.isDebugEnabled())
                 logger_.debug("digests verified");



Mime
View raw message