lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: verifying index integrity
Date Tue, 06 Apr 2004 21:09:13 GMT
Weir, Michael wrote:
> I assume that it is possible to corrupt an index by crashing at just the right
> time.

It should not be possible to corrupt an index this way.

> I notice that there's a method IndexReader.unlock().  Does this method
> ensure that the index has not been corrupted?

If you use this method, it is possible to corrupt things.  In 
particular, if you unlock an index that another process is modifying, 
then modify it, then these two processes might step on one another.  So 
this method should only be called when you are certain that no one else 
is modifying the index.

There is no index integrity checker.  I suppose one could implement one 
by implementing a NullDirectory that ignores all reads and writes, then 
use IndexWriter.addIndexes() to add the index to be checked to a 
NullDirectory.  That would parse all of the files in the index.

Doug

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


Mime
View raw message