Lucene++ - a full-featured, c++ search engine
API Documentation

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FieldCacheSanityChecker.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6
7 #ifndef FIELDCACHESANITYCHECKER_H
8 #define FIELDCACHESANITYCHECKER_H
9
10 #include "LuceneObject.h"
11 #include "MapOfSets.h"
12
13 namespace Lucene
14 {
28 class LPPAPI FieldCacheSanityChecker : public LuceneObject
29 {
30 public:
31 FieldCacheSanityChecker();
32 virtual ~FieldCacheSanityChecker();
33
34 LUCENE_CLASS(FieldCacheSanityChecker);
35
36 public:
37 typedef MapOfSets< int32_t, boost::hash<int32_t>, std::equal_to<int32_t>, FieldCacheEntryPtr, luceneHash<FieldCacheEntryPtr>, luceneEquals<FieldCacheEntryPtr> > MapSetIntFieldCacheEntry;
38 typedef MapOfSets< ReaderFieldPtr, luceneHash<ReaderFieldPtr>, luceneEquals<ReaderFieldPtr>, int32_t, boost::hash<int32_t>, std::equal_to<int32_t> > MapSetReaderFieldInt;
39 typedef MapOfSets< ReaderFieldPtr, luceneHash<ReaderFieldPtr>, luceneEquals<ReaderFieldPtr>, ReaderFieldPtr, luceneHash<ReaderFieldPtr>, luceneEquals<ReaderFieldPtr> > MapSetReaderFieldReaderField;
40
42 enum InsanityType
43 {
45 SUBREADER,
46
55 VALUEMISMATCH,
56
59 EXPECTED
60 };
61
64 static Collection<InsanityPtr> checkSanity(FieldCachePtr cache);
65
69 static Collection<InsanityPtr> checkSanity(Collection<FieldCacheEntryPtr> cacheEntries);
70
73 Collection<InsanityPtr> check(Collection<FieldCacheEntryPtr> cacheEntries);
74
75 protected:
79 Collection<InsanityPtr> checkValueMismatch(MapSetIntFieldCacheEntry valIdToItems,
80 MapSetReaderFieldInt readerFieldToValIds,
81 SetReaderField valMismatchKeys);
82
87 Collection<InsanityPtr> checkSubreaders(MapSetIntFieldCacheEntry valIdToItems,
88 MapSetReaderFieldInt readerFieldToValIds);
89
92 Collection<LuceneObjectPtr> getAllDecendentReaderKeys(LuceneObjectPtr seed);
93 };
94
97 class LPPAPI Insanity : public LuceneObject
98 {
99 public:
100 Insanity(FieldCacheSanityChecker::InsanityType type, const String& msg, Collection<FieldCacheEntryPtr> entries);
101 virtual ~Insanity();
102
103 LUCENE_CLASS(Insanity);
104
105 protected:
106 FieldCacheSanityChecker::InsanityType type;
107 String msg;
108 Collection<FieldCacheEntryPtr> entries;
109
110 public:
112 FieldCacheSanityChecker::InsanityType getType();
113
115 String getMsg();
116
118 Collection<FieldCacheEntryPtr> getCacheEntries();
119
122 virtual String toString();
123 };
124 }
125
126 #endif

clucene.sourceforge.net