Commit ce663632 authored by Barry Warsaw's avatar Barry Warsaw

For alignment with ZODB4, renaming these storages for ZODB3 3.2.

bsddb3Storage becomes BDBStorage
Full becomes BDBFullStorage
Minimal becomes BDBMinimalStorage

Removing MinimalReplicated.py, Packless.py, and base.py
parent 8706e6a1
...@@ -38,10 +38,9 @@ class FileStorageConfig: ...@@ -38,10 +38,9 @@ class FileStorageConfig:
class BerkeleyStorageConfig: class BerkeleyStorageConfig:
def getConfig(self, path, create, read_only): def getConfig(self, path, create, read_only):
# Full always creates and doesn't have a read_only flag
return """\ return """\
<Storage> <Storage>
type Full type BDBFullStorage
name %s name %s
read_only %s read_only %s
</Storage>""" % (path, read_only) </Storage>""" % (path, read_only)
...@@ -77,7 +76,7 @@ class BDBReconnectionTests( ...@@ -77,7 +76,7 @@ class BDBReconnectionTests(
test_classes = [FileStorageConnectionTests, FileStorageReconnectionTests] test_classes = [FileStorageConnectionTests, FileStorageReconnectionTests]
try: try:
from bsddb3Storage.Full import Full from BDBStorage.BDBFullStorage import BDBFullStorage
except ImportError: except ImportError:
pass pass
else: else:
......
...@@ -160,14 +160,14 @@ class FileStorageTests(GenericTests): ...@@ -160,14 +160,14 @@ class FileStorageTests(GenericTests):
class BDBTests(FileStorageTests): class BDBTests(FileStorageTests):
"""ZEO backed by a Berkeley Full storage.""" """ZEO backed by a Berkeley full storage."""
def getStorage(self): def getStorage(self):
self._envdir = tempfile.mktemp() self._envdir = tempfile.mktemp()
# Return a 1-tuple # Return a 1-tuple
return """\ return """\
<Storage> <Storage>
type Full type BDBFullStorage
name %s name %s
</Storage> </Storage>
""" % self._envdir """ % self._envdir
...@@ -176,7 +176,7 @@ class BDBTests(FileStorageTests): ...@@ -176,7 +176,7 @@ class BDBTests(FileStorageTests):
test_classes = [FileStorageTests] test_classes = [FileStorageTests]
try: try:
from bsddb3Storage.Full import Full from BDBStorage.BDBFullStorage import BDBFullStorage
except ImportError: except ImportError:
pass pass
else: else:
......
...@@ -93,7 +93,7 @@ def convertClientStorageArgs(addr=None, **kw): ...@@ -93,7 +93,7 @@ def convertClientStorageArgs(addr=None, **kw):
def convertBDBStorageArgs(**kw): def convertBDBStorageArgs(**kw):
from bsddb3Storage.BerkeleyBase import BerkeleyConfig from BDBStorage.BerkeleyBase import BerkeleyConfig
config = BerkeleyConfig() config = BerkeleyConfig()
for name in dir(BerkeleyConfig): for name in dir(BerkeleyConfig):
if name.startswith('_'): if name.startswith('_'):
...@@ -116,6 +116,7 @@ storage_types = { ...@@ -116,6 +116,7 @@ storage_types = {
'MappingStorage': ('ZODB.MappingStorage', None), 'MappingStorage': ('ZODB.MappingStorage', None),
'TemporaryStorage': ('Products.TemporaryFolder.TemporaryStorage', None), 'TemporaryStorage': ('Products.TemporaryFolder.TemporaryStorage', None),
'ClientStorage': ('ZEO.ClientStorage', convertClientStorageArgs), 'ClientStorage': ('ZEO.ClientStorage', convertClientStorageArgs),
'Full': ('bsddb3Storage.Full', convertBDBStorageArgs), 'BDBFullStorage': ('BDBStorage.BDBFullStorage', convertBDBStorageArgs),
'Minimal': ('bsddb3Storage.Minimal', convertBDBStorageArgs), 'BDBMinimalStorage': ('BDBStorage.BDBMinimalStorage',
convertBDBStorageArgs),
} }
...@@ -38,7 +38,7 @@ class StorageTestCase(unittest.TestCase): ...@@ -38,7 +38,7 @@ class StorageTestCase(unittest.TestCase):
except: except:
pass pass
try: try:
# Full storage creates a directory # BDBFullStorage storage creates a directory
if os.path.isdir(self.tmpfn): if os.path.isdir(self.tmpfn):
shutil.rmtree(self.tmpfn) shutil.rmtree(self.tmpfn)
else: else:
...@@ -117,12 +117,12 @@ class StorageTestCase(unittest.TestCase): ...@@ -117,12 +117,12 @@ class StorageTestCase(unittest.TestCase):
def testFullStorage(self): def testFullStorage(self):
try: try:
from bsddb3Storage.Full import Full from BDBStorage.BDBFullStorage import BDBFullStorage
except ImportError: except ImportError:
return return
sample = """ sample = """
<Storage> <Storage>
type Full type BDBFullStorage
name %s name %s
cachesize 1000 cachesize 1000
</Storage> </Storage>
...@@ -132,24 +132,24 @@ class StorageTestCase(unittest.TestCase): ...@@ -132,24 +132,24 @@ class StorageTestCase(unittest.TestCase):
rootconf = ZConfig.loadfile(io) rootconf = ZConfig.loadfile(io)
storageconf = rootconf.getSection("Storage") storageconf = rootconf.getSection("Storage")
cls, args = StorageConfig.getStorageInfo(storageconf) cls, args = StorageConfig.getStorageInfo(storageconf)
self.assertEqual(cls, Full) self.assertEqual(cls, BDBFullStorage)
# It's too hard to test the config instance equality # It's too hard to test the config instance equality
args = args.copy() args = args.copy()
del args['config'] del args['config']
self.assertEqual(args, {"name": self.tmpfn}) self.assertEqual(args, {"name": self.tmpfn})
self.storage = StorageConfig.createStorage(storageconf) self.storage = StorageConfig.createStorage(storageconf)
self.assert_(isinstance(self.storage, Full)) self.assert_(isinstance(self.storage, BDBFullStorage))
# XXX _config isn't public # XXX _config isn't public
self.assert_(self.storage._config.cachesize, 1000) self.assert_(self.storage._config.cachesize, 1000)
def testMinimalStorage(self): def testMinimalStorage(self):
try: try:
from bsddb3Storage.Minimal import Minimal from BDBStorage.BDBMinimalStorage import BDBMinimalStorage
except ImportError: except ImportError:
return return
sample = """ sample = """
<Storage> <Storage>
type Minimal type BDBMinimalStorage
name %s name %s
cachesize 1000 cachesize 1000
</Storage> </Storage>
...@@ -159,13 +159,13 @@ class StorageTestCase(unittest.TestCase): ...@@ -159,13 +159,13 @@ class StorageTestCase(unittest.TestCase):
rootconf = ZConfig.loadfile(io) rootconf = ZConfig.loadfile(io)
storageconf = rootconf.getSection("Storage") storageconf = rootconf.getSection("Storage")
cls, args = StorageConfig.getStorageInfo(storageconf) cls, args = StorageConfig.getStorageInfo(storageconf)
self.assertEqual(cls, Minimal) self.assertEqual(cls, BDBMinimalStorage)
# It's too hard to test the config instance equality # It's too hard to test the config instance equality
args = args.copy() args = args.copy()
del args['config'] del args['config']
self.assertEqual(args, {"name": self.tmpfn}) self.assertEqual(args, {"name": self.tmpfn})
self.storage = StorageConfig.createStorage(storageconf) self.storage = StorageConfig.createStorage(storageconf)
self.assert_(isinstance(self.storage, Minimal)) self.assert_(isinstance(self.storage, BDBMinimalStorage))
# XXX _config isn't public # XXX _config isn't public
self.assert_(self.storage._config.cachesize, 1000) self.assert_(self.storage._config.cachesize, 1000)
......
...@@ -33,7 +33,7 @@ import operator ...@@ -33,7 +33,7 @@ import operator
from time import time as now from time import time as now
from ZODB.FileStorage import FileStorage from ZODB.FileStorage import FileStorage
#from bsddb3Storage.Full import Full #from BDBStorage.BDBFullStorage import BDBFullStorage
#from Standby.primary import PrimaryStorage #from Standby.primary import PrimaryStorage
#from Standby.config import RS_PORT #from Standby.config import RS_PORT
from ZODB.Transaction import Transaction from ZODB.Transaction import Transaction
...@@ -281,7 +281,7 @@ def main(): ...@@ -281,7 +281,7 @@ def main():
if replay: if replay:
storage = FileStorage(storagefile) storage = FileStorage(storagefile)
#storage = Full(storagefile) #storage = BDBFullStorage(storagefile)
#storage = PrimaryStorage('yyz', storage, RS_PORT) #storage = PrimaryStorage('yyz', storage, RS_PORT)
t0 = now() t0 = now()
p = ZEOParser(maxtxns, report, storage) p = ZEOParser(maxtxns, report, storage)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment