lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Rutherglen (JIRA)" <>
Subject [jira] Commented: (LUCENE-1516) Integrate IndexReader with IndexWriter
Date Sat, 10 Jan 2009 02:07:59 GMT


Jason Rutherglen commented on LUCENE-1516:

It looks like DirectoryIndexReader needs to have an IndexWriter mode
as unfortunately subclassing won't work. In this context overriding a
method implies the IW mode is being used.

I assume we'll share the segmentInfos object from IW rather than
share a clone with the IR?

* DirectoryIndexReader.doCommit needs to be overridden 
* IndexReader uses the IndexDeletionPolicy from IndexWriter 
* DirectoryIndexReader.acquireWriteLock is overridden and synchronizes
  on the write lock of IndexWriter, other details need to be worked out
* Method requiring synchronization in IW: optimize, expungeDeletes,
  prepareCommit, flush, addIndexes, methods that modify segmentInfos.
  Do we synchronize on IW or writeLock? 
* addDocument, updateDocument, deleteDocument do not seem to require 
* IW.getReader returns a cloned reader. IW keeps it's own reference. 
  This is to allow IW to perform deletes using the internal reader rather than 
  open a new reader and in general not affect IW's reader while still sharing

> Integrate IndexReader with IndexWriter 
> ---------------------------------------
>                 Key: LUCENE-1516
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Jason Rutherglen
>            Priority: Minor
>             Fix For: 2.9
>   Original Estimate: 672h
>  Remaining Estimate: 672h
> The current problem is an IndexReader and IndexWriter cannot be open
> at the same time and perform updates as they both require a write
> lock to the index. While methods such as IW.deleteDocuments enables
> deleting from IW, methods such as IR.deleteDocument(int doc) and
> norms updating are not available from IW. This limits the
> capabilities of performing updates to the index dynamically or in
> realtime without closing the IW and opening an IR, deleting or
> updating norms, flushing, then opening the IW again, a process which
> can be detrimental to realtime updates. 
> This patch will expose an IndexWriter.getReader method that returns
> the currently flushed state of the index as a class that implements
> IndexReader. The new IR implementation will differ from existing IR
> implementations such as MultiSegmentReader in that flushing will
> synchronize updates with IW in part by sharing the write lock. All
> methods of IR will be usable including reopen and clone. 

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:
For additional commands, e-mail:

View raw message