Commit f82d8220 authored by Jeremy Hylton's avatar Jeremy Hylton

Collector #814: Use IITreeSet for the sets since they may be large.

parent 610625b4
......@@ -11,7 +11,7 @@
#
##############################################################################
__version__ = '$Id: PathIndex.py,v 1.32 2003/01/27 18:59:17 fdrake Exp $'
__version__ = '$Id: PathIndex.py,v 1.33 2003/02/20 19:48:03 jeremy Exp $'
from Products.PluginIndexes import PluggableIndex
from Products.PluginIndexes.common.util import parseIndexRequest
......@@ -21,7 +21,7 @@ from Acquisition import Implicit
from BTrees.IOBTree import IOBTree
from BTrees.OOBTree import OOBTree
from BTrees.IIBTree import IISet, intersection, union
from BTrees.IIBTree import IITreeSet, IISet, intersection, union
from OFS.SimpleItem import SimpleItem
from zLOG import LOG, ERROR
from types import StringType, ListType, TupleType
......@@ -77,23 +77,23 @@ class PathIndex(Persistent, Implicit, SimpleItem):
self._unindex = IOBTree()
def insertEntry(self,comp,id,level):
"""
k is a path component (generated by splitPath() )
v is the documentId
def insertEntry(self, comp, id, level):
"""Insert an entry.
comp is a path component (generated by splitPath() )
id is the documentId
level is the level of the component inside the path
"""
if self._index.has_key(comp)==0:
if self._index.has_key(comp) == 0:
self._index[comp] = IOBTree()
if self._index[comp].has_key(level)==0:
self._index[comp][level] = IISet()
if self._index[comp].has_key(level) == 0:
self._index[comp][level] = IITreeSet()
self._index[comp][level].insert(id)
if level > self._depth: self._depth = level
if level > self._depth:
self._depth = level
def index_object(self, documentId, obj ,threshold=100):
......
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