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

Switch to Threaded View
Kafka >> mail # dev >> Review Request 18740: Fix KAFKA-1286


Copy link to this message
-
Re: Review Request 18740: Fix KAFKA-1286

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

clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
<https://reviews.apache.org/r/18740/#comment67115>

    Can this be folded into the if statement below?

clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java
<https://reviews.apache.org/r/18740/#comment67114>

    Is this supposed to be here?

clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java
<https://reviews.apache.org/r/18740/#comment67113>

    I think this may be incorrect if the apikey enums are ever out of order or if we retire a key.
    
    Recommend instead the slightly more verbose:
    private static final ApiKey[] codeToType;
    static {
     int maxKey = -1;
     for(ApiKeys key: ApiKeys.values())
       maxKey = Math.max(maxKey, key.id);
     codeToType = new ApiKey[maxKey];
     for(ApiKey key: ApiKey.values())
       codeToType[key.id] = key;
    }
- Jay Kreps
On March 4, 2014, 11:15 p.m., Guozhang Wang wrote: