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
ConcurrentMergeScheduler.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 CONCURRENTMERGESCHEDULER_H
8 #define CONCURRENTMERGESCHEDULER_H
9
10 #include "MergeScheduler.h"
11
12 namespace Lucene
13 {
19 class LPPAPI ConcurrentMergeScheduler : public MergeScheduler
20 {
21 public:
22 ConcurrentMergeScheduler();
23 virtual ~ConcurrentMergeScheduler();
24
25 LUCENE_CLASS(ConcurrentMergeScheduler);
26
27 protected:
28 int32_t mergeThreadPriority;
29
30 SetMergeThread mergeThreads;
31
33 int32_t maxThreadCount;
34
35 DirectoryPtr dir;
36
37 bool closed;
38 IndexWriterWeakPtr _writer;
39
40 static Collection<ConcurrentMergeSchedulerPtr> allInstances;
41
42 bool suppressExceptions;
43 static bool anyExceptions;
44
45 public:
46 virtual void initialize();
47
51 virtual void setMaxThreadCount(int32_t count);
52
54 virtual int32_t getMaxThreadCount();
55
58 virtual int32_t getMergeThreadPriority();
59
61 virtual void setMergeThreadPriority(int32_t pri);
62
63 virtual void close();
64
65 virtual void sync();
66
67 virtual void merge(IndexWriterPtr writer);
68
70 static bool anyUnhandledExceptions();
71 static void clearUnhandledExceptions();
72
74 void setSuppressExceptions();
75 void clearSuppressExceptions();
76
78 static void setTestMode();
79
80 protected:
81 virtual bool verbose();
82 virtual void message(const String& message);
83 virtual void initMergeThreadPriority();
84 virtual int32_t mergeThreadCount();
85
87 virtual void doMerge(OneMergePtr merge);
88
89 virtual MergeThreadPtr getMergeThread(IndexWriterPtr writer, OneMergePtr merge);
90
92 virtual void handleMergeException(const LuceneException& exc);
93
94 virtual void addMyself();
95
96 friend class MergeThread;
97 };
98 }
99
100 #endif

clucene.sourceforge.net