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


Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
Lucene::IndexCommit Class Referenceabstract

Represents a single commit into an index as seen by the IndexDeletionPolicy or IndexReader. More...

#include <IndexCommit.h>

+ Inheritance diagram for Lucene::IndexCommit:

Public Member Functions

virtual ~IndexCommit ()
 
virtual String getClassName ()
 
boost::shared_ptr< IndexCommitshared_from_this ()
 
virtual String getSegmentsFileName ()=0
 Get the segments file (segments_N) associated with this commit point.
 
virtual HashSet< String > getFileNames ()=0
 Returns all index files referenced by this commit point.
 
virtual DirectoryPtr getDirectory ()=0
 Returns the Directory for the index.
 
virtual void deleteCommit ()=0
 Delete this commit point. This only applies when using the commit point in the context of IndexWriter's IndexDeletionPolicy.
 
virtual bool isDeleted ()=0
 
virtual bool isOptimized ()=0
 Returns true if this commit is an optimized index.
 
virtual bool equals (const LuceneObjectPtr &other)
 Two IndexCommits are equal if both their Directory and versions are equal.
 
virtual int32_t hashCode ()
 Return hash code for this object.
 
virtual int64_t getVersion ()=0
 Returns the version for this IndexCommit. This is the same value that IndexReader#getVersion would return if it were opened on this commit.
 
virtual int64_t getGeneration ()=0
 Returns the generation (the _N in segments_N) for this IndexCommit.
 
virtual int64_t getTimestamp ()
 Convenience method that returns the last modified time of the segments_N file corresponding to this index commit, equivalent to getDirectory()->fileModified(getSegmentsFileName()).
 
virtual MapStringString getUserData ()=0
 Returns userData, previously passed to IndexWriter#commit(Map) for this commit. Map is String -> String.
 
- Public Member Functions inherited from Lucene::LuceneObject
virtual ~LuceneObject ()
 
virtual void initialize ()
 Called directly after instantiation to create objects that depend on this object being fully constructed.
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Return clone of this object.
 
virtual int32_t compareTo (const LuceneObjectPtr &other)
 Compare two objects.
 
virtual String toString ()
 Returns a string representation of the object.
 
- Public Member Functions inherited from Lucene::LuceneSync
virtual ~LuceneSync ()
 
virtual SynchronizePtr getSync ()
 Return this object synchronize lock.
 
virtual LuceneSignalPtr getSignal ()
 Return this object signal.
 
virtual void lock (int32_t timeout=0)
 Lock this object using an optional timeout.
 
virtual void unlock ()
 Unlock this object.
 
virtual bool holdsLock ()
 Returns true if this object is currently locked by current thread.
 
virtual void wait (int32_t timeout=0)
 Wait for signal using an optional timeout.
 
virtual void notifyAll ()
 Notify all threads waiting for signal.
 

Static Public Member Functions

static String _getClassName ()
 

Additional Inherited Members

- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
 
- Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
 
LuceneSignalPtr objectSignal
 

Detailed Description

Represents a single commit into an index as seen by the IndexDeletionPolicy or IndexReader.

Changes to the content of an index are made visible only after the writer who made that change commits by writing a new segments file (segments_N). This point in time, when the action of writing of a new segments file to the directory is completed, is an index commit.

Each index commit point has a unique segments file associated with it. The segments file associated with a later index commit point would have a larger N.

Constructor & Destructor Documentation

◆ ~IndexCommit()

virtual Lucene::IndexCommit::~IndexCommit ( )
virtual

Member Function Documentation

◆ _getClassName()

static String Lucene::IndexCommit::_getClassName ( )
inlinestatic

◆ deleteCommit()

virtual void Lucene::IndexCommit::deleteCommit ( )
pure virtual

Delete this commit point. This only applies when using the commit point in the context of IndexWriter's IndexDeletionPolicy.

Upon calling this, the writer is notified that this commit point should be deleted.

Decision that a commit-point should be deleted is taken by the IndexDeletionPolicy in effect and therefore this should only be called by its onInit() or onCommit() methods.

Implemented in Lucene::ReaderCommit, and Lucene::CommitPoint.

◆ equals()

virtual bool Lucene::IndexCommit::equals ( const LuceneObjectPtr other)
virtual

Two IndexCommits are equal if both their Directory and versions are equal.

Reimplemented from Lucene::LuceneObject.

◆ getClassName()

virtual String Lucene::IndexCommit::getClassName ( )
inlinevirtual

Reimplemented in Lucene::ReaderCommit, and Lucene::CommitPoint.

◆ getDirectory()

virtual DirectoryPtr Lucene::IndexCommit::getDirectory ( )
pure virtual

Returns the Directory for the index.

Implemented in Lucene::ReaderCommit, and Lucene::CommitPoint.

◆ getFileNames()

virtual HashSet< String > Lucene::IndexCommit::getFileNames ( )
pure virtual

Returns all index files referenced by this commit point.

Implemented in Lucene::ReaderCommit, and Lucene::CommitPoint.

◆ getGeneration()

virtual int64_t Lucene::IndexCommit::getGeneration ( )
pure virtual

Returns the generation (the _N in segments_N) for this IndexCommit.

Implemented in Lucene::ReaderCommit, and Lucene::CommitPoint.

◆ getSegmentsFileName()

virtual String Lucene::IndexCommit::getSegmentsFileName ( )
pure virtual

Get the segments file (segments_N) associated with this commit point.

Implemented in Lucene::ReaderCommit, and Lucene::CommitPoint.

◆ getTimestamp()

virtual int64_t Lucene::IndexCommit::getTimestamp ( )
virtual

Convenience method that returns the last modified time of the segments_N file corresponding to this index commit, equivalent to getDirectory()->fileModified(getSegmentsFileName()).

◆ getUserData()

virtual MapStringString Lucene::IndexCommit::getUserData ( )
pure virtual

Returns userData, previously passed to IndexWriter#commit(Map) for this commit. Map is String -> String.

Implemented in Lucene::ReaderCommit, and Lucene::CommitPoint.

◆ getVersion()

virtual int64_t Lucene::IndexCommit::getVersion ( )
pure virtual

Returns the version for this IndexCommit. This is the same value that IndexReader#getVersion would return if it were opened on this commit.

Implemented in Lucene::ReaderCommit, and Lucene::CommitPoint.

◆ hashCode()

virtual int32_t Lucene::IndexCommit::hashCode ( )
virtual

Return hash code for this object.

Reimplemented from Lucene::LuceneObject.

◆ isDeleted()

virtual bool Lucene::IndexCommit::isDeleted ( )
pure virtual

◆ isOptimized()

virtual bool Lucene::IndexCommit::isOptimized ( )
pure virtual

Returns true if this commit is an optimized index.

Implemented in Lucene::ReaderCommit, and Lucene::CommitPoint.

◆ shared_from_this()

boost::shared_ptr< IndexCommit > Lucene::IndexCommit::shared_from_this ( )
inline

The documentation for this class was generated from the following file:

clucene.sourceforge.net