lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Earwin Burrfoot (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-1651) Make IndexReader.open() always return MSR to simplify (re-)opens.
Date Wed, 03 Jun 2009 06:40:08 GMT

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

Earwin Burrfoot commented on LUCENE-1651:
-----------------------------------------

Seems the patch didn't apply completely. Your line numbers are off, also directory/readOnly
are now members of SegmentReader, no way they can't be seen:

{code}
class SegmentReader extends IndexReader implements Cloneable {
  protected Directory directory;
  protected boolean readOnly;

  private String segment;
  private SegmentInfo si;
  private int readBufferSize;
{code}

Here's corresponding part of the patch, I bet $Id$ is the reason.
{code}
-/**
- * @version $Id$
- */
-class SegmentReader extends DirectoryIndexReader {
+/** @version $Id$ */
+class SegmentReader extends IndexReader implements Cloneable {
+  protected Directory directory;
+  protected boolean readOnly;
+
{code}

> Make IndexReader.open() always return MSR to simplify (re-)opens.
> -----------------------------------------------------------------
>
>                 Key: LUCENE-1651
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1651
>             Project: Lucene - Java
>          Issue Type: Task
>    Affects Versions: 2.9
>            Reporter: Earwin Burrfoot
>            Assignee: Michael McCandless
>             Fix For: 2.9
>
>         Attachments: LUCENE-1651-tag.patch, LUCENE-1651.patch, LUCENE-1651.patch
>
>
> As per discussion in mailing list, I'm making DirectoryIndexReader.open() always return
MSR, even for single-segment indexes.
> While theoretically valid in the past (if you make sure to keep your index constantly
optimized) this feature is made practically obsolete by per-segment collection.
> The patch somewhat de-hairies (re-)open logic for MSR/SR.
> SR no longer needs an ability to pose as toplevel directory-owning IR.
> All related logic is moved from DIR to MSR.
> DIR becomes almost empty, and copying two or three remaining fields over to MSR/SR, I
remove it.
> Lots of tests fail, as they rely on SR returned from IR.open(), I fix by introducing
SR.getOnlySegmentReader static package-private method.
> Some previous bugs are uncovered, one is fixed in LUCENE-1645, another (partially fixed
in LUCENE-1648) is fixed in this patch. 

-- 
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


Mime
View raw message