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.DocMap, MergePolicy.MergeAbortedException, MergePolicy.MergeException, MergePolicy.MergeSpecification, MergePolicy.OneMerge`

  - ### 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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MergePolicy.MergeSpecification` | `findForcedDeletesMerges(SegmentInfos segmentInfos, IndexWriter writer)`
    `MergePolicy.MergeSpecification` | `findForcedMerges(SegmentInfos segmentInfos, int maxSegmentCount, Map<SegmentCommitInfo,Boolean> segmentsToMerge, IndexWriter writer)`
    `MergePolicy.MergeSpecification` | `findMerges(MergeTrigger mergeTrigger, SegmentInfos segmentInfos, IndexWriter writer)`
    `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, IndexWriter writer)`

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

      `getMaxCFSSegmentSizeMB, getNoCFSRatio, isMerged, setMaxCFSSegmentSizeMB, setNoCFSRatio, size`

    - ### 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,
                                                  IndexWriter writer)

      Specified by:
        `findMerges` in class `MergePolicy`

    - #### findForcedMerges

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

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

    - #### findForcedDeletesMerges

          public MergePolicy.MergeSpecification findForcedDeletesMerges(SegmentInfos segmentInfos,
                                                               IndexWriter writer)
                                                                 throws IOException

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

    - #### useCompoundFile

          public boolean useCompoundFile(SegmentInfos infos,
                                SegmentCommitInfo mergedInfo,
                                IndexWriter writer)
                                  throws IOException

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

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