cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject [2/5] cassandra git commit: Avoid wrapping results with ThriftResultsMerger if command is not for thrift
Date Fri, 15 Jul 2016 22:57:25 GMT
Avoid wrapping results with ThriftResultsMerger if command is not for thrift

Patch by Alex Petrov; reviewed by Tyler Hobbs for CASSANDRA-12193.


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

Branch: refs/heads/trunk
Commit: 557c59607fa9eb2014a7905cfc0eb3dbcd043cab
Parents: 84426d1
Author: Alex Petrov <oleksandr.petrov@gmail.com>
Authored: Fri Jul 15 17:49:16 2016 -0500
Committer: Tyler Hobbs <tylerlhobbs@gmail.com>
Committed: Fri Jul 15 17:49:16 2016 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/ReadResponse.java | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/557c5960/src/java/org/apache/cassandra/db/ReadResponse.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ReadResponse.java b/src/java/org/apache/cassandra/db/ReadResponse.java
index 12a200f..2304cb4 100644
--- a/src/java/org/apache/cassandra/db/ReadResponse.java
+++ b/src/java/org/apache/cassandra/db/ReadResponse.java
@@ -282,12 +282,17 @@ public abstract class ReadResponse
 
                     // Pre-3.0, we didn't have a way to express exclusivity for non-composite
comparators, so all slices were
                     // inclusive on both ends. If we have exclusive slice ends, we need to
filter the results here.
+                    UnfilteredRowIterator iterator;
                     if (!command.metadata().isCompound())
-                        return ThriftResultsMerger.maybeWrap(
-                                filter.filter(partition.sliceableUnfilteredIterator(command.columnFilter(),
filter.isReversed())), command.nowInSec());
-
-                    return ThriftResultsMerger.maybeWrap(
-                            partition.unfilteredIterator(command.columnFilter(), Slices.ALL,
filter.isReversed()), command.nowInSec());
+                        iterator = filter.filter(partition.sliceableUnfilteredIterator(command.columnFilter(),
filter.isReversed()));
+                    else
+                        iterator = partition.unfilteredIterator(command.columnFilter(), Slices.ALL,
filter.isReversed());
+
+                    // Wrap results with a ThriftResultMerger only if they're intended for
the thrift command.
+                    if (command.isForThrift())
+                        return ThriftResultsMerger.maybeWrap(iterator, command.nowInSec());
+                    else
+                        return iterator;
                 }
             };
         }


Mime
View raw message