Currently, the BagOStuff class has a lot of methods that are tricky to implement outside of a single-DC cluster instance, for example incr(), lock(), add(), merge(), and so on. By splitting out some interfaces, it becomes possible to better map caching interfaces to storage mediums. For example, RESTBagOStuff would not have to have a bunch of broken "don't actually use this for this subclass" methods, but could rather implement only methods that make sense.
Proposed interfaces are:
- KeyValueStore: Basic set/get methods. This is useful for backends that cannot implement mixed read/write methods efficiently, e.g. add(), merge(), incr(), changeTTL().
- MergeableKeyValueStore: This defines add() and merge() methods as well as a new consume() method, which is a better an alternative to changeTTL() for token claiming (e.g. OAuth/CentralAuth).
- AdvancedKeyValueStore: This defines incr(), decr(), incrWithInit(), changeTTL(), changeTTLMulti(), lock(), unlock(), and getScopedLock().