Hi, I see the new catalog stuff makes use of new BTrees. I presume the big advantages the new catalog has are from these new BTrees. I know of a few products which also use these BTrees (Squishdot and some internal ones here spring to mind) so I guess they should be upgraded too? Well, I had a look at the _convertBTrees method in Catalog.py and it all made sense, so I'm guessing the folowing would be the correct way to convert some BTrees? from BTrees import IOBTree, BTree, convert myBTree if type(myBTree is not IOBTree): mynewBTree = IOBTree() convert(myBTree,mynewBTree, 200) ...or.. if type(myBTree is not BTree): mynewBTree = BTree() convert(myBTree,mynewBTree, 200) I'm guessing the 200 is how many items get put in each bucket? What should influence the choice of this number? cheers, Chris
This looks about right. Threshhold is the number of key-value pairs moved before a subcommit and cache flush, I believe. So 200 should be OK... probably higher, even. ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: <zope-dev@zope.org> Sent: Wednesday, April 04, 2001 9:51 AM Subject: [Zope-dev] BTree upgrading
Hi,
I see the new catalog stuff makes use of new BTrees. I presume the big advantages the new catalog has are from these new BTrees. I know of a few products which also use these BTrees (Squishdot and some internal ones here spring to mind) so I guess they should be upgraded too?
Well, I had a look at the _convertBTrees method in Catalog.py and it all made sense, so I'm guessing the folowing would be the correct way to convert some BTrees?
from BTrees import IOBTree, BTree, convert
myBTree
if type(myBTree is not IOBTree): mynewBTree = IOBTree() convert(myBTree,mynewBTree, 200)
...or..
if type(myBTree is not BTree): mynewBTree = BTree() convert(myBTree,mynewBTree, 200)
I'm guessing the 200 is how many items get put in each bucket? What should influence the choice of this number?
cheers,
Chris
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Chris McDonough wrote:
This looks about right. Threshhold is the number of key-value pairs moved before a subcommit and cache flush, I believe. So 200 should be OK... probably higher, even.
Cool... I feel a new point release of Squishdot brewing :-S cheers, Chris
Oops... from BTrees import OOBTree b = OOBTree.OOBTree() ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Chris McDonough" <chrism@digicool.com> Cc: <zope-dev@zope.org> Sent: Wednesday, April 04, 2001 10:45 AM Subject: Re: [Zope-dev] BTree upgrading
Chris McDonough wrote:
from BTrees import BTree
gak!
I get an import error here. What happened to the bog standard BTree? I need to map strings to objects, what should I use now?
cheers,
Chris
participants (2)
-
Chris McDonough -
Chris Withers