1+ to Christoph's proposal ;-)


Christoph Goller wrote:

Bernhard Messer wrote:

Hi Dmitry,

from the view of keeping the interface clean, it would be much better to have a seperate method in IndexReader like "isCurrent()" or even nicer "isValid()" which combines the system time of the index creation (stored in SegmentInfos) and the current version number. I think the implementation is not do difficult and can be done in a short period of time. If wanted, i can try provide a new patch implementing a new method in IndexReader "isValid()" which does exactly that.

Bernhard


As Dmitry said, we didnīt have the case of deleted indices in mind when we
introduced the version number. I think that the solution of initializing
the version number with the current time in milliseconds is very elegant
(a minimal change with all the desired effects).


For a clean API I propose the following:
*) Keep Bernhardīs initialization of version number
*) Remove (deprecate) static IndexReader.getCurrentVersion() methods.
*) Introduce a new public non-static IndexReader member function
boolean isValid() that is similar to the current aquireLock and checks
whether the IndexReader is still valid.

Christoph






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to