I think eventually the FakeRing behavior got dropped in I8bfc388a04eff6491038991cdfd7686c9d961545
But the comment remains:
class FakeRing(Ring):
def __init__(self, replicas=3, max_more_nodes=0, part_power=0, base_port=1000):
"""
:param part_power: make part calculation based on the path
If you set a part_power when you setup your FakeRing the parts you get
out of ring methods will actually be based on the path - otherwise we exercise the real ring code, but ignore the result and return 1.
""" self._base_port = base_port self.max_more_nodes = max_more_nodes self._part_shift = 32 - part_power
# 9 total nodes (6 more past the initial 3) is the cap, no matter if
# this is set higher, or R^2 for R replicas self.set_replicas(replicas) self._reload()
All that jazz about part power and doing something trixy in _get_parts should be pulled out.
This is related to the fix for lp bug #1335581
I think eventually the FakeRing behavior got dropped in I8bfc388a04eff6 491038991cdfd76 86c9d961545
But the comment remains:
class FakeRing(Ring):
def __init__(self, replicas=3, max_more_nodes=0, part_power=0,
base_port= 1000):
"""
:param part_power: make part calculation based on the path
If you set a part_power when you setup your FakeRing the parts you get
exercise the real ring code, but ignore the result and return 1.
self. _base_port = base_port
self. max_more_ nodes = max_more_nodes
self. _part_shift = 32 - part_power
self. set_replicas( replicas)
self. _reload( )
out of ring methods will actually be based on the path - otherwise we
"""
# 9 total nodes (6 more past the initial 3) is the cap, no matter if
# this is set higher, or R^2 for R replicas
All that jazz about part power and doing something trixy in _get_parts should be pulled out.