Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

variuos IndexReader methods -- was: Re: [jira] Updated: (LUCENE-832) NPE when calling isCurrent() on a ParallellReader

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


hossman_lucene at fucit

Aug 1, 2007, 1:17 AM

Post #1 of 4 (929 views)
Permalink
variuos IndexReader methods -- was: Re: [jira] Updated: (LUCENE-832) NPE when calling isCurrent() on a ParallellReader

is it just me, or does it seem like the base class versions of
getVersion(), isOptimized(), and isCurrent() in IndexReader should all
throw UnsupportedOperationException?

(it seems like ideally they should abstract, but that ship/API has sailed)


: This patch fixes ParallelReader similar to LUCENE-781:
:
: * ParallelReader.getVersion() now throws an
: UnsupportedOperationException.
:
: * ParallelReader.isOptimized() now checks if all underlying
: indexes are optimized and returns true in such a case.
:
: * ParallelReader.isCurrent() now checks if all underlying
: IndexReaders are up to date and returns true in such a case.



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


buschmic at gmail

Aug 2, 2007, 12:10 PM

Post #2 of 4 (888 views)
Permalink
Re: variuos IndexReader methods -- was: Re: [jira] Updated: (LUCENE-832) NPE when calling isCurrent() on a ParallellReader [In reply to]

Chris Hostetter wrote:
> is it just me, or does it seem like the base class versions of
> getVersion(), isOptimized(), and isCurrent() in IndexReader should all
> throw UnsupportedOperationException?
>
> (it seems like ideally they should abstract, but that ship/API has sailed)
>
>

Hoss,

I think this makes sense because all these methods use the variable
IndexReader.segmentInfos which might be null in case this constructor is
used:
protected IndexReader(Directory directory);

We just have to make segmentInfos in IndexReader protected so that
subclasses can implement the methods.

- Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


hossman_lucene at fucit

Aug 11, 2007, 7:32 PM

Post #3 of 4 (861 views)
Permalink
Re: variuos IndexReader methods -- was: Re: [jira] Updated: (LUCENE-832) NPE when calling isCurrent() on a ParallellReader [In reply to]

: We just have to make segmentInfos in IndexReader protected so that
: subclasses can implement the methods.

isn't segmentInfos the kind of thing that should be refactored into the
subclasses? there might be a little duplication, but it shouldn't be
significant (and it helps eliminate the odds of other problems like this
in the future as more features/methods get added).


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene


buschmic at gmail

Aug 16, 2007, 11:52 PM

Post #4 of 4 (845 views)
Permalink
Re: variuos IndexReader methods -- was: Re: [jira] Updated: (LUCENE-832) NPE when calling isCurrent() on a ParallellReader [In reply to]

Chris Hostetter wrote:
>
> isn't segmentInfos the kind of thing that should be refactored into the
> subclasses? there might be a little duplication, but it shouldn't be
> significant (and it helps eliminate the odds of other problems like this
> in the future as more features/methods get added).
>

Hmm, not sure about this. The commit/rollback logic in IndexReader uses
segmentInfos. I have to dig into this to understand how easy it is to
refactor it into the subclasses.

- Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe [at] lucene
For additional commands, e-mail: java-dev-help [at] lucene

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.