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

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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected long` | `size(SegmentCommitInfo info, MergePolicy.MergeContext mergeContext)`

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

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

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

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

    - ### 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,
                              MergePolicy.MergeContext mergeContext)
                       throws IOException

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

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