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

This class implements a {@link MergePolicy} that tries to merge segments into levels of exponentially increasing size, where each level has < mergeFactor segments in it. Whenever a given levle has mergeFactor segments or more in it, they will be merged.

This class is abstract and requires a subclass to define the {@link #size} method which specifies how a segment's size is determined. {@link LogDocMergePolicy} is one subclass that measures size by document count in the segment. {@link LogByteSizeMergePolicy} is another subclass that measures size as the total byte size of the file(s) for the segment.

상속: MergePolicy
파일 보기 프로젝트 열기: synhershko/lucene.net 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
DEFAULT_MAX_MERGE_DOCS int
DEFAULT_NO_CFS_RATIO double

보호된 프로퍼티들

프로퍼티 타입 설명
internalCalibrateSizeByDeletes bool
internalNoCFSRatio double

공개 메소드들

메소드 설명
FindMerges ( SegmentInfos infos ) : MergeSpecification

Checks if any merges are now necessary and returns a MergePolicy.MergeSpecification if so. A merge is necessary when there are more than SetMergeFactor segments at a given level. When multiple levels have too many segments, this method will return multiple merges, allowing the MergeScheduler to use concurrency.

FindMergesForOptimize ( SegmentInfos infos, int maxNumSegments, ISet segmentsToOptimize ) : MergeSpecification

Returns the merges necessary to optimize the index. This merge policy defines "optimized" to mean only one segment in the index, where that segment has no deletions pending nor separate norms, and it is in compound file format if the current useCompoundFile setting is true. This method returns multiple merges (mergeFactor at a time) so the MergeScheduler in use may make use of concurrency.

FindMergesToExpungeDeletes ( SegmentInfos segmentInfos ) : MergeSpecification

Finds merges necessary to expunge all deletes from the index. We simply merge adjacent segments that have deletes, up to mergeFactor at a time.

SetUseCompoundDocStore ( bool useCompoundDocStore ) : void

Sets whether compound file format should be used for newly flushed and newly merged doc store segment files (term vectors and stored fields).

SetUseCompoundFile ( bool useCompoundFile ) : void

Gets or sets whether compound file format should be used for newly flushed and newly merged segments.

UseCompoundDocStore ( SegmentInfos infos ) : bool
UseCompoundFile ( SegmentInfos infos, SegmentInfo info ) : bool

보호된 메소드들

메소드 설명
LogMergePolicy ( IndexWriter writer ) : System
MakeOneMerge ( SegmentInfos infos, SegmentInfos infosToMerge ) : OneMerge
Size ( SegmentInfo info ) : long
SizeBytes ( SegmentInfo info ) : long
SizeDocs ( SegmentInfo info ) : long
Verbose ( ) : bool

비공개 메소드들

메소드 설명
GetUseCompoundDocStore ( ) : bool
GetUseCompoundFile ( ) : bool
IsOptimized ( SegmentInfo info ) : bool

Returns true if this single info is optimized (has no pending norms or deletes, is in the same dir as the writer, and matches the current compound file setting

IsOptimized ( SegmentInfos infos, int maxNumSegments, ISet segmentsToOptimize ) : bool
Message ( System message ) : void

메소드 상세

FindMerges() 공개 메소드

Checks if any merges are now necessary and returns a MergePolicy.MergeSpecification if so. A merge is necessary when there are more than SetMergeFactor segments at a given level. When multiple levels have too many segments, this method will return multiple merges, allowing the MergeScheduler to use concurrency.
public FindMerges ( SegmentInfos infos ) : MergeSpecification
infos SegmentInfos
리턴 MergeSpecification

FindMergesForOptimize() 공개 메소드

Returns the merges necessary to optimize the index. This merge policy defines "optimized" to mean only one segment in the index, where that segment has no deletions pending nor separate norms, and it is in compound file format if the current useCompoundFile setting is true. This method returns multiple merges (mergeFactor at a time) so the MergeScheduler in use may make use of concurrency.
public FindMergesForOptimize ( SegmentInfos infos, int maxNumSegments, ISet segmentsToOptimize ) : MergeSpecification
infos SegmentInfos
maxNumSegments int
segmentsToOptimize ISet
리턴 MergeSpecification

FindMergesToExpungeDeletes() 공개 메소드

Finds merges necessary to expunge all deletes from the index. We simply merge adjacent segments that have deletes, up to mergeFactor at a time.
public FindMergesToExpungeDeletes ( SegmentInfos segmentInfos ) : MergeSpecification
segmentInfos SegmentInfos
리턴 MergeSpecification

LogMergePolicy() 보호된 메소드

protected LogMergePolicy ( IndexWriter writer ) : System
writer IndexWriter
리턴 System

MakeOneMerge() 보호된 메소드

protected MakeOneMerge ( SegmentInfos infos, SegmentInfos infosToMerge ) : OneMerge
infos SegmentInfos
infosToMerge SegmentInfos
리턴 OneMerge

SetUseCompoundDocStore() 공개 메소드

Sets whether compound file format should be used for newly flushed and newly merged doc store segment files (term vectors and stored fields).
public SetUseCompoundDocStore ( bool useCompoundDocStore ) : void
useCompoundDocStore bool
리턴 void

SetUseCompoundFile() 공개 메소드

Gets or sets whether compound file format should be used for newly flushed and newly merged segments.
public SetUseCompoundFile ( bool useCompoundFile ) : void
useCompoundFile bool
리턴 void

Size() 추상적인 보호된 메소드

abstract protected Size ( SegmentInfo info ) : long
info SegmentInfo
리턴 long

SizeBytes() 보호된 메소드

protected SizeBytes ( SegmentInfo info ) : long
info SegmentInfo
리턴 long

SizeDocs() 보호된 메소드

protected SizeDocs ( SegmentInfo info ) : long
info SegmentInfo
리턴 long

UseCompoundDocStore() 공개 메소드

public UseCompoundDocStore ( SegmentInfos infos ) : bool
infos SegmentInfos
리턴 bool

UseCompoundFile() 공개 메소드

public UseCompoundFile ( SegmentInfos infos, SegmentInfo info ) : bool
infos SegmentInfos
info SegmentInfo
리턴 bool

Verbose() 보호된 메소드

protected Verbose ( ) : bool
리턴 bool

프로퍼티 상세

DEFAULT_MAX_MERGE_DOCS 공개적으로 정적으로 프로퍼티

Default maximum segment size. A segment of this size
public static int DEFAULT_MAX_MERGE_DOCS
리턴 int

DEFAULT_NO_CFS_RATIO 공개적으로 정적으로 프로퍼티

Default noCFSRatio. If a merge's size is >= 10% of the index, then we disable compound file for it. See SetNoCFSRatio
public static double DEFAULT_NO_CFS_RATIO
리턴 double

internalCalibrateSizeByDeletes 보호되어 있는 프로퍼티

protected bool internalCalibrateSizeByDeletes
리턴 bool

internalNoCFSRatio 보호되어 있는 프로퍼티

protected double internalNoCFSRatio
리턴 double