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
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DEFAULT_MAX_MERGE_DOCS int
DEFAULT_NO_CFS_RATIO double

Защищенные свойства (Protected)

Свойство Тип Описание
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