(NUM_SEGMENTS-1)*segsize, len(data), NUM_SEGMENTS*segsize)
shareholders = {}
+ servermap = {}
for shnum in range(NUM_SHARES):
peer = FakeBucketReaderWriterProxy()
shareholders[shnum] = peer
+ servermap[shnum] = str(shnum)
all_shareholders.append(peer)
- e.set_shareholders(shareholders)
+ e.set_shareholders(shareholders, servermap)
return e.start()
d.addCallback(_ready)
def _ready(res):
k,happy,n = e.get_param("share_counts")
assert n == NUM_SHARES # else we'll be completely confused
+ all_peers = []
for shnum in range(NUM_SHARES):
mode = bucket_modes.get(shnum, "good")
peer = FakeBucketReaderWriterProxy(mode)
shareholders[shnum] = peer
- e.set_shareholders(shareholders)
+ servermap[shnum] = str(shnum)
+ e.set_shareholders(shareholders, servermap)
return e.start()
d.addCallback(_ready)
def _sent(res):
for share in server.buckets.keys():
server.buckets[share].abort()
buckets = {}
+ servermap = already_peers.copy()
for peer in used_peers:
buckets.update(peer.buckets)
- encoder.set_shareholders(buckets)
+ for bucket in peer.buckets:
+ servermap[bucket] = peer.peerid
+ encoder.set_shareholders(buckets, servermap)
d = encoder.start()
return d
d.addCallback(_have_shareholders)
_set_basedir()
d = self._setup_and_upload();
# Add 5 servers, with one share each from the original
- # Add a readonly server
def _do_server_setup(ign):
self._add_server_with_share(1, 1, True)
self._add_server_with_share(2)