cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r948934 - in /cassandra/branches/cassandra-0.6: CHANGES.txt src/java/org/apache/cassandra/service/StorageProxy.java src/java/org/apache/cassandra/thrift/CassandraServer.java
Date Thu, 27 May 2010 18:02:08 GMT
Author: jbellis
Date: Thu May 27 18:02:07 2010
New Revision: 948934

URL: http://svn.apache.org/viewvc?rev=948934&view=rev
Log:
fix potential for duplicate rows seen by Hadoop jobs.  patch by jhanna; reviewed by jbellis
for CASSANDRA-1042

Modified:
    cassandra/branches/cassandra-0.6/CHANGES.txt
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageProxy.java
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/CassandraServer.java

Modified: cassandra/branches/cassandra-0.6/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/CHANGES.txt?rev=948934&r1=948933&r2=948934&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.6/CHANGES.txt Thu May 27 18:02:07 2010
@@ -1,5 +1,6 @@
 0.6.3
  * retry to make streaming connections up to 8 times. (CASSANDRA-1019)
+ * fix potential for duplicate rows seen by Hadoop jobs (CASSANDRA-1042)
 
 0.6.2
  * fix contrib/word_count build. (CASSANDRA-992)

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageProxy.java?rev=948934&r1=948933&r2=948934&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageProxy.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageProxy.java
Thu May 27 18:02:07 2010
@@ -609,18 +609,6 @@ public class StorageProxy implements Sto
      */
     private static Iterable<Pair<AbstractBounds, List<InetAddress>>> getRangeIterator(final
List<Pair<AbstractBounds, List<InetAddress>>> ranges, Token start)
     {
-        // sort ranges in ring order
-        Comparator<Pair<AbstractBounds, List<InetAddress>>> comparator
= new Comparator<Pair<AbstractBounds, List<InetAddress>>>()
-        {
-            public int compare(Pair<AbstractBounds, List<InetAddress>> o1, Pair<AbstractBounds,
List<InetAddress>> o2)
-            {
-                // no restricted ranges will overlap so we don't need to worry about inclusive
vs exclusive left,
-                // just sort by raw token position.
-                return o1.left.left.compareTo(o2.left.left);
-            }
-        };
-        Collections.sort(ranges, comparator);
-
         // find the one to start with
         int i;
         for (i = 0; i < ranges.size(); i++)

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/CassandraServer.java?rev=948934&r1=948933&r2=948934&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/CassandraServer.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/CassandraServer.java
Thu May 27 18:02:07 2010
@@ -625,11 +625,12 @@ public class CassandraServer implements 
     public List<TokenRange> describe_ring(String keyspace)
     {
         List<TokenRange> ranges = new ArrayList<TokenRange>();
+        Token.TokenFactory tf = StorageService.getPartitioner().getTokenFactory();
         for (Map.Entry<Range, List<String>> entry : StorageService.instance.getRangeToEndPointMap(keyspace).entrySet())
         {
             Range range = entry.getKey();
             List<String> endpoints = entry.getValue();
-            ranges.add(new TokenRange(range.left.toString(), range.right.toString(), endpoints));
+            ranges.add(new TokenRange(tf.toString(range.left), tf.toString(range.right),
endpoints));
         }
         return ranges;
     }
@@ -641,7 +642,7 @@ public class CassandraServer implements 
         List<String> splits = new ArrayList<String>(tokens.size());
         for (Token token : tokens)
         {
-            splits.add(token.toString());
+            splits.add(tf.toString(token));
         }
         return splits;
     }



Mime
View raw message