cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [2/2] cassandra git commit: Use vints in ReadResponse too
Date Fri, 24 Jul 2015 12:47:38 GMT
Use vints in ReadResponse too


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

Branch: refs/heads/9801
Commit: 11ab7f9bcb956d6fd2f7ed1f12d3eec894b8a3e5
Parents: 881fbd7
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Fri Jul 24 13:27:41 2015 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri Jul 24 14:45:16 2015 +0200

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/ReadResponse.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/11ab7f9b/src/java/org/apache/cassandra/db/ReadResponse.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ReadResponse.java b/src/java/org/apache/cassandra/db/ReadResponse.java
index 740423a..7488409 100644
--- a/src/java/org/apache/cassandra/db/ReadResponse.java
+++ b/src/java/org/apache/cassandra/db/ReadResponse.java
@@ -165,14 +165,14 @@ public abstract class ReadResponse
             }
 
             boolean isDigest = response.isDigestQuery();
-            ByteBufferUtil.writeWithShortLength(isDigest ? response.digest(response.metadata)
: ByteBufferUtil.EMPTY_BYTE_BUFFER, out);
+            ByteBufferUtil.writeWithVIntLength(isDigest ? response.digest(response.metadata)
: ByteBufferUtil.EMPTY_BYTE_BUFFER, out);
             if (!isDigest)
             {
                 // Note that we can only get there if version == 3.0, which is the current_version.
When we'll change the
                 // version, we'll have to deserialize/re-serialize the data to be in the
proper version.
                 assert version == MessagingService.VERSION_30;
                 ByteBuffer data = ((DataResponse)response).data;
-                ByteBufferUtil.writeWithLength(data, out);
+                ByteBufferUtil.writeWithVIntLength(data, out);
             }
         }
 
@@ -184,12 +184,12 @@ public abstract class ReadResponse
                 throw new UnsupportedOperationException();
             }
 
-            ByteBuffer digest = ByteBufferUtil.readWithShortLength(in);
+            ByteBuffer digest = ByteBufferUtil.readWithVIntLength(in);
             if (digest.hasRemaining())
                 return new DigestResponse(digest);
 
             assert version == MessagingService.VERSION_30;
-            ByteBuffer data = ByteBufferUtil.readWithLength(in);
+            ByteBuffer data = ByteBufferUtil.readWithVIntLength(in);
             return new DataResponse(data);
         }
 
@@ -202,7 +202,7 @@ public abstract class ReadResponse
             }
 
             boolean isDigest = response.isDigestQuery();
-            long size = ByteBufferUtil.serializedSizeWithShortLength(isDigest ? response.digest(response.metadata)
: ByteBufferUtil.EMPTY_BYTE_BUFFER);
+            long size = ByteBufferUtil.serializedSizeWithVIntLength(isDigest ? response.digest(response.metadata)
: ByteBufferUtil.EMPTY_BYTE_BUFFER);
 
             if (!isDigest)
             {
@@ -210,7 +210,7 @@ public abstract class ReadResponse
                 // version, we'll have to deserialize/re-serialize the data to be in the
proper version.
                 assert version == MessagingService.VERSION_30;
                 ByteBuffer data = ((DataResponse)response).data;
-                size += ByteBufferUtil.serializedSizeWithLength(data);
+                size += ByteBufferUtil.serializedSizeWithVIntLength(data);
             }
             return size;
         }


Mime
View raw message