Lucene++ - a full-featured, c++ search engine
API Documentation
Go to the documentation of this file.
7 #ifndef INDEXFILEDELETER_H
8 #define INDEXFILEDELETER_H
94 void refresh(
const String& segmentName);
114 void incRef(
const String& fileName);
116 void decRef(
const String& fileName);
119 bool exists(
const String& fileName);
void checkpoint(const SegmentInfosPtr &segmentInfos, bool isCommit)
For definition of "check point" see IndexWriter comments: "Clarification: Check Points (and commits)"...
void decRef(HashSet< String > files)
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
int64_t gen
Definition: IndexFileDeleter.h:154
MapStringString userData
Definition: IndexFileDeleter.h:166
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
String segmentsFileName
Definition: IndexFileDeleter.h:159
HashSet< String > synced
Definition: IndexFileDeleter.h:68
SegmentInfosPtr getLastSegmentInfos()
boost::shared_ptr< DocumentsWriter > DocumentsWriterPtr
Definition: LuceneTypes.h:123
void deleteNewFiles(HashSet< String > files)
Deletes the specified files, but only if they are new (have not yet been incref'd).
virtual MapStringString getUserData()
Returns userData, previously passed to IndexWriter#commit(Map) for this commit.
DocumentsWriterPtr docWriter
Definition: IndexFileDeleter.h:65
boost::shared_ptr< RefCount > RefCountPtr
Definition: LuceneTypes.h:206
Collection< CommitPointPtr > commitsToDelete
Commits that the IndexDeletionPolicy have decided to delete.
Definition: IndexFileDeleter.h:60
Collection< CommitPointPtr > commitsToDelete
Definition: IndexFileDeleter.h:162
void message(const String &message)
MapStringRefCount refCounts
Reference count for all files in the index. Counts how many existing commits reference a file.
Definition: IndexFileDeleter.h:49
int64_t version
Definition: IndexFileDeleter.h:163
DirectoryPtr directory
Definition: IndexFileDeleter.h:63
void incRef(const SegmentInfosPtr &segmentInfos, bool isCommit)
void deletePendingFiles()
virtual int32_t compareTo(const LuceneObjectPtr &other)
Compare two objects.
virtual HashSet< String > getFileNames()
Returns all index files referenced by this commit point.
bool _isOptimized
Definition: IndexFileDeleter.h:165
virtual int64_t getVersion()
Returns the version for this IndexCommit.
Definition: AbstractAllTermDocs.h:12
int64_t generation
Definition: IndexFileDeleter.h:164
Tracks the reference count for a single index file.
Definition: IndexFileDeleter.h:130
Base class for all Lucene classes.
Definition: LuceneObject.h:31
This class keeps track of each SegmentInfos instance that is still "live", either because it correspo...
Definition: IndexFileDeleter.h:34
String fileName
Definition: IndexFileDeleter.h:135
void deleteCommits()
Remove the CommitPoints in the commitsToDelete List by DecRef'ing all files from each SegmentInfos.
InfoStreamPtr infoStream
Definition: IndexFileDeleter.h:62
HashSet< String > files
Definition: IndexFileDeleter.h:158
bool initDone
Definition: IndexFileDeleter.h:139
virtual bool isOptimized()
Returns true if this commit is an optimized index.
virtual String getSegmentsFileName()
Get the segments file (segments_N) associated with this commit point.
virtual DirectoryPtr getDirectory()
Returns the Directory for the index.
virtual void deleteCommit()
Called only be the deletion policy, to remove this commit point from the index.
SegmentInfosPtr lastSegmentInfos
Definition: IndexFileDeleter.h:67
Represents a single commit into an index as seen by the IndexDeletionPolicy or IndexReader.
Definition: IndexCommit.h:22
boost::shared_ptr< IndexDeletionPolicy > IndexDeletionPolicyPtr
Definition: LuceneTypes.h:153
virtual String toString()
Returns a string representation of the object.
bool deleted
Definition: IndexFileDeleter.h:160
Collection< IndexCommitPtr > commits
Holds all commits (segments_N) currently in the index. This will have just 1 commit if you are using ...
Definition: IndexFileDeleter.h:54
boost::shared_ptr< SegmentInfos > SegmentInfosPtr
Definition: LuceneTypes.h:210
DirectoryPtr directory
Definition: IndexFileDeleter.h:161
RefCount(const String &fileName)
virtual ~IndexFileDeleter()
boost::shared_ptr< Directory > DirectoryPtr
Definition: LuceneTypes.h:489
void setInfoStream(const InfoStreamPtr &infoStream)
HashSet< String > deletable
Files that we tried to delete but failed (likely because they are open and we are running on Windows)...
Definition: IndexFileDeleter.h:41
boost::shared_ptr< InfoStream > InfoStreamPtr
Definition: LuceneTypes.h:532
static bool VERBOSE_REF_COUNTS
Change to true to see details of reference counts when infoStream != null.
Definition: IndexFileDeleter.h:71
bool startingCommitDeleted
Definition: IndexFileDeleter.h:74
IndexDeletionPolicyPtr policy
Definition: IndexFileDeleter.h:64
CommitPoint(Collection< CommitPointPtr > commitsToDelete, const DirectoryPtr &directory, const SegmentInfosPtr &segmentInfos)
int32_t count
Definition: IndexFileDeleter.h:140
void deleteFiles(HashSet< String > files)
void deleteFile(const String &fileName)
Holds details for each commit point. This class is also passed to the deletion policy....
Definition: IndexFileDeleter.h:149
RefCountPtr getRefCount(const String &fileName)
bool exists(const String &fileName)
virtual int64_t getGeneration()
Returns the generation (the _N in segments_N) for this IndexCommit.
IndexFileDeleter(const DirectoryPtr &directory, const IndexDeletionPolicyPtr &policy, const SegmentInfosPtr &segmentInfos, const InfoStreamPtr &infoStream, const DocumentsWriterPtr &docWriter, HashSet< String > synced)
Initialize the deleter: find all previous commits in the Directory, incref the files they reference,...
Collection< HashSet< String > > lastFiles
Holds files we had incref'd from the previous non-commit checkpoint.
Definition: IndexFileDeleter.h:57
clucene.sourceforge.net