def lookup(self, key) : # Can't just use hash because that might differ between Python # implementations. Plus by using a different hash function, we # reduce the changes of collisions in the dictionaries in each node # assuming the algorithms are sufficiently different. And Python's # hashing algorithm is relatively simple, so that's probably the # case. key_hash = self.__start.hash_key(key) node = dyschord.find_node(self.__start, key_hash) return node.data[key]
def delete(self, key) : key_hash = self.__start.hash_key(key) node = dyschord.find_node(self.__start, key_hash) del node[key]
def store(self, key, value) : key_hash = self.__start.hash_key(key) node = dyschord.find_node(self.__start, key_hash) node[key] = value