Repository: cassandra Updated Branches: refs/heads/trunk d26187e5c -> 85c6b2edb
Fix little endian handling by NIODataInputStream.readVInt() patch by Ariel Weisberg; reviewed by Aleksey Yeschenko for CASSANDRA-9865 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/85c6b2ed Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/85c6b2ed Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/85c6b2ed Branch: refs/heads/trunk Commit: 85c6b2edb82bdc797a47c29a1d4af0ad2739e0f5 Parents: d26187e Author: Ariel Weisberg <ar...@weisberg.ws> Authored: Tue Jul 28 14:15:23 2015 -0400 Committer: Aleksey Yeschenko <alek...@apache.org> Committed: Wed Jul 29 20:03:11 2015 +0300 ---------------------------------------------------------------------- CHANGES.txt | 4 ++-- src/java/org/apache/cassandra/io/util/NIODataInputStream.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/85c6b2ed/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 562fce5..6931701 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -19,8 +19,8 @@ * Change gossip stabilization to use endpoit size (CASSANDRA-9401) * Change default garbage collector to G1 (CASSANDRA-7486) * Populate TokenMetadata early during startup (CASSANDRA-9317) - * undeprecate cache recentHitRate (CASSANDRA-6591) - * Add support for selectively varint encoding fields (CASSANDRA-9499) + * Undeprecate cache recentHitRate (CASSANDRA-6591) + * Add support for selectively varint encoding fields (CASSANDRA-9499, 9865) 2.2.1 http://git-wip-us.apache.org/repos/asf/cassandra/blob/85c6b2ed/src/java/org/apache/cassandra/io/util/NIODataInputStream.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/io/util/NIODataInputStream.java b/src/java/org/apache/cassandra/io/util/NIODataInputStream.java index fbe24be..f6c939a 100644 --- a/src/java/org/apache/cassandra/io/util/NIODataInputStream.java +++ b/src/java/org/apache/cassandra/io/util/NIODataInputStream.java @@ -23,6 +23,7 @@ import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; +import java.nio.ByteOrder; import java.nio.channels.ReadableByteChannel; import java.nio.channels.SeekableByteChannel; @@ -321,6 +322,8 @@ public class NIODataInputStream extends InputStream implements DataInputPlus, Cl int extraBits = extraBytes * 8; long retval = buf.getLong(position); + if (buf.order() == ByteOrder.LITTLE_ENDIAN) + retval = Long.reverseBytes(retval); buf.position(position + extraBytes); // truncate the bytes we read in excess of those we needed