lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Roberts <m...@andy-roberts.net>
Subject Re: Best way to purposely corrupt an index?
Date Wed, 20 Apr 2005 09:43:05 GMT
On Wednesday 20 Apr 2005 08:27, Maik Schreiber wrote:
> > As the index is rather critical to my program, I just wanted to make it
> > really robust, and able to cope should a problem occur with the index
> > itself. Otherwise, the user will be left with a non-functioning program
> > with no explanation. That's my reasoning anyway.
>
> You should perhaps go about implementing an automatic index backup feature
> of some sort. In the case of index corruption you would at least be able to
> go back to the latest backup.

Don't worry, I know what I intend to do *should* an error exist. My original 
post was about how to detect corrupt indexes, and also how to purposely 
corrupt an index for the purposes of testing.

Note, IndexReader throws IOExceptions, but, this could be for a multitude of 
reasons, not just a corrupt index. I was rather hoping for a 
CorruptIndexException of some sort!

It looks to me that if I do get an IOException, I will then have to perform a 
number of additional checks to eliminate the other possible causes of 
IOExceptions (such as permissions issues), and by a process of elimination, 
determine a corrupt index.

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


Mime
View raw message