61 static int32_t defaultGenFileRetryCount;
62 static int32_t defaultGenFileRetryPauseMsec;
63 static int32_t defaultGenLookaheadCount;
71 int64_t lastGeneration;
75 MapStringString userData;
77 static MapStringString singletonUserData;
178 friend class FindSegmentsFile;
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Utility template class to handle hash set collections that can be safely copied and shared.
Definition HashSet.h:17
A collection of SegmentInfo objects to be used as a base class for SegmentInfos.
Definition SegmentInfoCollection.h:15
A collection of SegmentInfo objects with methods for operating on those segments in relation to the f...
Definition SegmentInfos.h:15
static void setDefaultGenFileRetryCount(int32_t count)
Set how many times to try loading the segments.gen file contents to determine current segment generat...
static int32_t getDefaultGenLookahedCount()
static const int32_t FORMAT
The file format version, a negative number. Works since counter, the old 1st entry,...
Definition SegmentInfos.h:24
static int64_t generationFromSegmentsFileName(const String &fileName)
static int32_t getDefaultGenFileRetryCount()
void commit(const DirectoryPtr &dir)
Writes & syncs to the Directory dir, taking care to remove the segments file on exception.
bool hasExternalSegments(const DirectoryPtr &dir)
static const int32_t FORMAT_LOCKLESS
This format adds details used for lockless commits. It differs slightly from the previous format in t...
Definition SegmentInfos.h:30
static const int32_t FORMAT_SHARED_DOC_STORE
This format allows multiple segments to share a single vectors and stored fields file.
Definition SegmentInfos.h:36
int64_t getVersion()
Version number when this SegmentInfos was generated.
static const int32_t FORMAT_SINGLE_NORM_FILE
This format adds a "hasSingleNormFile" flag into each segment info.
Definition SegmentInfos.h:33
static const int32_t FORMAT_HAS_PROX
This format adds the boolean hasProx to record if any fields in the segment store prox information (i...
Definition SegmentInfos.h:46
static void setDefaultGenFileRetryPauseMsec(int32_t msec)
Set how many milliseconds to pause in between attempts to load the segments.gen file.
void write(const DirectoryPtr &directory)
static int64_t getCurrentSegmentGeneration(HashSet< String > files)
static MapStringString readCurrentUserData(const DirectoryPtr &directory)
Returns userData from latest segments file.
static void setDefaultGenLookaheadCount(int32_t count)
Set how many times to try incrementing the gen when loading the segments file. This only runs if the ...
static String getCurrentSegmentFileName(const DirectoryPtr &directory)
void rollbackCommit(const DirectoryPtr &dir)
String getNextSegmentFileName()
void finishCommit(const DirectoryPtr &dir)
static int64_t getCurrentSegmentGeneration(const DirectoryPtr &directory)
static InfoStreamPtr getInfoStream()
void read(const DirectoryPtr &directory, const String &segmentFileName)
Read a particular segmentFileName. Note that this may throw an IOException if a commit is in process.
void replace(const SegmentInfosPtr &other)
Replaces all segments in this instance, but keeps generation, version, counter so that future commits...
String segString(const DirectoryPtr &directory)
void setUserData(MapStringString data)
SegmentInfosPtr range(int32_t first, int32_t last)
Returns a new SegmentInfos containing the SegmentInfo instances in the specified range first (inclusi...
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a copy of this instance, also copying each SegmentInfo.
static const int32_t FORMAT_DEL_COUNT
This format adds the deletion count for each segment. This way IndexWriter can efficiently report num...
Definition SegmentInfos.h:42
HashSet< String > files(const DirectoryPtr &dir, bool includeSegmentsFile)
Returns all file names referenced by SegmentInfo instances matching the provided Directory (ie files ...
int32_t counter
Definition SegmentInfos.h:57
void read(const DirectoryPtr &directory)
This version of read uses the retry logic (for lock-less commits) to find the right segments file to ...
static void message(const String &message)
static void setInfoStream(const InfoStreamPtr &infoStream)
If non-null, information about retries when loading the segments file will be printed to this.
int64_t getLastGeneration()
static const int32_t FORMAT_CHECKSUM
This format adds a checksum at the end of the file to ensure all bytes were successfully written.
Definition SegmentInfos.h:39
static int32_t getDefaultGenFileRetryPauseMsec()
MapStringString getUserData()
static int64_t readCurrentVersion(const DirectoryPtr &directory)
Current version number from segments file.
SegmentInfoPtr info(int32_t i)
void updateGeneration(const SegmentInfosPtr &other)
Carry over generation numbers from another SegmentInfos.
String getCurrentSegmentFileName()
static String getCurrentSegmentFileName(HashSet< String > files)
static const int32_t FORMAT_DIAGNOSTICS
This format adds optional per-segment string diagnostics storage, and switches userData to Map.
Definition SegmentInfos.h:52
void prepareCommit(const DirectoryPtr &dir)
Call this to start a commit. This writes the new segments file, but writes an invalid checksum at the...
static const int32_t CURRENT_FORMAT
This must always point to the most recent file format.
Definition SegmentInfos.h:55
static const int32_t FORMAT_USER_DATA
This format adds optional commit userData storage.
Definition SegmentInfos.h:49
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< InfoStream > InfoStreamPtr
Definition LuceneTypes.h:532
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
boost::shared_ptr< SegmentInfo > SegmentInfoPtr
Definition LuceneTypes.h:208
boost::shared_ptr< ChecksumIndexOutput > ChecksumIndexOutputPtr
Definition LuceneTypes.h:488
boost::shared_ptr< Directory > DirectoryPtr
Definition LuceneTypes.h:489
boost::shared_ptr< SegmentInfos > SegmentInfosPtr
Definition LuceneTypes.h:210