Hi Steven, I haven't read the details, but should maxBufferedDocs be exposed in some subinterfaces instead of the MergePolicy interface? Since some policies may use it and others may use byte size or something else.
It's great that you've started on concurrent merge as well! I haven't got a chance to port my code to the trunk. But I want to share the design. 1) A merge thread is started when an IndexWriter is created and stopped when the IndexWriter is closed. (A single merge thread is used for simplicity. Multiple merge threads could be used.) 2) The merge thread periodically checks if there is merge work to do. This is done by synchronously checking segmentInfos and producing a MergeSpecification if there is merge work to do. 3) If a MergeSpecification is produced, the merge thread goes ahead and does the merge. Importantly, documents in the segments being merged may be deleted while the concurrent merge is happening. These deletes have to be remembered. 4) The merge is finished. The new segment should replace the segments it merged in segmentInfos. But before that, the appropriate deletes accumulated during the merge should be applied. Same as step 2), this step is also synchronous. When all done, go to step 2). I see you start a thread whenever there is merge work. Would it be hard to control system load? Comments? Cheers, Ning --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]