cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] jolynch commented on a change in pull request #283: CASSANDRA-14459: DynamicEndpointSnitch should never prefer latent replicas
Date Tue, 29 Jan 2019 02:16:04 GMT
jolynch commented on a change in pull request #283: CASSANDRA-14459: DynamicEndpointSnitch
should never prefer latent replicas
URL: https://github.com/apache/cassandra/pull/283#discussion_r251669470
 
 

 ##########
 File path: src/java/org/apache/cassandra/net/MessagingService.java
 ##########
 @@ -729,20 +730,26 @@ void markTimeout(InetAddressAndPort addr)
     /**
      * Track latency information for the dynamic snitch
      *
-     * @param cb      the callback associated with this message -- this lets us know if it's
a message type we're interested in
-     * @param address the host that replied to the message
-     * @param latency
+     * @param cb            the callback associated with this message -- this lets us know
if it's a message type we're interested in
+     * @param address       the host that replied to the message
+     * @param latencyMicros the number of microseconds to record for this host
      */
-    public void maybeAddLatency(IAsyncCallback cb, InetAddressAndPort address, long latency)
+    public void maybeAddLatency(IAsyncCallback cb, InetAddressAndPort address, long latencyMicros)
     {
-        if (cb.isLatencyForSnitch())
-            addLatency(address, latency);
+        if (cb.latencyMeasurementType() != LatencyMeasurementType.IGNORE)
+            addLatency(address, latencyMicros, cb.latencyMeasurementType());
     }
 
-    public void addLatency(InetAddressAndPort address, long latency)
+    // Used on the local read path
+    public void addLatency(InetAddressAndPort address, long latencyMicros)
+    {
+        addLatency(address, latencyMicros, LatencyMeasurementType.READ);
+    }
+
+    private void addLatency(InetAddressAndPort address, long latencyMicros, LatencyMeasurementType
usable)
 
 Review comment:
   ack, re-named to `latencyMeasurementType`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

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


Mime
View raw message