from twisted.application import service
from twisted.python.failure import Failure
from allmydata.util import idlib
+from zope.interface import implements
+from allmydata.interfaces import RIBucketWriter
from amdlib.util.assertutil import precondition
return NoSuchBucketError()
class Lease(Referenceable):
+ implements(RIBucketWriter)
+
def __init__(self, verifierid, leaser, bucket):
self._leaser = leaser
self._verifierid = verifierid
from twisted.application import service
from twisted.python import log
from allmydata.util.iputil import get_local_ip_for
+from zope.interface import implements
+from allmydata.interfaces import RIClient
from twisted.internet import defer, reactor
# this BlockingResolver is because otherwise unit tests must sometimes deal
from allmydata.storageserver import StorageServer
class Client(service.MultiService, Referenceable):
+ implements(RIClient)
CERTFILE = "client.pem"
STOREDIR = 'storage'
--- /dev/null
+
+from foolscap.schema import StringConstraint, ListOf, TupleOf, Any, Nothing
+from foolscap import RemoteInterface
+
+Nodeid = StringConstraint(20)
+PBURL = StringConstraint()
+# these three are here because Foolscap does not yet support the kind of
+# restriction I really want to apply to these.
+RIClient_ = Any
+Referenceable_ = Any
+RIBucketWriter_ = Any
+
+class RIQueenRoster(RemoteInterface):
+ def hello(nodeid=Nodeid, node=RIClient_, pburl=PBURL):
+ return Nothing
+
+class RIClient(RemoteInterface):
+ def get_service(name=str):
+ return Referenceable_
+ def add_peers(new_peers=ListOf(TupleOf(Nodeid, PBURL), maxLength=100)):
+ return Nothing
+ def lost_peers(lost_peers=ListOf(Nodeid)):
+ return Nothing
+
+class RIStorageServer(RemoteInterface):
+ def allocate_bucket(verifierid=Nodeid, bucket_num=int, size=int,
+ leaser=Nodeid):
+ return RIBucketWriter_
+
+
+class RIBucketWriter(RemoteInterface):
+ def write(data=str):
+ return Nothing
+
+ def set_size(size=int):
+ return Nothing
+
+ def close():
+ return Nothing
+
+
from twisted.python import log
import os.path
from allmydata.util.iputil import get_local_ip_for
+from zope.interface import implements
+from allmydata.interfaces import RIQueenRoster
class Roster(service.MultiService, Referenceable):
+ implements(RIQueenRoster)
+
def __init__(self):
service.MultiService.__init__(self)
self.phonebook = {}
from amdlib.util.assertutil import precondition
from allmydata.bucketstore import BucketStore
+from zope.interface import implements
+from allmydata.interfaces import RIStorageServer
class BucketAlreadyExistsError(Exception):
pass
class StorageServer(service.MultiService, Referenceable):
+ implements(RIStorageServer)
name = 'storageserver'
def __init__(self, store_dir):
looks for differences between their self-reported availability and the
experiences of others
+ store filetable URI in the first 10 peers that appear after your own nodeid
+ each entry has a sequence number, maybe a timestamp
+ on recovery, find the newest
+
big questions:
convergence?
+ peer list maintenance: lots of entries