org.apache.lucene.index

## Class MockRandomMergePolicy

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

- All Implemented Interfaces:
    Closeable, AutoCloseable, Cloneable

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

  - ### Field Summary

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

      `writer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockRandomMergePolicy(Random random)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `MergePolicy.MergeSpecification` | `findForcedDeletesMerges(SegmentInfos segmentInfos)`
    `MergePolicy.MergeSpecification` | `findForcedMerges(SegmentInfos segmentInfos, int maxSegmentCount, Map<SegmentInfoPerCommit,Boolean> segmentsToMerge)`
    `MergePolicy.MergeSpecification` | `findMerges(MergePolicy.MergeTrigger mergeTrigger, SegmentInfos segmentInfos)`
    `boolean` | `useCompoundFile(SegmentInfos infos, SegmentInfoPerCommit mergedInfo)`

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

      `clone, setIndexWriter`

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

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

- - ### Constructor Detail

    - #### MockRandomMergePolicy

          public MockRandomMergePolicy(Random random)

  - ### Method Detail

    - #### findMerges

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

      Specified by:
        `findMerges` in class `MergePolicy`

    - #### findForcedMerges

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

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

    - #### findForcedDeletesMerges

          public MergePolicy.MergeSpecification findForcedDeletesMerges(SegmentInfos segmentInfos)
                                                                 throws IOException

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

    - #### close

          public void close()

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in class `MergePolicy`

    - #### useCompoundFile

          public boolean useCompoundFile(SegmentInfos infos,
                                SegmentInfoPerCommit mergedInfo)
                                  throws IOException

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

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