cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobrown <...@git.apache.org>
Subject [GitHub] cassandra pull request #253: 13630
Date Sat, 08 Sep 2018 02:48:53 GMT
Github user jasobrown commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/253#discussion_r216118578
  
    --- 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 --
    
    Yes. Further, this method is basically taken verbatim from 3.11's [OutboundTcpConnection.writeConnected()](https://github.com/apache/cassandra/blob/cassandra-3.11/src/java/org/apache/cassandra/net/OutboundTcpConnection.java#L312)
method.


---

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


Mime
View raw message