Skip to content

Commit

Permalink
removed code that has gone into check_catalog.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zopyx committed Nov 13, 2001
1 parent e5daf08 commit 0836a65
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions Catalog.py
Expand Up @@ -676,47 +676,4 @@ def searchResults(self, REQUEST=None, used=None, **kw):
__call__ = searchResults


def checkConsistency(self):
""" perform some consistency checks on the catalog """
from types import IntType
from BTrees.IIBTree import IISet,difference,intersection

l_data = list(self.data.keys())
l_data.sort()
l_uids = list(self.uids.values())
l_uids.sort()
l_paths = list(self.data.keys())
l_paths.sort()

assert l_data == l_uids
assert l_data == l_paths

for id,idx in self.indexes.items():

if idx.meta_type == 'FieldIndex':

RIDS = IISet()
for key, rids in idx._index.items():
if isinstance(rids,IntType):
RIDS.insert( rids )
else:
map(RIDS.insert , rids.keys())

diff = difference(RIDS, IISet(self.data.keys()))
assert len(diff)==0,'Index %s: problem with forward entries' % id


RIDS = IISet()
for key, rids in idx._index.items():
if isinstance(rids,IntType):
RIDS.insert( rids )
else:
map(RIDS.insert , rids.keys())

diff = difference(RIDS, IISet(self.data.keys()))
assert len(diff)==0,'Index %s: problems with backward entries' % id




class CatalogError(Exception): pass

0 comments on commit 0836a65

Please sign in to comment.