You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Chris Hostetter <ho...@fucit.org> on 2007/08/01 10:17:07 UTC
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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: variuos IndexReader methods -- was: Re: [jira] Updated: (LUCENE-832)
NPE when calling isCurrent() on a ParallellReader
Posted by Michael Busch <bu...@gmail.com>.
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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: variuos IndexReader methods -- was: Re: [jira] Updated: (LUCENE-832)
NPE when calling isCurrent() on a ParallellReader
Posted by Chris Hostetter <ho...@fucit.org>.
: 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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: variuos IndexReader methods -- was: Re: [jira] Updated: (LUCENE-832)
NPE when calling isCurrent() on a ParallellReader
Posted by Michael Busch <bu...@gmail.com>.
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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org