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
include
FieldCacheSanityChecker.h
Go to the documentation of this file.
1
2
// Copyright (c) 2009-2014 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
public
:
30
FieldCacheSanityChecker
();
31
virtual
~
FieldCacheSanityChecker
();
32
33
LUCENE_CLASS
(
FieldCacheSanityChecker
);
34
35
public
:
36
typedef
MapOfSets< int32_t, boost::hash<int32_t>
, std::equal_to<int32_t>,
FieldCacheEntryPtr
, luceneHash<FieldCacheEntryPtr>, luceneEquals<FieldCacheEntryPtr> >
MapSetIntFieldCacheEntry
;
37
typedef
MapOfSets< ReaderFieldPtr, luceneHash<ReaderFieldPtr>
, luceneEquals<ReaderFieldPtr>, int32_t, boost::hash<int32_t>, std::equal_to<int32_t> >
MapSetReaderFieldInt
;
38
typedef
MapOfSets< ReaderFieldPtr, luceneHash<ReaderFieldPtr>
, luceneEquals<ReaderFieldPtr>,
ReaderFieldPtr
, luceneHash<ReaderFieldPtr>, luceneEquals<ReaderFieldPtr> >
MapSetReaderFieldReaderField
;
39
41
enum
InsanityType
{
43
SUBREADER
,
44
53
VALUEMISMATCH
,
54
57
EXPECTED
58
};
59
62
static
Collection<InsanityPtr>
checkSanity(
const
FieldCachePtr
& cache);
63
67
static
Collection<InsanityPtr>
checkSanity(
Collection<FieldCacheEntryPtr>
cacheEntries);
68
71
Collection<InsanityPtr>
check(
Collection<FieldCacheEntryPtr>
cacheEntries);
72
73
protected
:
77
Collection<InsanityPtr>
checkValueMismatch(MapSetIntFieldCacheEntry valIdToItems,
78
MapSetReaderFieldInt readerFieldToValIds,
79
SetReaderField valMismatchKeys);
80
85
Collection<InsanityPtr>
checkSubreaders(MapSetIntFieldCacheEntry valIdToItems,
86
MapSetReaderFieldInt readerFieldToValIds);
87
90
Collection<LuceneObjectPtr>
getAllDecendentReaderKeys(
const
LuceneObjectPtr
& seed);
91
};
92
95
class
LPPAPI
Insanity
:
public
LuceneObject
{
96
public
:
97
Insanity
(
FieldCacheSanityChecker::InsanityType
type,
const
String& msg,
Collection<FieldCacheEntryPtr>
entries);
98
virtual
~
Insanity
();
99
100
LUCENE_CLASS
(
Insanity
);
101
102
protected
:
103
FieldCacheSanityChecker::InsanityType
type
;
104
String
msg
;
105
Collection<FieldCacheEntryPtr>
entries
;
106
107
public
:
109
FieldCacheSanityChecker::InsanityType
getType();
110
112
String getMsg();
113
115
Collection<FieldCacheEntryPtr>
getCacheEntries();
116
119
virtual
String toString();
120
};
121
122
}
123
124
#endif
clucene.sourceforge.net