From: Brian Warner Date: Wed, 4 Aug 2010 07:08:15 +0000 (-0700) Subject: storage-overhead: try to fix, probably still broken X-Git-Tag: allmydata-tahoe-1.8.0b2~28 X-Git-Url: https://git.rkrishnan.org/Site/Content/Exhibitors/quickstart.html?a=commitdiff_plain;h=eee70fba351df335fc7f5e5537e8230c05d98b44;p=tahoe-lafs%2Ftahoe-lafs.git storage-overhead: try to fix, probably still broken --- diff --git a/misc/simulators/storage-overhead.py b/misc/simulators/storage-overhead.py index 75a0bf61..a294b8d0 100644 --- a/misc/simulators/storage-overhead.py +++ b/misc/simulators/storage-overhead.py @@ -1,7 +1,9 @@ #!/usr/bin/env python import sys, math -from allmydata import upload, uri, encode, storage +from allmydata import uri, storage +from allmydata.immutable import upload +from allmydata.interfaces import DEFAULT_MAX_SEGMENT_SIZE from allmydata.util import mathutil def roundup(size, blocksize=4096): @@ -22,14 +24,14 @@ class BigFakeString: def tell(self): return self.fp -def calc(filesize, params=(3,7,10), segsize=encode.Encoder.MAX_SEGMENT_SIZE): +def calc(filesize, params=(3,7,10), segsize=DEFAULT_MAX_SEGMENT_SIZE): num_shares = params[2] if filesize <= upload.Uploader.URI_LIT_SIZE_THRESHOLD: - urisize = len(uri.pack_lit("A"*filesize)) + urisize = len(uri.LiteralFileURI("A"*filesize).to_string()) sharesize = 0 sharespace = 0 else: - u = upload.FileUploader(None) + u = upload.FileUploader(None) # XXX changed u.set_params(params) # unfortunately, Encoder doesn't currently lend itself to answering # this question without measuring a filesize, so we have to give it a