kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jjko...@apache.org
Subject kafka git commit: KAFKA-2663; Trivial follow-up to edit comments
Date Thu, 29 Oct 2015 19:10:29 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 42bcc4339 -> 0da654761


KAFKA-2663; Trivial follow-up to edit comments


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/0da65476
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/0da65476
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/0da65476

Branch: refs/heads/trunk
Commit: 0da65476175e398378381041232af718321a5829
Parents: 42bcc43
Author: Joel Koshy <jjkoshy@gmail.com>
Authored: Thu Oct 29 12:07:43 2015 -0700
Committer: Joel Koshy <jjkoshy@gmail.com>
Committed: Thu Oct 29 12:07:43 2015 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/network/RequestChannel.scala | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/0da65476/core/src/main/scala/kafka/network/RequestChannel.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/network/RequestChannel.scala b/core/src/main/scala/kafka/network/RequestChannel.scala
index 6af62c7..9fce77e 100644
--- a/core/src/main/scala/kafka/network/RequestChannel.scala
+++ b/core/src/main/scala/kafka/network/RequestChannel.scala
@@ -49,6 +49,8 @@ object RequestChannel extends Logging {
   case class Session(principal: KafkaPrincipal, host: String)
 
   case class Request(processor: Int, connectionId: String, session: Session, private var
buffer: ByteBuffer, startTimeMs: Long, securityProtocol: SecurityProtocol) {
+    // These need to be volatile because the readers are in the network thread and the writers
are in the request
+    // handler threads or the purgatory threads
     @volatile var requestDequeueTimeMs = -1L
     @volatile var apiLocalCompleteTimeMs = -1L
     @volatile var responseCompleteTimeMs = -1L
@@ -96,7 +98,8 @@ object RequestChannel extends Logging {
       // see a negative value here. In that case, use responseCompleteTimeMs as apiLocalCompleteTimeMs.
       if (apiLocalCompleteTimeMs < 0)
         apiLocalCompleteTimeMs = responseCompleteTimeMs
-      // If the apiRemoteCompleteTimeMs is not set, then it is the same as responseCompleteTimeMs.
+      // If the apiRemoteCompleteTimeMs is not set (i.e., for requests that do not go through
a purgatory), then it is
+      // the same as responseCompleteTimeMs.
       if (apiRemoteCompleteTimeMs < 0)
         apiRemoteCompleteTimeMs = responseCompleteTimeMs
 
@@ -244,7 +247,7 @@ class RequestMetrics(name: String) extends KafkaMetricsGroup {
   val requestQueueTimeHist = newHistogram("RequestQueueTimeMs", biased = true, tags)
   // time a request takes to be processed at the local broker
   val localTimeHist = newHistogram("LocalTimeMs", biased = true, tags)
-  // time a request takes to wait on remote brokers (only relevant to fetch and produce requests)
+  // time a request takes to wait on remote brokers (currently only relevant to fetch and
produce requests)
   val remoteTimeHist = newHistogram("RemoteTimeMs", biased = true, tags)
   // time a request is throttled (only relevant to fetch and produce requests)
   val throttleTimeHist = newHistogram("ThrottleTimeMs", biased = true, tags)


Mime
View raw message