示例#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