You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/01/27 06:16:41 UTC

[GitHub] [cassandra] yifan-c commented on a change in pull request #868: CASSANDRA-16385

yifan-c commented on a change in pull request #868:
URL: https://github.com/apache/cassandra/pull/868#discussion_r565048721



##########
File path: src/java/org/apache/cassandra/net/Message.java
##########
@@ -757,7 +757,11 @@ private Header extractHeaderPost40(ByteBuffer buf, InetAddressAndPort from, long
         {
             serializeHeaderPost40(message.header, out, version);
             out.writeUnsignedVInt(message.payloadSize(version));
-            message.verb().serializer().serialize(message.payload, out, version);
+            IVersionedAsymmetricSerializer<T,T> payloadSerializer = message.header.verb.serializer();
+            // per-response serializers are only required for in-jvm dtests for message filtering
+            if (null == payloadSerializer)
+                payloadSerializer = instance().callbacks.get(message.header.id, message.header.from).responseVerb.serializer();

Review comment:
       ```suggestion
                   payloadSerializer = instance().callbacks.responseSerializer(message.header.id, message.header.from);
                   // need to perform null check for the payloadSerializer
   ```
   
   There is an existing API in `RequestCallbacks` that does the same thing. 
   
   The returned `serializer` could be null. Need to check. If null, it should skip ser/deser. Same for the other methods changed in this PR.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org