cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [4/8] cassandra git commit: Fix regression of CASSANDRA-7392
Date Thu, 07 Jan 2016 21:19:39 GMT
Fix regression of CASSANDRA-7392

patch by blambov; reviewed by yukim for CASSANDRA-10951


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

Branch: refs/heads/trunk
Commit: 3c6dfa4aa0b9ffb0a48a02b949bff2a8406764e6
Parents: aeaa501
Author: Branimir Lambov <branimir.lambov@datastax.com>
Authored: Thu Jan 7 15:16:26 2016 -0600
Committer: Yuki Morishita <yukim@apache.org>
Committed: Thu Jan 7 15:16:26 2016 -0600

----------------------------------------------------------------------
 .../org/apache/cassandra/db/ReadCommand.java    | 21 ++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3c6dfa4a/src/java/org/apache/cassandra/db/ReadCommand.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ReadCommand.java b/src/java/org/apache/cassandra/db/ReadCommand.java
index 959085b..90372dd 100644
--- a/src/java/org/apache/cassandra/db/ReadCommand.java
+++ b/src/java/org/apache/cassandra/db/ReadCommand.java
@@ -479,23 +479,32 @@ public abstract class ReadCommand extends MonitorableImpl implements
ReadQuery
     {
         protected BaseRowIterator<?> applyToPartition(BaseRowIterator partition)
         {
-            maybeAbort();
+            if (maybeAbort())
+            {
+                partition.close();
+                return null;
+            }
+
             return partition;
         }
 
         protected Row applyToRow(Row row)
         {
-            maybeAbort();
-            return row;
+            return maybeAbort() ? null : row;
         }
 
-        private void maybeAbort()
+        private boolean maybeAbort()
         {
+            if (TEST_ITERATION_DELAY_MILLIS > 0)
+                maybeDelayForTesting();
+
             if (isAborted())
+            {
                 stop();
+                return true;
+            }
 
-            if (TEST_ITERATION_DELAY_MILLIS > 0)
-                maybeDelayForTesting();
+            return false;
         }
     }
 


Mime
View raw message