Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # dev >> Review Request 23266: Fix KAFKA-1515


Copy link to this message
-
Re: Review Request 23266: Fix KAFKA-1515

This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23266/#review47334

clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
<https://reviews.apache.org/r/23266/#comment83089>

    Is there a race condition here? What if the sender immediately executes and the flag isn't set yet?
    
    Maybe the usage needs to be something like
      long version = metadata.version()
      metadata.requestUpdate()
      sender.wakeup()
      metadata.awaitUpdate(version)
    
    The version would just be a long counter that we increment in Metadata.update().

clients/src/main/java/org/apache/kafka/clients/producer/internals/Metadata.java
<https://reviews.apache.org/r/23266/#comment83087>

    This method seems a bit ad hoc. Would it better to just have the caller directly do
      metadata.fetch().partitionsForTopic != null?
    or if we want to make it a little more readable, add a .hasTopic method to Cluster and do
      metadata.fetch().hasTopic(t)

clients/src/main/java/org/apache/kafka/clients/producer/internals/Metadata.java
<https://reviews.apache.org/r/23266/#comment83086>

    All the java apis that wait with some timeout take a max wait duration not an end millisecond timestamp. Would that be better?

clients/src/main/java/org/apache/kafka/clients/producer/internals/Metadata.java
<https://reviews.apache.org/r/23266/#comment83088>

    Not sure about this logic. Imagine that the last refresh was an hour ago and the original max wait time was 30 secs. How long does this wait?
- Jay Kreps
On July 3, 2014, 11:42 p.m., Guozhang Wang wrote: