Github user choang commented on the pull request:

    https://github.com/apache/storm/pull/705#issuecomment-143655914
  
    I recommend making your abstraction at the state store, so you would have:
    ```
    public interface StateStore {
      public void write(Partition p, long offset);
      public long read(Partition p);
    }
    
    public class ZkStateStore implements StateStore {
    ...
    }
    
    public class KafkaStateStore implements StateStore {
    ...
    }
    
    /**
    Some topologies read from LATEST after a restart, so only memory state is 
needed.
    */
    public class MemoryStateStore implements StateStore {
    ...
    }
    ```
    
    You would not need different PartitionStateManager for different stores.  
You would just have:
    ```
    public class PartitionStateManager {
        public PartitionStateManager (..., StateStore store) { ... }
        public void writeState(...) {
            store.write(...);
        }
    }
    ```


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