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


 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:
32  virtual ~FieldCacheSanityChecker();
33 
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 
43  {
46 
56 
59  EXPECTED
60  };
61 
64  static Collection<InsanityPtr> checkSanity(FieldCachePtr cache);
65 
69  static Collection<InsanityPtr> checkSanity(Collection<FieldCacheEntryPtr> cacheEntries);
70 
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:
101  virtual ~Insanity();
102 
104 
105  protected:
107  String msg;
109 
110  public:
113 
115  String getMsg();
116 
118  Collection<FieldCacheEntryPtr> getCacheEntries();
119 
122  virtual String toString();
123  };
124 }
125 
126 #endif

clucene.sourceforge.net