C# 클래스 Lucene.Net.Index.SegmentInfos

상속: System.Collections.ArrayList
파일 보기 프로젝트 열기: paulirwin/lucene.net 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Counter int

공개 메소드들

메소드 설명
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

비공개 메소드들

메소드 설명
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

메소드 상세

Add() 공개 메소드

Appends the provided SegmentCommitInfo.
public Add ( Lucene.Net.Index.SegmentCommitInfo si ) : void
si Lucene.Net.Index.SegmentCommitInfo
리턴 void

AddAll() 공개 메소드

Appends the provided SegmentCommitInfos.
public AddAll ( IEnumerable sis ) : void
sis IEnumerable
리턴 void

AsList() 공개 메소드

Returns all contained segments as an unmodifiable List view.
public AsList ( ) : IList
리턴 IList

Changed() 공개 메소드

Call this before committing if changes have been made to the segments.
public Changed ( ) : void
리턴 void

Clear() 공개 메소드

Clear all SegmentCommitInfos.
public Clear ( ) : void
리턴 void

Clone() 공개 메소드

Returns a copy of this instance, also copying each SegmentInfo.
public Clone ( ) : object
리턴 object

Files() 공개 메소드

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
리턴 ICollection

GenerationFromSegmentsFileName() 공개 정적인 메소드

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

GetLastCommitGeneration() 공개 정적인 메소드

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
리턴 long

GetLastCommitGeneration() 공개 정적인 메소드

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
리턴 long

GetLastCommitSegmentsFileName() 공개 정적인 메소드

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
리턴 string

GetLastCommitSegmentsFileName() 공개 정적인 메소드

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
리턴 string

Info() 공개 메소드

Returns SegmentCommitInfo at the provided index.
public Info ( int i ) : Lucene.Net.Index.SegmentCommitInfo
i int
리턴 Lucene.Net.Index.SegmentCommitInfo

Read() 공개 메소드

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

Read() 공개 메소드

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
리턴 void

Remove() 공개 메소드

Remove the provided SegmentCommitInfo.

WARNING: O(N) cost

public Remove ( Lucene.Net.Index.SegmentCommitInfo si ) : void
si Lucene.Net.Index.SegmentCommitInfo
리턴 void

SegmentInfos() 공개 메소드

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
리턴 System

Size() 공개 메소드

Returns number of SegmentCommitInfos.
public Size ( ) : int
리턴 int

ToString() 공개 메소드

Returns readable description of this segment.
public ToString ( Directory directory ) : string
directory Directory
리턴 string

TotalDocCount() 공개 메소드

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

WriteSegmentsGen() 공개 정적인 메소드

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
리턴 void

프로퍼티 상세

Counter 공개적으로 프로퍼티

Used to name new segments.
public int Counter
리턴 int