Changeset eee70fba in trunk
- Timestamp:
- 2010-08-04T07:08:15Z (15 years ago)
- Branches:
- master
- Children:
- 6c2a4f0
- Parents:
- ebfde4f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified misc/simulators/storage-overhead.py ¶
rebfde4f reee70fba 2 2 3 3 import sys, math 4 from allmydata import upload, uri, encode, storage 4 from allmydata import uri, storage 5 from allmydata.immutable import upload 6 from allmydata.interfaces import DEFAULT_MAX_SEGMENT_SIZE 5 7 from allmydata.util import mathutil 6 8 … … 23 25 return self.fp 24 26 25 def calc(filesize, params=(3,7,10), segsize= encode.Encoder.MAX_SEGMENT_SIZE):27 def calc(filesize, params=(3,7,10), segsize=DEFAULT_MAX_SEGMENT_SIZE): 26 28 num_shares = params[2] 27 29 if filesize <= upload.Uploader.URI_LIT_SIZE_THRESHOLD: 28 urisize = len(uri. pack_lit("A"*filesize))30 urisize = len(uri.LiteralFileURI("A"*filesize).to_string()) 29 31 sharesize = 0 30 32 sharespace = 0 31 33 else: 32 u = upload.FileUploader(None) 34 u = upload.FileUploader(None) # XXX changed 33 35 u.set_params(params) 34 36 # unfortunately, Encoder doesn't currently lend itself to answering
Note: See TracChangeset
for help on using the changeset viewer.