예제 #1
0
파일: test.py 프로젝트: afoglia/dyschord
 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]
예제 #2
0
파일: test.py 프로젝트: afoglia/dyschord
 def delete(self, key) :
   key_hash = self.__start.hash_key(key)
   node = dyschord.find_node(self.__start, key_hash)
   del node[key]
예제 #3
0
파일: test.py 프로젝트: afoglia/dyschord
 def store(self, key, value) :
   key_hash = self.__start.hash_key(key)
   node = dyschord.find_node(self.__start, key_hash)
   node[key] = value