cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [3/9] git commit: inline
Date Sat, 22 Mar 2014 02:52:17 GMT
inline


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e682c037
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e682c037
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e682c037

Branch: refs/heads/trunk
Commit: e682c0370e68af75779bf2b0cd1622fce6e03eab
Parents: 37b9410
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Mar 21 16:55:36 2014 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Mar 21 21:49:27 2014 -0500

----------------------------------------------------------------------
 .../apache/cassandra/service/ReadCallback.java    | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e682c037/src/java/org/apache/cassandra/service/ReadCallback.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/ReadCallback.java b/src/java/org/apache/cassandra/service/ReadCallback.java
index 777ef90..085787c 100644
--- a/src/java/org/apache/cassandra/service/ReadCallback.java
+++ b/src/java/org/apache/cassandra/service/ReadCallback.java
@@ -114,7 +114,10 @@ public class ReadCallback<TMessage, TResolved> implements IAsyncCallback<TMessag
         if (n >= blockfor && resolver.isDataPresent())
         {
             condition.signalAll();
-            maybeResolveForRepair(n);
+            // kick off a background digest comparison if this is a result that (may have)
arrived after
+            // the original resolve that get() kicks off as soon as the condition is signaled
+            if (blockfor < endpoints.size() && n == endpoints.size())
+                StageManager.getStage(Stage.READ_REPAIR).execute(new AsyncRepairRunner());
         }
     }
 
@@ -146,19 +149,6 @@ public class ReadCallback<TMessage, TResolved> implements IAsyncCallback<TMessag
         response(message);
     }
 
-    /**
-     * Check digests in the background on the Repair stage if we've received replies
-     * to all the requests we sent.
-     */
-    protected void maybeResolveForRepair(int n)
-    {
-        if (blockfor < endpoints.size() && n == endpoints.size())
-        {
-            assert resolver.isDataPresent();
-            StageManager.getStage(Stage.READ_REPAIR).execute(new AsyncRepairRunner());
-        }
-    }
-
     public void assureSufficientLiveNodes() throws UnavailableException
     {
         consistencyLevel.assureSufficientLiveNodes(keyspace, endpoints);


Mime
View raw message