mynameborat commented on a change in pull request #951: SAMZA-2127: Upgrade to 
Kafka 2.0
URL: https://github.com/apache/samza/pull/951#discussion_r268772818
 
 

 ##########
 File path: 
samza-test/src/test/scala/org/apache/samza/test/integration/StreamTaskTestUtil.scala
 ##########
 @@ -133,43 +130,36 @@ object StreamTaskTestUtil {
     config.put(ProducerConfig.LINGER_MS_CONFIG, "0")
     val producerConfig = new KafkaProducerConfig("kafka", "i001", config)
 
+    adminClient = AdminClient.create(config.asInstanceOf[util.Map[String, 
Object]])
     producer = new KafkaProducer[Array[Byte], 
Array[Byte]](producerConfig.getProducerProperties)
 
     createTopics
     validateTopics
   }
 
   def createTopics {
-    AdminUtils.createTopic(
-      zkUtils,
-      INPUT_TOPIC,
-      TOTAL_TASK_NAMES,
-      REPLICATION_FACTOR)
+    adminClient.createTopics(Collections.singleton(new NewTopic(INPUT_TOPIC, 
TOTAL_TASK_NAMES, REPLICATION_FACTOR.shortValue())))
   }
 
   def validateTopics {
 
 Review comment:
   It is doable and I considered it. I deferred it due to following
   
   1. I didn't want to add more churn to scala code. StreamTaskTestUtil still 
uses some of the TestUtils deprecated code and I chose to clean up all at once 
as a separate PR (maybe rewrite them in java)
   2. I didn't want to expand the scope of this PR.
   
   I have created a follow up ticket 
(https://issues.apache.org/jira/browse/SAMZA-2145) to clean up the test and 
consolidate the common code to some helper or move it to test harness. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to