range(int first, int last) Returns a new SegmentInfos containg the SegmentInfo
instances in the specified range first (inclusive) to
last (exclusive), so total number of segments returned
is last-first.
final public void
read(Directory directory, String segmentFileName) Read a particular segmentFileName.
final public void
read(Directory directory) This version of read uses the retry logic (for lock-less
commits) to find the right segments file to load.
setDefaultGenFileRetryCount(int count) Advanced: set how many times to try loading the
segments.gen file contents to determine current segment
generation.
public static void
setDefaultGenFileRetryPauseMsec(int msec) Advanced: set how many milliseconds to pause in between
attempts to load the segments.gen file.
public static void
setDefaultGenLookaheadCount(int count) Advanced: set how many times to try incrementing the
gen when loading the segments file.
public static void
setInfoStream(PrintStream infoStream) If non-null, information about retries when loading
the segments file will be printed to this.
This format adds details used for lockless commits. It differs
slightly from the previous format in that file names
are never re-used (write once). Instead, each file is
written to the next generation. For example,
segments_1, segments_2, etc. This allows us to not use
a commit lock. See file
formats for details.
FORMAT_SHARED_DOC_STORE
final public static int FORMAT_SHARED_DOC_STORE(Code)
This format allows multiple segments to share a single
vectors and stored fields file.
FORMAT_SINGLE_NORM_FILE
final public static int FORMAT_SINGLE_NORM_FILE(Code)
This format adds a "hasSingleNormFile" flag into each segment info.
See LUCENE-756
for details.
Returns a new SegmentInfos containg the SegmentInfo
instances in the specified range first (inclusive) to
last (exclusive), so total number of segments returned
is last-first.
Read a particular segmentFileName. Note that this may
throw an IOException if a commit is in process.
Parameters: directory - -- directory containing the segments file Parameters: segmentFileName - -- segment file to load throws: CorruptIndexException - if the index is corrupt throws: IOException - if there is a low-level IO error
This version of read uses the retry logic (for lock-less
commits) to find the right segments file to load.
throws: CorruptIndexException - if the index is corrupt throws: IOException - if there is a low-level IO error
Current version number from segments file.
throws: CorruptIndexException - if the index is corrupt throws: IOException - if there is a low-level IO error
setDefaultGenFileRetryCount
public static void setDefaultGenFileRetryCount(int count)(Code)
Advanced: set how many times to try loading the
segments.gen file contents to determine current segment
generation. This file is only referenced when the
primary method (listing the directory) fails.
setDefaultGenFileRetryPauseMsec
public static void setDefaultGenFileRetryPauseMsec(int msec)(Code)
Advanced: set how many milliseconds to pause in between
attempts to load the segments.gen file.
setDefaultGenLookaheadCount
public static void setDefaultGenLookaheadCount(int count)(Code)
Advanced: set how many times to try incrementing the
gen when loading the segments file. This only runs if
the primary (listing directory) and secondary (opening
segments.gen file) methods fail to find the segments
file.