## org.apache.lucene.index
Class MockRandomMergePolicy

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

All Implemented Interfaces:
  Closeable, 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.DocMap, MergePolicy.MergeAbortedException, MergePolicy.MergeException, MergePolicy.MergeSpecification, MergePolicy.MergeTrigger, MergePolicy.OneMerge`

Field Summary

Fields inherited from class org.apache.lucene.index.MergePolicy
`DEFAULT_MAX_CFS_SEGMENT_SIZE, DEFAULT_NO_CFS_RATIO, maxCFSSegmentSize, noCFSRatio, writer`

Constructor Summary
`MockRandomMergePolicy(Random random)`

Method Summary
`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, getMaxCFSSegmentSizeMB, getNoCFSRatio, isMerged, setIndexWriter, setMaxCFSSegmentSizeMB, setNoCFSRatio, size`

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 class `MergePolicy`

### useCompoundFile

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

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

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