kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [1/3] kafka git commit: MINOR: Consolidate broker request/response handling
Date Fri, 25 Aug 2017 17:25:35 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 05e3850b2 -> c4d629a0b


http://git-wip-us.apache.org/repos/asf/kafka/blob/c4d629a0/core/src/test/scala/unit/kafka/server/RequestQuotaTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/server/RequestQuotaTest.scala b/core/src/test/scala/unit/kafka/server/RequestQuotaTest.scala
index 4b33dcb..aadb4d2 100644
--- a/core/src/test/scala/unit/kafka/server/RequestQuotaTest.scala
+++ b/core/src/test/scala/unit/kafka/server/RequestQuotaTest.scala
@@ -298,7 +298,7 @@ class RequestQuotaTest extends BaseRequestTest {
   private def requestResponse(socket: Socket, clientId: String, correlationId: Int, requestBuilder:
AbstractRequest.Builder[_ <: AbstractRequest]): Struct = {
     val apiKey = requestBuilder.apiKey
     val request = requestBuilder.build()
-    val header = new RequestHeader(apiKey.id, request.version, clientId, correlationId)
+    val header = new RequestHeader(apiKey, request.version, clientId, correlationId)
     val response = requestAndReceive(socket, request.serialize(header).array)
     val responseBuffer = skipResponseHeader(response)
     apiKey.parseResponse(request.version, responseBuffer)
@@ -326,7 +326,7 @@ class RequestQuotaTest extends BaseRequestTest {
     override def toString: String = {
       val requestTime = requestTimeMetricValue(clientId)
       val throttleTime = throttleTimeMetricValue(clientId)
-      s"Client $clientId apiKey ${apiKey} requests $correlationId requestTime $requestTime
throttleTime $throttleTime"
+      s"Client $clientId apiKey $apiKey requests $correlationId requestTime $requestTime
throttleTime $throttleTime"
     }
   }
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/c4d629a0/core/src/test/scala/unit/kafka/utils/IteratorTemplateTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/utils/IteratorTemplateTest.scala b/core/src/test/scala/unit/kafka/utils/IteratorTemplateTest.scala
index 6a40510..67e64d5 100644
--- a/core/src/test/scala/unit/kafka/utils/IteratorTemplateTest.scala
+++ b/core/src/test/scala/unit/kafka/utils/IteratorTemplateTest.scala
@@ -18,7 +18,7 @@ package kafka.utils
 
 import org.junit.Assert._
 import org.scalatest.Assertions
-import org.junit.{Test, After, Before}
+import org.junit.Test
 
 class IteratorTemplateTest extends Assertions {
   

http://git-wip-us.apache.org/repos/asf/kafka/blob/c4d629a0/core/src/test/scala/unit/kafka/utils/timer/TimerTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/utils/timer/TimerTest.scala b/core/src/test/scala/unit/kafka/utils/timer/TimerTest.scala
index 54b73b8..e25a5cb 100644
--- a/core/src/test/scala/unit/kafka/utils/timer/TimerTest.scala
+++ b/core/src/test/scala/unit/kafka/utils/timer/TimerTest.scala
@@ -16,14 +16,13 @@
  */
 package kafka.utils.timer
 
-import java.util.concurrent.{CountDownLatch, ExecutorService, Executors, TimeUnit}
+import java.util.concurrent.{CountDownLatch, TimeUnit}
 
 import org.junit.Assert._
 import java.util.concurrent.atomic._
 import org.junit.{Test, After, Before}
 
 import scala.collection.mutable.ArrayBuffer
-import scala.util.Random
 
 class TimerTest {
 


Mime
View raw message