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 @@ ...@@ -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 import PluggableIndex
from Products.PluginIndexes.common.util import parseIndexRequest from Products.PluginIndexes.common.util import parseIndexRequest
...@@ -21,7 +21,7 @@ from Acquisition import Implicit ...@@ -21,7 +21,7 @@ from Acquisition import Implicit
from BTrees.IOBTree import IOBTree from BTrees.IOBTree import IOBTree
from BTrees.OOBTree import OOBTree 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 OFS.SimpleItem import SimpleItem
from zLOG import LOG, ERROR from zLOG import LOG, ERROR
from types import StringType, ListType, TupleType from types import StringType, ListType, TupleType
...@@ -77,23 +77,23 @@ class PathIndex(Persistent, Implicit, SimpleItem): ...@@ -77,23 +77,23 @@ class PathIndex(Persistent, Implicit, SimpleItem):
self._unindex = IOBTree() self._unindex = IOBTree()
def insertEntry(self,comp,id,level): def insertEntry(self, comp, id, level):
""" """Insert an entry.
k is a path component (generated by splitPath() )
v is the documentId comp is a path component (generated by splitPath() )
id is the documentId
level is the level of the component inside the path 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() self._index[comp] = IOBTree()
if self._index[comp].has_key(level)==0: if self._index[comp].has_key(level) == 0:
self._index[comp][level] = IISet() self._index[comp][level] = IITreeSet()
self._index[comp][level].insert(id) self._index[comp][level].insert(id)
if level > self._depth:
if level > self._depth: self._depth = level self._depth = level
def index_object(self, documentId, obj ,threshold=100): 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