]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
storage-overhead: try to fix, probably still broken
authorBrian Warner <warner@lothar.com>
Wed, 4 Aug 2010 07:08:15 +0000 (00:08 -0700)
committerBrian Warner <warner@lothar.com>
Wed, 4 Aug 2010 07:08:15 +0000 (00:08 -0700)
misc/simulators/storage-overhead.py

index 75a0bf6185cc1101e53c5097b35e3250939de4e5..a294b8d07cc6c3175d8718ef1ce2def680a9cb37 100644 (file)
@@ -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