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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]