Re: IndexReader.getCurrentVersion() and IndexReader.lastModified()
Bernhard Messer <Bernhard.Messer <at> intrafind.de>
2004-06-03 10:15:21 GMT
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
Dmitry Serebrennikov wrote:
> Well, I know I didn't think of this case back when we were discussion
> this change. As a recap, the issue was mainly that on some
> architectures, the clock was not granular enough to detect updates
> reliably, so some test cases were failing some of the time. You are
> right, Bernhard, we didn't consider longer running systems where
> entire indexes might be deleted and recreated while the cache was
> still around.
>
> I don't know, having version start out as a date and then get
> incremented as a version leaves a bad taste in my mouth somehow. At
> the time, we discussed other ideas that would use the date "most of
> the time" but would increment it explicitly if the clock was seen as
> not being granular enough. But the simple 0-based version number was
> seen as a much cleaner and superior solution when it was proposed.
>
> Perhaps it would be cleaner to leave the version number 0-based and
(Continue reading)