cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1028256 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/HintedHandOffManager.java
Date Thu, 28 Oct 2010 10:50:47 GMT
Author: jbellis
Date: Thu Oct 28 10:50:46 2010
New Revision: 1028256

URL: http://svn.apache.org/viewvc?rev=1028256&view=rev
Log:
fix post-ByteBuffer hint delivery.  patch by Sylvain Lebresne; reviewed by jbellis for CASSANDRA-1672

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/HintedHandOffManager.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/HintedHandOffManager.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/HintedHandOffManager.java?rev=1028256&r1=1028255&r2=1028256&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/HintedHandOffManager.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/HintedHandOffManager.java
Thu Oct 28 10:50:46 2010
@@ -175,9 +175,9 @@ public class HintedHandOffManager
     private static String[] getTableAndCFNames(ByteBuffer joined)
     {
         int index;
-        index = ArrayUtils.lastIndexOf(joined.array(), SEPARATOR.getBytes()[0],joined.position()+joined.arrayOffset());
-        if (index < 1)
-            throw new RuntimeException("Corrupted hint name " + joined.toString());
+        index = ArrayUtils.lastIndexOf(joined.array(), SEPARATOR.getBytes()[0],joined.limit()+joined.arrayOffset());
+        if (index == -1 || index < (joined.position() + joined.arrayOffset() + 1))
+            throw new RuntimeException("Corrupted hint name " + new String(joined.array(),
joined.arrayOffset() + joined.position(), joined.remaining()));
         String[] parts = new String[2];
         parts[0] = new String(ArrayUtils.subarray(joined.array(), joined.position()+joined.arrayOffset(),
index));
         parts[1] = new String(ArrayUtils.subarray(joined.array(), index+1, joined.limit()+joined.arrayOffset()));



Mime
View raw message