spacelee
unread,Aug 27, 2009, 9:02:42 AM8/27/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to LightCloud
Your comment:
i have tested lightcloud recently, and for some purposes, i rewrite
the hashring and lightcloud in php, but during the time, some problems
puzzled me
when you add many lookup and storage nodes at the same time, in
theory, the code "if lookups > 2 return None" will make the get can't
find the existed data...although the coincidence is very low...
--------------------------------------------
def locate_node(key, system='default'):
"""Locates a node in the lookup ring, returning its storage node
or `None` if the storage node isn't found.
"""
nodes = get_lookup_ring(system).iterate_nodes(key)
#print nodes
for lookups, node in enumerate(nodes):
if lookups > 2:
return None
value = node.get(key)
if value:
break
if not value:
return None
if lookups == 0:
#print '_clean_up_ringfor %s' % (value)
return get_storage_node(value, system)
else:
print '_clean_up_ringfor %s' % (key)
return _clean_up_ring(key, value, system)