You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jason Rutherglen (JIRA)" <ji...@apache.org> on 2009/02/06 23:44:59 UTC

[jira] Issue Comment Edited: (LUCENE-1314) IndexReader.clone

    [ https://issues.apache.org/jira/browse/LUCENE-1314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671362#action_12671362 ] 

jasonrutherglen edited comment on LUCENE-1314 at 2/6/09 2:43 PM:
------------------------------------------------------------------

Now that we've got IndexReader.getSequentialSubReaders(), users may
try to clone the sub-readers which throws the exception below. I'd
like to support cloning individual segment readers because some cases
require cloning on the existing segments, without reloading the new
segments. 

The use case is realtime search where the ram index is being flushed
to disk in the background and we don't need IR.clone to also open the
new segments. The old segments could be acquiring deletes as the
background flush to disk is occurring. I suppose I could write a hack
such that a clone is performed on the multireader, then only the old
segments are pulled out and deleted from.

Attached is a method TestIndexReaderClone.testCloneSubreaders that
tests individual segment reader clone.

{code}
java.lang.NullPointerException
	at org.apache.lucene.index.DirectoryIndexReader.clone(DirectoryIndexReader.java:171)
	at org.apache.lucene.index.DirectoryIndexReader.clone(DirectoryIndexReader.java:162)
	at org.apache.lucene.index.TestIndexReaderClone.testCloneSubreaders(TestIndexReaderClone.java:46)
{code}

      was (Author: jasonrutherglen):
    Now that we've got IndexReader.getSequentialSubReaders(), users may
try to clone the sub-readers which throws the exception below. I'd
like to support cloning individual segment readers because some cases
require cloning on the existing segments, without reloading the new
segments. 

The use case is realtime search where the ram index is being flushed
to disk in the background and we don't need IR.clone to also open the
new segments. The old segments could be acquiring deletes as the
background flush to disk is occurring. I suppose I could write a hack
such that a clone is performed on the multireader, then only the old
segments are pulled out segments and deleted from.

Attached is a method TestIndexReaderClone.testCloneSubreaders that
tests individual segment reader clone.

{code}
java.lang.NullPointerException
	at org.apache.lucene.index.DirectoryIndexReader.clone(DirectoryIndexReader.java:171)
	at org.apache.lucene.index.DirectoryIndexReader.clone(DirectoryIndexReader.java:162)
	at org.apache.lucene.index.TestIndexReaderClone.testCloneSubreaders(TestIndexReaderClone.java:46)
{code}
  
> IndexReader.clone
> -----------------
>
>                 Key: LUCENE-1314
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1314
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Index
>    Affects Versions: 2.3.1
>            Reporter: Jason Rutherglen
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch
>
>
> Based on discussion http://www.nabble.com/IndexReader.reopen-issue-td18070256.html.  The problem is reopen returns the same reader if there are no changes, so if docs are deleted from the new reader, they are also reflected in the previous reader which is not always desired behavior.

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org