Class LogDocMergePolicy


public class LogDocMergePolicy extends LogMergePolicy
This is a LogMergePolicy that measures size of a segment as the number of documents (not taking deletions into account).
  • Field Details

    • DEFAULT_MIN_MERGE_DOCS

      public static final int DEFAULT_MIN_MERGE_DOCS
      Default minimum segment size. @see setMinMergeDocs
      See Also:
  • Constructor Details

    • LogDocMergePolicy

      public LogDocMergePolicy()
      Sole constructor, setting all settings to their defaults.
  • Method Details

    • size

      protected long size(SegmentCommitInfo info, MergePolicy.MergeContext mergeContext) throws IOException
      Description copied from class: MergePolicy
      Return the byte size of the provided SegmentCommitInfo, pro-rated by percentage of non-deleted documents is set.
      Overrides:
      size in class MergePolicy
      Throws:
      IOException
    • setMinMergeDocs

      public void setMinMergeDocs(int minMergeDocs)
      Sets the minimum size for the lowest level segments. Any segments below this size are candidates for full-flush merges and merged more aggressively in order to avoid having a long tail of small segments. Large values of this parameter increase the merging cost during indexing if you flush small segments.
    • getMinMergeDocs

      public int getMinMergeDocs()
      Get the minimum size for a segment to remain un-merged.
      See Also: