Repository: cassandra
Updated Branches:
  refs/heads/trunk 1f65a12c3 -> d383f5cb2


Force ByteBuffer big-endianness in IndexSummary binary search

Patch by Sam Tunnicliffe; reviewed by Benedict Elliot Smith for
CASSANDRA-9062


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

Branch: refs/heads/trunk
Commit: d383f5cb2bee8b04c3ad8f8c740b232ef7a883e2
Parents: 1f65a12
Author: Sam Tunnicliffe <[email protected]>
Authored: Tue Apr 14 16:31:32 2015 -0500
Committer: Tyler Hobbs <[email protected]>
Committed: Tue Apr 14 16:31:32 2015 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/io/sstable/IndexSummary.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d383f5cb/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/IndexSummary.java 
b/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
index eed0dfd..fbefe13 100644
--- a/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
+++ b/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
@@ -107,7 +107,8 @@ public class IndexSummary extends WrappedSharedCloseable
     // Harmony's Collections implementation
     public int binarySearch(RowPosition key)
     {
-        ByteBuffer hollow = MemoryUtil.getHollowDirectByteBuffer();
+        // We will be comparing non-native Keys, so use a buffer with 
appropriate byte order
+        ByteBuffer hollow = 
MemoryUtil.getHollowDirectByteBuffer().order(ByteOrder.BIG_ENDIAN);
         int low = 0, mid = offsetCount, high = mid - 1, result = -1;
         while (low <= high)
         {

Reply via email to