lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: IndexReader.commit - question on call to deleter.deleteFiles()
Date Tue, 19 Dec 2006 22:05:09 GMT
Doron Cohen wrote:
> Something in how Deleter is called by IndexReader.commit that I don't
> understand: IndexReader.commit() starts with:
>     if(hasChanges){
>       if (deleter == null) {
>         // In the MultiReader case, we share this deleter
>         // across all SegmentReaders:
>         setDeleter(new IndexFileDeleter(segmentInfos, directory)); //[A]
>         deleter.deleteFiles(); //[B]
>       }
>       if(directoryOwner){ //[C]
>         ...
> Isn't it wrong to delete anything by [B] before verifying ownership in [C]?
> In fact, seems that [B] would do nothing, because after [A],
> deleter.deletable is null.
> 
> So I think line [B] should be removed (at least for clarity), right?

I agree!  I'm not sure what I was thinking....

I will remove that line.

Mike

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


Mime
View raw message