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

    https://github.com/apache/storm/pull/705#discussion_r41186998
  
    --- Diff: external/storm-kafka/src/jvm/storm/kafka/KafkaSpout.java ---
    @@ -43,19 +42,19 @@ public MessageAndRealOffset(Message msg, long offset) {
             }
         }
     
    -    static enum EmitState {
    +    enum EmitState {
             EMITTED_MORE_LEFT,
             EMITTED_END,
             NO_EMITTED
         }
     
    -    public static final Logger LOG = 
LoggerFactory.getLogger(KafkaSpout.class);
    +    private static final Logger LOG = 
LoggerFactory.getLogger(KafkaSpout.class);
     
         SpoutConfig _spoutConfig;
         SpoutOutputCollector _collector;
         PartitionCoordinator _coordinator;
         DynamicPartitionConnections _connections;
    -    ZkState _state;
    +    PartitionStateManagerFactory _partitionStateManagerFactory;
    --- End diff --
    
    instead of a factory, you can make the developer declare the StateStore:
    ```
    public void createTopology() {
        Spout spout = new KafkaSpout(..., new KafkaStateStore(...));
    ...
    }
    ```
    
    This should keep the KafkaSpout code much simpler and more explicit, and 
eliminate the need for a factory.


---
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