Github user choang commented on a diff in the pull request:

    https://github.com/apache/storm/pull/705#discussion_r41323220
  
    --- Diff: external/storm-kafka/src/jvm/storm/kafka/KafkaStateStore.java ---
    @@ -0,0 +1,220 @@
    +package storm.kafka;
    +
    +import com.google.common.collect.Maps;
    +import kafka.api.ConsumerMetadataRequest;
    +import kafka.common.ErrorMapping;
    +import kafka.common.OffsetAndMetadata;
    +import kafka.common.OffsetMetadataAndError;
    +import kafka.common.TopicAndPartition;
    +import kafka.javaapi.*;
    +import kafka.network.BlockingChannel;
    +import org.json.simple.JSONValue;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +import java.util.Map;
    +
    +public class KafkaStateStore implements StateStore {
    +    private static final Logger LOG = 
LoggerFactory.getLogger(KafkaStateStore.class);
    +
    +    private SpoutConfig _spoutConfig;
    +
    +    private int _correlationId = 0;
    +    // https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java
    +    private volatile BlockingChannel _offsetManager;
    +
    +    public KafkaStateStore(Map stormConf, SpoutConfig spoutConfig) {
    --- End diff --
    
    <tt>stormConf</tt> isn't used so remove.  By using <tt>spoutConfig</tt>, 
you are bleeding the spout state into the store.  I understand it is for 
convenience, but using explicit would be better, so perhaps you can create a 
<tt>KafkaStoreConfig</tt>.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to