Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-600

ParallelWriter companion to ParallelReader

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 2.1
    • None
    • core/index
    • None

    Description

      A new class ParallelWriter is provided that serves as a companion to ParallelReader. ParallelWriter meets all of the doc-id synchronization requirements of ParallelReader, subject to:
      1. ParallelWriter.addDocument() is synchronized, which might have an adverse effect on performance. The writes to the sub-indexes are, however, done in parallel.
      2. The application must ensure that the ParallelReader is never reopened inside ParallelWriter.addDocument(), else it might find the sub-indexes out of sync.
      3. The application must deal with recovery from ParallelWriter.addDocument() exceptions. Recovery must restore the synchronization of doc-ids, e.g. by deleting any trailing document(s) in one sub-index that were not successfully added to all sub-indexes, and then optimizing all sub-indexes.

      A new interface, Writable, is provided to abstract IndexWriter and ParallelWriter. This is in the same spirit as the existing Searchable and Fieldable classes.

      This implementation uses java 1.5. The patch applies against today's svn head. All tests pass, including the new TestParallelWriter.

      Attachments

        1. ParallelWriter.patch
          29 kB
          Chuck Williams

        Activity

          People

            Unassigned Unassigned
            manawiz Chuck Williams
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: