lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Goller <gol...@detego-software.de>
Subject Re: cvs commit: jakarta-lucene/src/java/org/apache/lucene/index MultiReader.java FilterIndexReader.java IndexReader.java SegmentReader.java
Date Mon, 19 Apr 2004 19:28:54 GMT
Doug Cutting wrote:
> Christoph Goller wrote:
> 
>>> The non-public SegmentInfos makes an appearance here in a public API. 
>>> Perhaps this constructor should be package-private.
>>
>>
>> Both constructors of IndexReader or at least the one with SegmentInfos 
>> should
>> be made package-private. Thats probably better than protected.
> 
> 
> We need at least one that's not package private, so that classes outside 
> this package can implement the IndexReader API.

OK. I didn´t think about that. So I think IndexReader(Directory) should be
protected and the other one package-private.

>>> Or perhaps, since the SegmentInfos instance is only used once on line 
>>> 414, for version checking, we should instead add an abstract 
>>> getVersion() method implemented by subclasses.  Could that work?
>>
>>
>> Don´t know exactly what you mean here. We already have the 
>> getCurrentVersion
>> method in IndexReader, but you probably mean something else.
> 
> 
> I was trying to think of a way to avoid having to pass the SegmentInfos 
> to this constructor at all, since it is only used once to extract a 
> long.  Perhaps one could simply pass the long in?  Perhaps the 
> SegmentInfos field of IndexReader could be replaced with a version 
> field.  I'm just trying to reduce the IndexReader's dependencies on 
> package-private implementation stuff, to make it a more pure abstract 
> class.  This is not high-priority.

Now I understand. You are right, It seems possible to replace SegmentInfos
with a version number.

> 
>> Do you agree to the changes concerning the bahavior of undeleteAll and 
>> close?
> 
> 
> Yes, I think these look good.
> 

Concerning close, I would like to give a similar behavior to IndexWriter. It
should only close the directory if it was explicitly opened for it. Would this 
be ok?

I am currently racking my brain on the skipTo stuff. I hope to get it right
tomorrow. I didn´t do the proposed changes on the file format so far.
However, I meditated upon SegmentTermDocs.skipTo. Its really a headache :-)
I think I got it right now, but I haven´t done any tests except for the
usual unit tests. I commit it, so that you can have a look at it.

Hope to hear from you tomorrow.
Good night for now,

Christoph







---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message