mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 05:28:04 +00:00
rename storageserver.py to just storage.py, since it has both server and client sides now
This commit is contained in:
parent
0468448b85
commit
c6f52e379a
@ -11,7 +11,7 @@ from twisted.python import log
|
|||||||
|
|
||||||
import allmydata
|
import allmydata
|
||||||
from allmydata.Crypto.Util.number import bytes_to_long
|
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.upload import Uploader
|
||||||
from allmydata.download import Downloader
|
from allmydata.download import Downloader
|
||||||
from allmydata.webish import WebishServer
|
from allmydata.webish import WebishServer
|
||||||
|
@ -7,7 +7,7 @@ from twisted.application import service
|
|||||||
|
|
||||||
from allmydata.util import idlib, mathutil, hashutil
|
from allmydata.util import idlib, mathutil, hashutil
|
||||||
from allmydata.util.assertutil import _assert
|
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.Crypto.Cipher import AES
|
||||||
from allmydata.interfaces import IDownloadTarget, IDownloader
|
from allmydata.interfaces import IDownloadTarget, IDownloader
|
||||||
from allmydata.encode import NotEnoughPeersError
|
from allmydata.encode import NotEnoughPeersError
|
||||||
@ -345,7 +345,7 @@ class FileDownloader:
|
|||||||
def _got_response(self, buckets, connection):
|
def _got_response(self, buckets, connection):
|
||||||
_assert(isinstance(buckets, dict), buckets) # soon foolscap will check this for us with its DictOf schema constraint
|
_assert(isinstance(buckets, dict), buckets) # soon foolscap will check this for us with its DictOf schema constraint
|
||||||
for sharenum, bucket in buckets.iteritems():
|
for sharenum, bucket in buckets.iteritems():
|
||||||
b = storageserver.ReadBucketProxy(bucket)
|
b = storage.ReadBucketProxy(bucket)
|
||||||
self.add_share_bucket(sharenum, b)
|
self.add_share_bucket(sharenum, b)
|
||||||
self._uri_extension_sources.append(b)
|
self._uri_extension_sources.append(b)
|
||||||
|
|
||||||
|
@ -43,12 +43,12 @@ class DumpDirnodeOptions(BasedirMixin, usage.Options):
|
|||||||
raise usage.UsageError("<uri> parameter is required")
|
raise usage.UsageError("<uri> parameter is required")
|
||||||
|
|
||||||
def dump_uri_extension(config, out=sys.stdout, err=sys.stderr):
|
def dump_uri_extension(config, out=sys.stdout, err=sys.stderr):
|
||||||
from allmydata import uri, storageserver
|
from allmydata import uri, storage
|
||||||
|
|
||||||
filename = config['filename']
|
filename = config['filename']
|
||||||
f = open(filename,"rb")
|
f = open(filename,"rb")
|
||||||
# use a ReadBucketProxy to parse the bucket and find the uri extension
|
# 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))
|
offsets = bp._parse_offsets(f.read(8*4))
|
||||||
f.seek(offsets['uri_extension'])
|
f.seek(offsets['uri_extension'])
|
||||||
length = struct.unpack(">L", f.read(4))[0]
|
length = struct.unpack(">L", f.read(4))[0]
|
||||||
|
@ -7,7 +7,7 @@ from foolscap import Referenceable
|
|||||||
import os.path
|
import os.path
|
||||||
from allmydata import interfaces
|
from allmydata import interfaces
|
||||||
from allmydata.util import fileutil, hashutil
|
from allmydata.util import fileutil, hashutil
|
||||||
from allmydata.storageserver import BucketWriter, BucketReader, \
|
from allmydata.storage import BucketWriter, BucketReader, \
|
||||||
WriteBucketProxy, ReadBucketProxy, StorageServer
|
WriteBucketProxy, ReadBucketProxy, StorageServer
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ from twisted.application import service
|
|||||||
from foolscap import Referenceable
|
from foolscap import Referenceable
|
||||||
|
|
||||||
from allmydata.util import idlib, hashutil
|
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.uri import pack_uri, pack_lit
|
||||||
from allmydata.interfaces import IUploadable, IUploader
|
from allmydata.interfaces import IUploadable, IUploader
|
||||||
from allmydata.Crypto.Cipher import AES
|
from allmydata.Crypto.Cipher import AES
|
||||||
@ -39,10 +39,10 @@ class PeerTracker:
|
|||||||
self.buckets = {} # k: shareid, v: IRemoteBucketWriter
|
self.buckets = {} # k: shareid, v: IRemoteBucketWriter
|
||||||
self.sharesize = sharesize
|
self.sharesize = sharesize
|
||||||
#print "PeerTracker", peerid, permutedid, sharesize
|
#print "PeerTracker", peerid, permutedid, sharesize
|
||||||
as = storageserver.allocated_size(sharesize,
|
as = storage.allocated_size(sharesize,
|
||||||
num_segments,
|
num_segments,
|
||||||
num_share_hashes,
|
num_share_hashes,
|
||||||
EXTENSION_SIZE)
|
EXTENSION_SIZE)
|
||||||
self.allocated_size = as
|
self.allocated_size = as
|
||||||
|
|
||||||
self.blocksize = blocksize
|
self.blocksize = blocksize
|
||||||
@ -74,11 +74,11 @@ class PeerTracker:
|
|||||||
#log.msg("%s._got_reply(%s)" % (self, (alreadygot, buckets)))
|
#log.msg("%s._got_reply(%s)" % (self, (alreadygot, buckets)))
|
||||||
b = {}
|
b = {}
|
||||||
for sharenum, rref in buckets.iteritems():
|
for sharenum, rref in buckets.iteritems():
|
||||||
bp = storageserver.WriteBucketProxy(rref, self.sharesize,
|
bp = storage.WriteBucketProxy(rref, self.sharesize,
|
||||||
self.blocksize,
|
self.blocksize,
|
||||||
self.num_segments,
|
self.num_segments,
|
||||||
self.num_share_hashes,
|
self.num_share_hashes,
|
||||||
EXTENSION_SIZE)
|
EXTENSION_SIZE)
|
||||||
b[sharenum] = bp
|
b[sharenum] = bp
|
||||||
self.buckets.update(b)
|
self.buckets.update(b)
|
||||||
return (alreadygot, set(b.keys()))
|
return (alreadygot, set(b.keys()))
|
||||||
|
Loading…
Reference in New Issue
Block a user