Steve Rowe wrote:


Why not just add 1000ms to the current time when touching the files (instead of waiting for a second to pass). I tried in on my Linux box (e2fs) via the java File.setLastModified() method, and it allowed the file to have a timestamp in the future.

Wouldn't this be a much smaller effort?

Yes! This is a great idea!


I think to make this work, the new timestamp should be set to the old timestamp + N, where N is the corsest resolution of the timestamp that Lucene is willing to support. For example, if the old segments file has timestamp t1, and a new file is created at t2, the new timestamp should be t1 + N, not t2 + N. I think this will help with cases when t2 is less than t1 + N. Without it, if we have two updates in quick succession, the second update may happen before the time set on the segments file by the first update, and the new timestamp may be rounded to the same value as the old. But I think if we always make sure that the new timestamp is greater than the timestamp on the old file (even if the old file's timestamp is still in the future), this should work.

Can anyone see a problem with this implementation?
Dmitry



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



Reply via email to