[Zope-Checkins] CVS: ZODB3/ZODB - component.xml:1.3 config.py:1.9
Fred L. Drake, Jr.
fred@zope.com
Thu, 16 Jan 2003 12:50:38 -0500
Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv26861/ZODB
Modified Files:
component.xml config.py
Log Message:
Modify the BDB storage types in the ZConfig schema component so there is less
repitition and no magical guessing of type names in the datatypes.
=== ZODB3/ZODB/component.xml 1.2 => 1.3 ===
--- ZODB3/ZODB/component.xml:1.2 Mon Jan 13 11:28:29 2003
+++ ZODB3/ZODB/component.xml Thu Jan 16 12:50:36 2003
@@ -19,7 +19,10 @@
<key name="name" default="Mapping Storage"/>
</sectiontype>
- <sectiontype name="fullstorage" datatype=".BDBStorage"
+ <!-- The BDB storages probably need to be revised somewhat still.
+ The extension relationship seems a little odd.
+ -->
+ <sectiontype name="fullstorage" datatype=".BDBFullStorage"
implements="storage">
<key name="name" required="yes" />
<key name="interval" datatype="time-interval" default="2m" />
@@ -33,21 +36,8 @@
<key name="read-only" datatype="boolean" default="off"/>
</sectiontype>
- <!-- XXX Fred promises to make it so minimal storage is just an
- extension of fullstorage -->
- <sectiontype name="minimalstorage" datatype=".BDBStorage"
- implements="storage">
- <key name="name" required="yes" />
- <key name="interval" datatype="time-interval" default="2m" />
- <key name="kbyte" datatype="integer" default="0" />
- <key name="min" datatype="integer" default="0" />
- <key name="logdir" />
- <key name="cachesize" datatype="byte-size" default="128MB" />
- <key name="frequency" datatype="time-interval" default="0" />
- <key name="packtime" datatype="time-interval" default="4h" />
- <key name="classicpack" datatype="integer" default="0" />
- <key name="read-only" datatype="boolean" default="off"/>
- </sectiontype>
+ <sectiontype name="minimalstorage" datatype=".BDBMinimalStorage"
+ implements="storage" extends="fullstorage"/>
<sectiontype name="zeoclient" datatype=".ZEOClient"
implements="storage">
=== ZODB3/ZODB/config.py 1.8 => 1.9 ===
--- ZODB3/ZODB/config.py:1.8 Mon Jan 13 11:28:29 2003
+++ ZODB3/ZODB/config.py Thu Jan 16 12:50:36 2003
@@ -129,16 +129,22 @@
def open(self):
from BDBStorage.BerkeleyBase import BerkeleyConfig
- from BDBStorage.BDBFullStorage import BDBFullStorage
- from BDBStorage.BDBMinimalStorage import BDBMinimalStorage
- # Figure out which class we want
- sectiontype = self.config.getSectionType()
- storageclass = {'fullstorage': BDBFullStorage,
- 'minimalstorage': BDBMinimalStorage,
- }[sectiontype]
+ storageclass = self.get_storageclass()
bconf = BerkeleyConfig()
for name in dir(BerkeleyConfig):
if name.startswith('_'):
continue
setattr(bconf, name, getattr(self.config, name))
return storageclass(self.config.name, config=bconf)
+
+class BDBMinimalStorage(BDBStorage):
+
+ def get_storageclass(self):
+ import BDBStorage.BDBMinimalStorage
+ return BDBStorage.BDBMinimalStorage.BDBMinimalStorage
+
+class BDBFullStorage(BDBStorage):
+
+ def get_storageclass(self):
+ import BDBStorage.BDBFullStorage
+ return BDBStorage.BDBFullStorage.BDBFullStorage