[ 
https://issues.apache.org/jira/browse/LUCENE-847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518453
 ] 

Ning Li commented on LUCENE-847:
--------------------------------

On 8/8/07, Michael McCandless (JIRA) <[EMAIL PROTECTED]> wrote:
> Actually I was talking about my idea (to "simplify MergePolicy.merge
> API").  With the simplification (whereby MergePolicy.merge just
> returns the MergeSpecification instead of driving the merge itself) I
> believe it's simple to make a concurrency wrapper around any merge
> policy, and, have all necessary locking for SegmentInfos inside
> IndexWriter.

I agree with Mike. In fact, MergeSelector.select, which is the counterpart
of MergePolicy.merge in the patch I submitted for concurrent merge,
simply returns a MergeSpecification. It's simple and sufficient to have
all necessary lockings for SegmentInfos in one class, say IndexWriter.
For example, IndexWriter locks SegmentInfos when MergePolicy(MergeSelector)
picks a merge spec. Another example, when a merge is finished, say
IndexWriter.checkin is called which locks SegmentInfos and replaces
the source segment infos with the target segment info.


On 8/7/07, Steven Parkes (JIRA) <[EMAIL PROTECTED]> wrote:
> The synchronization is still tricky, since parts of segmentInfos are
> getting changed at various times and there are references and/or
> copies of it other places. And as Ning pointed out to me, we also
> have to deal with buffered delete terms. I'd say I got about 80% of
>the way there on the last go around. I'm hoping to get all the way
> this time.

It just occurred to me that there is a neat way to handle deletes that
are flushed during a concurrent merge. For example, MergePolicy
decides to merge segments B and C, with B's delete file 0001 and
C's 100. When the concurrent merge finishes, B's delete file becomes
0011 and C's 110. We do a simple computation on the delete bit
vectors and check in the merged segment with delete file 00110.


> Factor merge policy out of IndexWriter
> --------------------------------------
>
>                 Key: LUCENE-847
>                 URL: https://issues.apache.org/jira/browse/LUCENE-847
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Steven Parkes
>            Assignee: Steven Parkes
>         Attachments: concurrentMerge.patch, LUCENE-847.patch.txt, 
> LUCENE-847.txt
>
>
> If we factor the merge policy out of IndexWriter, we can make it pluggable, 
> making it possible for apps to choose a custom merge policy and for easier 
> experimenting with merge policy variants.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to