@@ -0,0 +1,1598 @@
+'''%0A- a way to separate entries by key to know which machine to store it at%0A- eviction strategy:%0A* FIFO%0A* LRU%0A* LFU%0A- access pattern:%0A* write-thru%0A* write-around%0A* write-back%0A- latency vs consistency vs availability%0A- how would multithreading work? locks?%0A- collision resolution method%0A- resizing%0A* consistent hashing%0A* HRW (Rendezvous) hashing%0A'''%0Aclass DHash(object):%0A%09def __init__(self, config=%7B%7D):%0A%09%09if not config:%0A%09%09%09config = %7B%0A%09%09%09%09'size': 1024,%0A%09%09%09%09'resizing_method': 'consistent-hashing',%0A%09%09%09%09'access_pattern': 'write-around',%0A%09%09%09%09'evection_strategy': 'LRU'%0A%09%09%09%7D%0A%09%09self.size = config%5B'size'%5D%0A%09%09self.resizing_method = config%5B'resizing_method'%5D%0A%09%09self.access_pattern = config%5B'access_pattern'%5D%0A%0A%09def read(self, key):%0A%09%09pass%0A%0A%09def write(self, key, value):%0A%09%09pass%0A%0Aclass MockNode(object):%0A%09%22%22%22Implement a node. %0A%0A%09Node will run in a separate thread and emulate a separate machine.%0A%09%22%22%22%0A%09pass%0A%0Aclass MockDB(object):%0A%09%22%22%22Emulate database via file read/write.%22%22%22%0A%09pass%0A%0Aclass WriteThru(object):%0A%09%22%22%22Implement write-thru access pattern.%22%22%22%0A%09pass%0A%0Aclass WriteAround(object):%0A%09%22%22%22Implement write-around access pattern.%22%22%22%0A%09pass%0A%0Aclass WriteBack(object):%0A%09%22%22%22Implement write-back access pattern.%22%22%22%0A%09pass%0A%0Aclass LRU(object):%0A%09%22%22%22Implement Least-Recently-Used eviction strategy.%22%22%22%0A%09pass%0A%0Aclass LFU(object):%0A%09%22%22%22Implement Least-Frequently-Used eviction strategy.%22%22%22%0A%09pass%0A%0Aclass ConsistentHashRing(object):%0A    %22%22%22Implement a consistent hashing ring.%22%22%22%0A    pass%0A%0Aclass RendezvousHashing(object):%0A%09%22%22%22Implement Highest Random Weight hashing method.%22%22%22%0A%09pass%0A%0Aif __name__ == '__main__':%0A%09dhash = DHash()%0A

Add basic config functionality and stubs for MockNode, MockDB, as well as different resizing methods, access patterns and eviction strategies.