rename storageserver.py to just storage.py, since it has both server and client sides now

This commit is contained in:
Brian Warner 2007-07-13 17:25:45 -07:00
parent 0468448b85
commit c6f52e379a
6 changed files with 16 additions and 16 deletions

View File

@ -11,7 +11,7 @@ from twisted.python import log
import allmydata
from allmydata.Crypto.Util.number import bytes_to_long
from allmydata.storageserver import StorageServer
from allmydata.storage import StorageServer
from allmydata.upload import Uploader
from allmydata.download import Downloader
from allmydata.webish import WebishServer

View File

@ -7,7 +7,7 @@ from twisted.application import service
from allmydata.util import idlib, mathutil, hashutil
from allmydata.util.assertutil import _assert
from allmydata import codec, hashtree, storageserver, uri
from allmydata import codec, hashtree, storage, uri
from allmydata.Crypto.Cipher import AES
from allmydata.interfaces import IDownloadTarget, IDownloader
from allmydata.encode import NotEnoughPeersError
@ -345,7 +345,7 @@ class FileDownloader:
def _got_response(self, buckets, connection):
_assert(isinstance(buckets, dict), buckets) # soon foolscap will check this for us with its DictOf schema constraint
for sharenum, bucket in buckets.iteritems():
b = storageserver.ReadBucketProxy(bucket)
b = storage.ReadBucketProxy(bucket)
self.add_share_bucket(sharenum, b)
self._uri_extension_sources.append(b)

View File

@ -43,12 +43,12 @@ class DumpDirnodeOptions(BasedirMixin, usage.Options):
raise usage.UsageError("<uri> parameter is required")
def dump_uri_extension(config, out=sys.stdout, err=sys.stderr):
from allmydata import uri, storageserver
from allmydata import uri, storage
filename = config['filename']
f = open(filename,"rb")
# use a ReadBucketProxy to parse the bucket and find the uri extension
bp = storageserver.ReadBucketProxy(None)
bp = storage.ReadBucketProxy(None)
offsets = bp._parse_offsets(f.read(8*4))
f.seek(offsets['uri_extension'])
length = struct.unpack(">L", f.read(4))[0]

View File

@ -7,7 +7,7 @@ from foolscap import Referenceable
import os.path
from allmydata import interfaces
from allmydata.util import fileutil, hashutil
from allmydata.storageserver import BucketWriter, BucketReader, \
from allmydata.storage import BucketWriter, BucketReader, \
WriteBucketProxy, ReadBucketProxy, StorageServer

View File

@ -5,7 +5,7 @@ from twisted.application import service
from foolscap import Referenceable
from allmydata.util import idlib, hashutil
from allmydata import encode, storageserver, hashtree
from allmydata import encode, storage, hashtree
from allmydata.uri import pack_uri, pack_lit
from allmydata.interfaces import IUploadable, IUploader
from allmydata.Crypto.Cipher import AES
@ -39,10 +39,10 @@ class PeerTracker:
self.buckets = {} # k: shareid, v: IRemoteBucketWriter
self.sharesize = sharesize
#print "PeerTracker", peerid, permutedid, sharesize
as = storageserver.allocated_size(sharesize,
num_segments,
num_share_hashes,
EXTENSION_SIZE)
as = storage.allocated_size(sharesize,
num_segments,
num_share_hashes,
EXTENSION_SIZE)
self.allocated_size = as
self.blocksize = blocksize
@ -74,11 +74,11 @@ class PeerTracker:
#log.msg("%s._got_reply(%s)" % (self, (alreadygot, buckets)))
b = {}
for sharenum, rref in buckets.iteritems():
bp = storageserver.WriteBucketProxy(rref, self.sharesize,
self.blocksize,
self.num_segments,
self.num_share_hashes,
EXTENSION_SIZE)
bp = storage.WriteBucketProxy(rref, self.sharesize,
self.blocksize,
self.num_segments,
self.num_share_hashes,
EXTENSION_SIZE)
b[sharenum] = bp
self.buckets.update(b)
return (alreadygot, set(b.keys()))