Github user dineshjoshi commented on a diff in the pull request:
https://github.com/apache/cassandra/pull/253#discussion_r216106796
--- Diff: src/java/org/apache/cassandra/net/MessageOut.java ---
@@ -180,6 +199,73 @@ public String toString()
return sbuf.toString();
}
+ /**
+ * The main entry point for sending an internode message to a peer node in the cluster.
+ */
+ public void serialize(DataOutputPlus out, int messagingVersion, OutboundConnectionIdentifier
destinationId, int id, long timestampNanos) throws IOException
+ {
+ captureTracingInfo(destinationId);
+
+ out.writeInt(MessagingService.PROTOCOL_MAGIC);
+ out.writeInt(id);
+
+ // int cast cuts off the high-order half of the timestamp, which we can assume
remains
+ // the same between now and when the recipient reconstructs it.
+ out.writeInt((int) NanoTimeToCurrentTimeMillis.convert(timestampNanos));
+ serialize(out, messagingVersion);
+ }
+
+ /**
+ * Record any tracing data, if enabled on this message.
+ */
+ @VisibleForTesting
+ void captureTracingInfo(OutboundConnectionIdentifier destinationId)
+ {
+ try
+ {
+ UUID sessionId = (UUID)getParameter(ParameterType.TRACE_SESSION);
+ if (sessionId != null)
--- End diff --
I assume `sessionId != null` means that tracing is enabled? Otherwise we should explicitly
check whether tracing is enabled.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
|