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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
IndexFileDeleter.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 INDEXFILEDELETER_H
8 #define INDEXFILEDELETER_H
9 
10 #include "IndexCommit.h"
11 
12 namespace Lucene {
13 
35 public:
39  virtual ~IndexFileDeleter();
40 
42 
43 protected:
47 
49  MapStringRefCount refCounts;
50 
55 
58 
61 
66 
69 
71  static bool VERBOSE_REF_COUNTS;
72 
73 public:
75 
76 protected:
77  void message(const String& message);
78 
80  void deleteCommits();
81 
82  void deletePendingFiles();
83 
84  RefCountPtr getRefCount(const String& fileName);
85 
86 public:
87  void setInfoStream(const InfoStreamPtr& infoStream);
88 
90 
94  void refresh(const String& segmentName);
95  void refresh();
96 
97  void close();
98 
110  void checkpoint(const SegmentInfosPtr& segmentInfos, bool isCommit);
111 
112  void incRef(const SegmentInfosPtr& segmentInfos, bool isCommit);
113  void incRef(HashSet<String> files);
114  void incRef(const String& fileName);
115  void decRef(HashSet<String> files);
116  void decRef(const String& fileName);
117  void decRef(const SegmentInfosPtr& segmentInfos);
118 
119  bool exists(const String& fileName);
120 
121  void deleteFiles(HashSet<String> files);
122 
124  void deleteNewFiles(HashSet<String> files);
125 
126  void deleteFile(const String& fileName);
127 };
128 
130 class RefCount : public LuceneObject {
131 public:
132  RefCount(const String& fileName);
133  virtual ~RefCount();
134 
136 
137 public:
138  String fileName; // fileName used only for better assert error messages
139  bool initDone;
140  int32_t count;
141 
142 public:
143  int32_t IncRef();
144  int32_t DecRef();
145 };
146 
149 class CommitPoint : public IndexCommit {
150 public:
152  virtual ~CommitPoint();
153 
155 
156 public:
157  int64_t gen;
160  bool deleted;
163  int64_t version;
164  int64_t generation;
166  MapStringString userData;
167 
168 public:
169  virtual String toString();
170 
172  virtual bool isOptimized();
173 
175  virtual String getSegmentsFileName();
176 
178  virtual HashSet<String> getFileNames();
179 
181  virtual DirectoryPtr getDirectory();
182 
184  virtual int64_t getVersion();
185 
187  virtual int64_t getGeneration();
188 
190  virtual MapStringString getUserData();
191 
193  virtual void deleteCommit();
194 
195  virtual bool isDeleted();
196 
197  virtual int32_t compareTo(const LuceneObjectPtr& other);
198 };
199 
200 }
201 
202 #endif

clucene.sourceforge.net