belliottsmith commented on code in PR #1951:
URL: https://github.com/apache/cassandra/pull/1951#discussion_r1014287256


##########
src/java/org/apache/cassandra/service/accord/db/AccordUpdate.java:
##########
@@ -867,27 +913,26 @@ public AccordUpdate deserialize(DataInputPlus in, int 
version) throws IOExceptio
         public long serializedSize(AccordUpdate update, int version)
         {
             long size = KeySerializers.keys.serializedSize(update.keys, 
version);
-
-            size += TypeSizes.sizeof(update.updates.length);
             for (ByteBuffer buffer : update.updates)
                 size += ByteBufferUtil.serializedSizeWithVIntLength(buffer);
-
-            size += TypeSizes.sizeof(update.predicates.length);
             for (ByteBuffer buffer : update.predicates)
                 size += ByteBufferUtil.serializedSizeWithVIntLength(buffer);
-
             return size;
         }
     };
 
-    private static <T> ByteBuffer serialize(T item, IVersionedSerializer<T> 
serializer)
+    private static <T> ByteBuffer serialize(List<T> items, int start, int end, 
IVersionedSerializer<T> serializer, int version)
     {
-        int version = MessagingService.current_version;
-        long size = serializer.serializedSize(item, version) + 
TypeSizes.INT_SIZE;
+        long size = TypeSizes.sizeofUnsignedVInt(version) + 
TypeSizes.sizeofUnsignedVInt(end - start);

Review Comment:
   Sure, though in downgrading from 4 to variable I decided not to semantically 
change the flexibility.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to