cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject cassandra git commit: Fix ACFIF building of ColumnFamilySplit for non-BO partitioners
Date Fri, 15 May 2015 11:25:21 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 5c54f42ff -> 1644e82f7


Fix ACFIF building of ColumnFamilySplit for non-BO partitioners

patch by Philip Thompson; reviewed by Mike Adamson for CASSANDRA-9381


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

Branch: refs/heads/trunk
Commit: 1644e82f757024df8833668e54cb75e309d9f427
Parents: 5c54f42
Author: Philip Thompson <ptnapoleon@gmail.com>
Authored: Fri May 15 14:22:37 2015 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Fri May 15 14:22:37 2015 +0300

----------------------------------------------------------------------
 .../cassandra/hadoop/AbstractColumnFamilyInputFormat.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1644e82f/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java b/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java
index f37504b..2c04475 100644
--- a/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java
+++ b/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java
@@ -31,7 +31,9 @@ import com.datastax.driver.core.Row;
 import com.datastax.driver.core.Session;
 import com.datastax.driver.core.TokenRange;
 import org.apache.cassandra.db.SystemKeyspace;
+import org.apache.cassandra.dht.ByteOrderedPartitioner;
 import org.apache.cassandra.dht.IPartitioner;
+import org.apache.cassandra.dht.OrderPreservingPartitioner;
 import org.apache.cassandra.dht.Range;
 import org.apache.cassandra.dht.Token;
 import org.apache.cassandra.hadoop.cql3.*;
@@ -200,6 +202,8 @@ public abstract class AbstractColumnFamilyInputFormat<K, Y> extends
InputFormat<
             for (Host endpoint : hosts)
                 endpoints[endpointIndex++] = endpoint.getAddress().getHostName();
 
+            boolean partitionerIsOpp = partitioner instanceof OrderPreservingPartitioner
|| partitioner instanceof ByteOrderedPartitioner;
+
             for (TokenRange subSplit : subSplits.keySet())
             {
                 List<TokenRange> ranges = subSplit.unwrap();
@@ -207,8 +211,10 @@ public abstract class AbstractColumnFamilyInputFormat<K, Y> extends
InputFormat<
                 {
                     ColumnFamilySplit split =
                             new ColumnFamilySplit(
-                                    subrange.getStart().toString().substring(2),
-                                    subrange.getEnd().toString().substring(2),
+                                    partitionerIsOpp ?
+                                            subrange.getStart().toString().substring(2) :
subrange.getStart().toString(),
+                                    partitionerIsOpp ?
+                                            subrange.getEnd().toString().substring(2) : subrange.getStart().toString(),
                                     subSplits.get(subSplit),
                                     endpoints);
 


Mime
View raw message