cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sn...@apache.org
Subject [2/9] cassandra git commit: DataOutputBuffer.asNewBuffer broken
Date Tue, 28 Mar 2017 07:48:08 GMT
DataOutputBuffer.asNewBuffer broken

patch by Robert Stupp; reviewed by Stefania for CASSANDRA-13298


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

Branch: refs/heads/trunk
Commit: 62abe46c5efc47812899219f2e38af94c34fa49a
Parents: c0ac928
Author: Robert Stupp <snazy@snazy.de>
Authored: Tue Mar 28 09:32:18 2017 +0200
Committer: Robert Stupp <snazy@snazy.de>
Committed: Tue Mar 28 09:32:18 2017 +0200

----------------------------------------------------------------------
 CHANGES.txt                                                      | 1 +
 src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java | 2 +-
 src/java/org/apache/cassandra/io/util/DataOutputBuffer.java      | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/62abe46c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 98ed992..f3b27be 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.11.0
+ * DataOutputBuffer.asNewBuffer broken (CASSANDRA-13298)
  * unittest CipherFactoryTest failed on MacOS (CASSANDRA-13370)
  * Forbid SELECT restrictions and CREATE INDEX over non-frozen UDT columns (CASSANDRA-13247)
  * Default logging we ship will incorrectly print "?:?" for "%F:%L" pattern (CASSANDRA-13317)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/62abe46c/src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java b/src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java
index b95a310..64d7dd1 100644
--- a/src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java
+++ b/src/java/org/apache/cassandra/db/partitions/PartitionUpdate.java
@@ -274,7 +274,7 @@ public class PartitionUpdate extends AbstractBTreePartition
         try (DataOutputBuffer out = new DataOutputBuffer())
         {
             serializer.serialize(update, out, version);
-            return out.asNewBuffer();
+            return out.buffer();
         }
         catch (IOException e)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/62abe46c/src/java/org/apache/cassandra/io/util/DataOutputBuffer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/DataOutputBuffer.java b/src/java/org/apache/cassandra/io/util/DataOutputBuffer.java
index 63f87ea..144edad 100644
--- a/src/java/org/apache/cassandra/io/util/DataOutputBuffer.java
+++ b/src/java/org/apache/cassandra/io/util/DataOutputBuffer.java
@@ -229,7 +229,7 @@ public class DataOutputBuffer extends BufferedDataOutputStreamPlus
 
     public ByteBuffer asNewBuffer()
     {
-        return ByteBuffer.wrap(getData(), 0, getLength());
+        return ByteBuffer.wrap(toByteArray());
     }
 
     public byte[] toByteArray()


Mime
View raw message