org.apache.lucene.index

## Class AlcoholicMergePolicy

- java.lang.Object
- - org.apache.lucene.index.MergePolicy
  - - org.apache.lucene.index.LogMergePolicy
    - - org.apache.lucene.index.AlcoholicMergePolicy

-     public class AlcoholicMergePolicy
      extends LogMergePolicy

  Merge policy for testing, it is like an alcoholic. It drinks (merges) at night, and randomly decides what to drink. During the daytime it sleeps.

  if tests pass with this, then they are likely to pass with any bizarro merge policy users might write.

  It is a fine bottle of champagne (Ordered by Martijn).

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

      `calibrateSizeByDeletes, DEFAULT_MAX_MERGE_DOCS, DEFAULT_MERGE_FACTOR, DEFAULT_NO_CFS_RATIO, LEVEL_LOG_SPAN, maxMergeDocs, maxMergeSize, maxMergeSizeForForcedMerge, mergeFactor, minMergeSize`

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

      `DEFAULT_MAX_CFS_SEGMENT_SIZE, maxCFSSegmentSize, noCFSRatio`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AlcoholicMergePolicy(TimeZone tz, Random random)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected long` | `size(SegmentCommitInfo info, IndexWriter writer)`

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

      `findForcedDeletesMerges, findForcedMerges, findMerges, getCalibrateSizeByDeletes, getMaxMergeDocs, getMergeFactor, isMerged, message, setCalibrateSizeByDeletes, setMaxMergeDocs, setMergeFactor, sizeBytes, sizeDocs, toString, verbose`

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

      `getMaxCFSSegmentSizeMB, getNoCFSRatio, isMerged, setMaxCFSSegmentSizeMB, setNoCFSRatio, useCompoundFile`

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

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

- - ### Constructor Detail

    - #### AlcoholicMergePolicy

          public AlcoholicMergePolicy(TimeZone tz,
                              Random random)

  - ### Method Detail

    - #### size

          protected long size(SegmentCommitInfo info,
                  IndexWriter writer)
                       throws IOException

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

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