C# Class Lucene.Net.Index.SegmentInfos

Inheritance: System.Collections.ArrayList
Afficher le fichier Open project: paulirwin/lucene.net Class Usage Examples

Méthodes publiques

Свойство Type Description
Counter int

Méthodes publiques

Méthode Description
Add ( Lucene.Net.Index.SegmentCommitInfo si ) : void

Appends the provided SegmentCommitInfo.

AddAll ( IEnumerable sis ) : void

Appends the provided SegmentCommitInfos.

AsList ( ) : IList

Returns all contained segments as an unmodifiable List view.

Changed ( ) : void

Call this before committing if changes have been made to the segments.

Clear ( ) : void

Clear all SegmentCommitInfos.

Clone ( ) : object

Returns a copy of this instance, also copying each SegmentInfo.

Files ( Directory dir, bool includeSegmentsFile ) : ICollection

Returns all file names referenced by SegmentInfo instances matching the provided Directory (ie files associated with any "external" segments are skipped). The returned collection is recomputed on each invocation.

GenerationFromSegmentsFileName ( string fileName ) : long

Parse the generation off the segments file name and return it.

GetLastCommitGeneration ( Directory directory ) : long

Get the generation of the most recent commit to the index in this directory (N in the segments_N file).

GetLastCommitGeneration ( string files ) : long

Get the generation of the most recent commit to the list of index files (N in the segments_N file).

GetLastCommitSegmentsFileName ( Directory directory ) : string

Get the filename of the segments_N file for the most recent commit to the index in this Directory.

GetLastCommitSegmentsFileName ( string files ) : string

Get the filename of the segments_N file for the most recent commit in the list of index files.

Info ( int i ) : Lucene.Net.Index.SegmentCommitInfo

Returns SegmentCommitInfo at the provided index.

Read ( Directory directory ) : void

Find the latest commit ({@code segments_N file}) and load all SegmentCommitInfos.

Read ( Directory directory, string segmentFileName ) : void

Read a particular segmentFileName. Note that this may throw an IOException if a commit is in process.

Remove ( Lucene.Net.Index.SegmentCommitInfo si ) : void

Remove the provided SegmentCommitInfo.

WARNING: O(N) cost

SegmentInfos ( ) : System

