Class MockRandomMergePolicy
Lucene.Net.Index.MergePolicy that makes random decisions for testing.
Implements
Inherited Members
Namespace: Lucene.Net.Index
Assembly: Lucene.Net.TestFramework.dll
Syntax
public class MockRandomMergePolicy : MergePolicy, IDisposable
Constructors
MockRandomMergePolicy(Random)
Lucene.Net.Index.MergePolicy that makes random decisions for testing.
Declaration
public MockRandomMergePolicy(Random random)
Parameters
Type | Name | Description |
---|---|---|
Random | random |
Methods
Dispose(bool)
Release all resources for the policy.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Overrides
FindForcedDeletesMerges(SegmentInfos)
Determine what set of merge operations is necessary in order to expunge all deletes from the index.
Declaration
public override MergePolicy.MergeSpecification FindForcedDeletesMerges(SegmentInfos segmentInfos)
Parameters
Type | Name | Description |
---|---|---|
SegmentInfos | segmentInfos | the total set of segments in the index |
Returns
Type | Description |
---|---|
MergePolicy.MergeSpecification |
Overrides
FindForcedMerges(SegmentInfos, int, IDictionary<SegmentCommitInfo, bool>)
Determine what set of merge operations is necessary in order to merge to <= the specified segment count. Lucene.Net.Index.IndexWriter calls this when its ForceMerge(int, bool) method is called. This call is always synchronized on the Lucene.Net.Index.IndexWriter instance so only one thread at a time will call this method.
Declaration
public override MergePolicy.MergeSpecification FindForcedMerges(SegmentInfos segmentInfos, int maxSegmentCount, IDictionary<SegmentCommitInfo, bool> segmentsToMerge)
Parameters
Type | Name | Description |
---|---|---|
SegmentInfos | segmentInfos | The total set of segments in the index |
int | maxSegmentCount | Requested maximum number of segments in the index (currently this is always 1) |
IDictionary<SegmentCommitInfo, bool> | segmentsToMerge | Contains the specific Lucene.Net.Index.SegmentInfo instances that must be merged
away. This may be a subset of all
SegmentInfos. If the value is |
Returns
Type | Description |
---|---|
MergePolicy.MergeSpecification |
Overrides
FindMerges(MergeTrigger, SegmentInfos)
Determine what set of merge operations are now necessary on the index. Lucene.Net.Index.IndexWriter calls this whenever there is a change to the segments. This call is always synchronized on the Lucene.Net.Index.IndexWriter instance so only one thread at a time will call this method.
Declaration
public override MergePolicy.MergeSpecification FindMerges(MergeTrigger mergeTrigger, SegmentInfos segmentInfos)
Parameters
Type | Name | Description |
---|---|---|
MergeTrigger | mergeTrigger | the event that triggered the merge |
SegmentInfos | segmentInfos | the total set of segments in the index |
Returns
Type | Description |
---|---|
MergePolicy.MergeSpecification |
Overrides
UseCompoundFile(SegmentInfos, SegmentCommitInfo)
Returns true
if a new segment (regardless of its origin) should use the
compound file format. The default implementation returns true
iff the size of the given mergedInfo is less or equal to
Lucene.Net.Index.MergePolicy.MaxCFSSegmentSizeMB and the size is less or equal to the
TotalIndexSize * Lucene.Net.Index.MergePolicy.NoCFSRatio otherwise
false
.
Declaration
public override bool UseCompoundFile(SegmentInfos infos, SegmentCommitInfo mergedInfo)
Parameters
Type | Name | Description |
---|---|---|
SegmentInfos | infos | |
SegmentCommitInfo | mergedInfo |
Returns
Type | Description |
---|---|
bool |