Class InMemoryStoragePartition


  • public class InMemoryStoragePartition
    extends AbstractStoragePartition
    An in-memory hashmap implementation of a storage partition Assumptions: 1.No need to worry about synchronizing write/deletes as the model is based on a single writer. So all updates are already serialized. 2. Concurrent reads may be stale if writes/deletes are going on. But the consistency model is also designed to be eventual. Since "read your own writes semantics" is not guaranteed this eventual consistency is tolerable. Even though there will be one writer and 1 or more readers, we may still need a concurrentHashMap to avoid ConcurrentModicfictionException thrown from the iterators