Class OneMergeWrappingMergePolicy

    • Field Detail

    • Constructor Detail

      • OneMergeWrappingMergePolicy

        public OneMergeWrappingMergePolicy​(MergePolicy in,
                                           java.util.function.UnaryOperator<MergePolicy.OneMerge> wrapOneMerge)
        Constructor
        Parameters:
        in - - the wrapped merge policy
        wrapOneMerge - - operator for wrapping OneMerge objects
    • Method Detail

      • findMerges

        public MergePolicy.MergeSpecification findMerges​(MergeTrigger mergeTrigger,
                                                         SegmentInfos segmentInfos,
                                                         MergePolicy.MergeContext mergeContext)
                                                  throws java.io.IOException
        Description copied from class: MergePolicy
        Determine what set of merge operations are now necessary on the index. IndexWriter calls this whenever there is a change to the segments. This call is always synchronized on the IndexWriter instance so only one thread at a time will call this method.
        Overrides:
        findMerges in class FilterMergePolicy
        Parameters:
        mergeTrigger - the event that triggered the merge
        segmentInfos - the total set of segments in the index
        mergeContext - the IndexWriter to find the merges on
        Throws:
        java.io.IOException
      • findForcedMerges

        public MergePolicy.MergeSpecification findForcedMerges​(SegmentInfos segmentInfos,
                                                               int maxSegmentCount,
                                                               java.util.Map<SegmentCommitInfo,​java.lang.Boolean> segmentsToMerge,
                                                               MergePolicy.MergeContext mergeContext)
                                                        throws java.io.IOException
        Description copied from class: MergePolicy
        Determine what set of merge operations is necessary in order to merge to <= the specified segment count. IndexWriter calls this when its IndexWriter.forceMerge(int) method is called. This call is always synchronized on the IndexWriter instance so only one thread at a time will call this method.
        Overrides:
        findForcedMerges in class FilterMergePolicy
        Parameters:
        segmentInfos - the total set of segments in the index
        maxSegmentCount - requested maximum number of segments in the index (currently this is always 1)
        segmentsToMerge - contains the specific SegmentInfo instances that must be merged away. This may be a subset of all SegmentInfos. If the value is True for a given SegmentInfo, that means this segment was an original segment present in the to-be-merged index; else, it was a segment produced by a cascaded merge.
        mergeContext - the IndexWriter to find the merges on
        Throws:
        java.io.IOException