org.apache.lucene.index

## Class MockRandomMergePolicy

- java.lang.Object
- - org.apache.lucene.index.MergePolicy
  - - org.apache.lucene.index.MockRandomMergePolicy

-     public class MockRandomMergePolicy
      extends MergePolicy

  MergePolicy that makes random decisions for testing.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.index.MergePolicy

      `MergePolicy.MergeAbortedException, MergePolicy.MergeContext, MergePolicy.MergeException, MergePolicy.MergeSpecification, MergePolicy.OneMerge, MergePolicy.OneMergeProgress`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.index.MergePolicy

      `DEFAULT_MAX_CFS_SEGMENT_SIZE, DEFAULT_NO_CFS_RATIO, maxCFSSegmentSize, noCFSRatio`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockRandomMergePolicy(Random random)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `MergePolicy.MergeSpecification` | `findForcedDeletesMerges(SegmentInfos segmentInfos, MergePolicy.MergeContext mergeContext)`
    `MergePolicy.MergeSpecification` | `findForcedMerges(SegmentInfos segmentInfos, int maxSegmentCount, Map<SegmentCommitInfo,Boolean> segmentsToMerge, MergePolicy.MergeContext mergeContext)`
    `MergePolicy.MergeSpecification` | `findFullFlushMerges(MergeTrigger mergeTrigger, SegmentInfos segmentInfos, MergePolicy.MergeContext mergeContext)`
    `MergePolicy.MergeSpecification` | `findMerges(MergeTrigger mergeTrigger, SegmentInfos segmentInfos, MergePolicy.MergeContext mergeContext)`
    `void` | `setDoNonBulkMerges(boolean v)` Set to true if sometimes readers to be merged should be wrapped in a FilterReader to mixup bulk merging.
    `boolean` | `useCompoundFile(SegmentInfos infos, SegmentCommitInfo mergedInfo, MergePolicy.MergeContext mergeContext)`

    - ### Methods inherited from class org.apache.lucene.index.MergePolicy

      `assertDelCount, getMaxCFSSegmentSizeMB, getNoCFSRatio, isMerged, keepFullyDeletedSegment, message, numDeletesToMerge, segString, setMaxCFSSegmentSizeMB, setNoCFSRatio, size, verbose`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MockRandomMergePolicy

          public MockRandomMergePolicy(Random random)

  - ### Method Detail

    - #### setDoNonBulkMerges

          public void setDoNonBulkMerges(boolean v)

      Set to true if sometimes readers to be merged should be wrapped in a FilterReader to mixup bulk merging.

    - #### findMerges

          public MergePolicy.MergeSpecification findMerges(MergeTrigger mergeTrigger,
                                                           SegmentInfos segmentInfos,
                                                           MergePolicy.MergeContext mergeContext)

      Specified by:
        `findMerges` in class `MergePolicy`

    - #### findForcedMerges

          public MergePolicy.MergeSpecification findForcedMerges(SegmentInfos segmentInfos,
                                                                 int maxSegmentCount,
                                                                 Map<SegmentCommitInfo,Boolean> segmentsToMerge,
                                                                 MergePolicy.MergeContext mergeContext)
                                                          throws IOException

      Specified by:
        `findForcedMerges` in class `MergePolicy`
      Throws:
        `IOException`

    - #### findForcedDeletesMerges

          public MergePolicy.MergeSpecification findForcedDeletesMerges(SegmentInfos segmentInfos,
                                                                        MergePolicy.MergeContext mergeContext)
                                                                 throws IOException

      Specified by:
        `findForcedDeletesMerges` in class `MergePolicy`
      Throws:
        `IOException`

    - #### findFullFlushMerges

          public MergePolicy.MergeSpecification findFullFlushMerges(MergeTrigger mergeTrigger,
                                                                    SegmentInfos segmentInfos,
                                                                    MergePolicy.MergeContext mergeContext)
                                                             throws IOException

      Overrides:
        `findFullFlushMerges` in class `MergePolicy`
      Throws:
        `IOException`

    - #### useCompoundFile

          public boolean useCompoundFile(SegmentInfos infos,
                                         SegmentCommitInfo mergedInfo,
                                         MergePolicy.MergeContext mergeContext)
                                  throws IOException

      Overrides:
        `useCompoundFile` in class `MergePolicy`
      Throws:
        `IOException`

Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.