Sole constructor. Typically you call this and then use {@link #read(Directory) or #read(Directory,String)} to populate each {@link SegmentCommitInfo}. Alternatively, you can add/remove your own SegmentCommitInfos.

Size ( ) : int

Returns number of SegmentCommitInfos.

ToString ( Directory directory ) : string

Returns readable description of this segment.

TotalDocCount ( ) : int

Returns sum of all segment's docCounts. Note that this does not include deletions

WriteSegmentsGen ( Directory dir, long generation ) : void

A utility for writing the IndexFileNames#SEGMENTS_GEN file to a Directory.

NOTE: this is an internal utility which is kept public so that it's accessible by code from other packages. You should avoid calling this method unless you're absolutely sure what you're doing! @lucene.internal

Private Methods

Méthode Description
ApplyMergeChanges ( MergePolicy merge, bool dropSegment ) : void

applies all changes caused by committing a merge to this SegmentInfos

Commit ( Directory dir ) : void

Writes & syncs to the Directory dir, taking care to remove the segments file on exception

Note: #changed() should be called prior to this method if changes have been made to this SegmentInfos instance

Contains ( Lucene.Net.Index.SegmentCommitInfo si ) : bool

Return true if the provided {@link SegmentCommitInfo} is contained.

WARNING: O(N) cost

CreateBackupSegmentInfos ( ) : IList
FinishCommit ( Directory dir ) : void
IndexOf ( Lucene.Net.Index.SegmentCommitInfo si ) : int

Returns index of the provided {@link SegmentCommitInfo}.

WARNING: O(N) cost

Message ( string message ) : void

Prints the given message to the infoStream. Note, this method does not check for null infoStream. It assumes this check has been performed by the caller, which is recommended to avoid the (usually) expensive message creation.

PrepareCommit ( Directory dir ) : void

Call this to start a commit. this writes the new segments file, but writes an invalid checksum at the end, so that it is not visible to readers. Once this is called you must call #finishCommit to complete the commit or #rollbackCommit to abort it.

Note: #changed() should be called prior to this method if changes have been made to this SegmentInfos instance

Remove ( int index ) : void

Remove the SegmentCommitInfo at the provided index.

WARNING: O(N) cost

Replace ( SegmentInfos other ) : void

Replaces all segments in this instance, but keeps generation, version, counter so that future commits remain write once.

RollbackCommit ( Directory dir ) : void
RollbackSegmentInfos ( IList infos ) : void
SegmentWasUpgraded ( Directory directory, SegmentInfo si ) : bool
UpdateGeneration ( SegmentInfos other ) : void
Write ( Directory directory ) : void
Write3xInfo ( Directory dir, SegmentInfo si, IOContext context ) : string

Method Details

Add() public méthode

Appends the provided SegmentCommitInfo.
public Add ( Lucene.Net.Index.SegmentCommitInfo si ) : void
si Lucene.Net.Index.SegmentCommitInfo
Résultat void

AddAll() public méthode

Appends the provided SegmentCommitInfos.
public AddAll ( IEnumerable sis ) : void
sis IEnumerable
Résultat void

AsList() public méthode

Returns all contained segments as an unmodifiable List view.
public AsList ( ) : IList
Résultat IList

Changed() public méthode

Call this before committing if changes have been made to the segments.
public Changed ( ) : void
Résultat void

Clear() public méthode

Clear all SegmentCommitInfos.
public Clear ( ) : void
Résultat void

Clone() public méthode

Returns a copy of this instance, also copying each SegmentInfo.
public Clone ( ) : object
Résultat object

Files() public méthode

Returns all file names referenced by SegmentInfo instances matching the provided Directory (ie files associated with any "external" segments are skipped). The returned collection is recomputed on each invocation.
public Files ( Directory dir, bool includeSegmentsFile ) : ICollection
dir Directory
includeSegmentsFile bool
Résultat ICollection

GenerationFromSegmentsFileName() public static méthode

Parse the generation off the segments file name and return it.
public static GenerationFromSegmentsFileName ( string fileName ) : long
fileName string
Résultat long

GetLastCommitGeneration() public static méthode

Get the generation of the most recent commit to the index in this directory (N in the segments_N file).
public static GetLastCommitGeneration ( Directory directory ) : long
directory Directory -- directory to search for the latest segments_N file
Résultat long

GetLastCommitGeneration() public static méthode

Get the generation of the most recent commit to the list of index files (N in the segments_N file).
public static GetLastCommitGeneration ( string files ) : long
files string -- array of file names to check
Résultat long

GetLastCommitSegmentsFileName() public static méthode

Get the filename of the segments_N file for the most recent commit to the index in this Directory.
public static GetLastCommitSegmentsFileName ( Directory directory ) : string
directory Directory -- directory to search for the latest segments_N file
Résultat string

GetLastCommitSegmentsFileName() public static méthode

Get the filename of the segments_N file for the most recent commit in the list of index files.
public static GetLastCommitSegmentsFileName ( string files ) : string
files string -- array of file names to check
Résultat string

Info() public méthode

Returns SegmentCommitInfo at the provided index.
public Info ( int i ) : Lucene.Net.Index.SegmentCommitInfo
i int
Résultat Lucene.Net.Index.SegmentCommitInfo

Read() public méthode

Find the latest commit ({@code segments_N file}) and load all SegmentCommitInfos.
public Read ( Directory directory ) : void
directory Directory
Résultat void

Read() public méthode

Read a particular segmentFileName. Note that this may throw an IOException if a commit is in process.
if the index is corrupt if there is a low-level IO error
public Read ( Directory directory, string segmentFileName ) : void
directory Directory -- directory containing the segments file
segmentFileName string -- segment file to load
Résultat void

Remove() public méthode

Remove the provided SegmentCommitInfo.

WARNING: O(N) cost

public Remove ( Lucene.Net.Index.SegmentCommitInfo si ) : void
si Lucene.Net.Index.SegmentCommitInfo
Résultat void

SegmentInfos() public méthode

Sole constructor. Typically you call this and then use {@link #read(Directory) or #read(Directory,String)} to populate each {@link SegmentCommitInfo}. Alternatively, you can add/remove your own SegmentCommitInfos.
public SegmentInfos ( ) : System
Résultat System

Size() public méthode

Returns number of SegmentCommitInfos.
public Size ( ) : int
Résultat int

ToString() public méthode

Returns readable description of this segment.
public ToString ( Directory directory ) : string
directory Directory
Résultat string

TotalDocCount() public méthode

Returns sum of all segment's docCounts. Note that this does not include deletions
public TotalDocCount ( ) : int
Résultat int

WriteSegmentsGen() public static méthode

A utility for writing the IndexFileNames#SEGMENTS_GEN file to a Directory.

NOTE: this is an internal utility which is kept public so that it's accessible by code from other packages. You should avoid calling this method unless you're absolutely sure what you're doing! @lucene.internal

public static WriteSegmentsGen ( Directory dir, long generation ) : void
dir Directory
generation long
Résultat void

Property Details

Counter public_oe property

Used to name new segments.
public int Counter
Résultat int