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
MergePolicy.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 MERGEPOLICY_H
8
#define MERGEPOLICY_H
9
10
#include "
SegmentInfos.h
"
11
12
namespace
Lucene {
13
32
class
LPPAPI
MergePolicy
:
public
LuceneObject
{
33
public
:
34
MergePolicy
(
const
IndexWriterPtr
& writer);
35
virtual
~
MergePolicy
();
36
37
LUCENE_CLASS
(
MergePolicy
);
38
39
protected
:
40
IndexWriterWeakPtr
_writer;
41
42
public
:
47
virtual
MergeSpecificationPtr
findMerges(
const
SegmentInfosPtr
& segmentInfos) = 0;
48
57
virtual
MergeSpecificationPtr
findMergesForOptimize(
const
SegmentInfosPtr
& segmentInfos, int32_t maxSegmentCount, SetSegmentInfo segmentsToOptimize) = 0;
58
61
virtual
MergeSpecificationPtr
findMergesToExpungeDeletes(
const
SegmentInfosPtr
& segmentInfos) = 0;
62
64
virtual
void
close() = 0;
65
67
virtual
bool
useCompoundFile(
const
SegmentInfosPtr
& segments,
const
SegmentInfoPtr
& newSegment) = 0;
68
70
virtual
bool
useCompoundDocStore(
const
SegmentInfosPtr
& segments) = 0;
71
};
72
76
class
LPPAPI
OneMerge
:
public
LuceneObject
{
77
public
:
78
OneMerge
(
const
SegmentInfosPtr
& segments,
bool
useCompoundFile);
79
virtual
~
OneMerge
();
80
81
LUCENE_CLASS
(
OneMerge
);
82
83
public
:
84
SegmentInfoPtr
info;
// used by IndexWriter
85
bool
mergeDocStores
;
// used by IndexWriter
86
bool
optimize
;
// used by IndexWriter
87
bool
registerDone
;
// used by IndexWriter
88
int64_t
mergeGen
;
// used by IndexWriter
89
bool
isExternal
;
// used by IndexWriter
90
int32_t
maxNumSegmentsOptimize
;
// used by IndexWriter
91
Collection<SegmentReaderPtr>
readers
;
// used by IndexWriter
92
Collection<SegmentReaderPtr>
readersClone
;
// used by IndexWriter
93
94
SegmentInfosPtr
segments
;
95
bool
useCompoundFile
;
96
bool
aborted
;
97
LuceneException
error
;
98
99
public
:
101
void
setException(
const
LuceneException
& error);
102
104
LuceneException
getException();
105
107
void
abort();
108
110
bool
isAborted();
111
112
void
checkAborted(
const
DirectoryPtr
& dir);
113
114
String segString(
const
DirectoryPtr
& dir);
115
};
116
119
class
LPPAPI
MergeSpecification
:
public
LuceneObject
{
120
public
:
121
MergeSpecification
();
122
virtual
~
MergeSpecification
();
123
124
LUCENE_CLASS
(
MergeSpecification
);
125
126
public
:
127
Collection<OneMergePtr>
merges;
128
129
public
:
130
void
add(
const
OneMergePtr
& merge);
131
String segString(
const
DirectoryPtr
& dir);
132
};
133
134
}
135
136
#endif
clucene.sourceforge.net